BE saving selected video mode for camera

resolution var needs to be an outer pipline value and not change on pipline changes
This commit is contained in:
ori
2019-06-17 11:16:36 -07:00
parent b93463b2b8
commit e4d2f9698f
2 changed files with 8 additions and 1 deletions

View File

@@ -123,6 +123,13 @@ class SettingsManager(metaclass=Singleton):
self.usb_cameras[camera_name].setExposureManual(dic["exposure"])
if "resolution" in dic:
video_mode: VideoMode = self.usb_cameras[camera_name].enumerateVideoModes()[int(dic["resolution"])]
self.cams[camera_name]["video_mode"] = {
"fps": video_mode.fps,
"width": video_mode.width,
"height": video_mode.height,
"pixel_format": str(video_mode.pixelFormat).split('.')[1]
}
self.usb_cameras[camera_name].setVideoMode(self.usb_cameras[camera_name].enumerateVideoModes()[int(dic["resolution"])])
# Access methods