fix boot and improve capture

This commit is contained in:
langolierz
2019-08-08 19:35:16 +00:00
parent 638178eb25
commit 92df0bf6b4
2 changed files with 21 additions and 19 deletions

View File

@@ -243,12 +243,12 @@ class Actions(object):
is_previewing = self.capture.is_previewing
if is_previewing:
self.capture.stop_preview()
if self.video_driver.current_player.status == 'PAUSED':
self.video_driver.current_player.toggle_pause()
#if self.video_driver.current_player.status == 'PAUSED':
#self.video_driver.current_player.toggle_pause()
else:
is_successful = self.capture.start_preview()
if is_successful and self.video_driver.current_player.status != 'PAUSED':
self.video_driver.current_player.toggle_pause()
#if is_successful and self.video_driver.current_player.status != 'PAUSED':
#self.video_driver.current_player.toggle_pause()
def toggle_capture_recording(self):
@@ -446,7 +446,8 @@ class Actions(object):
else:
self.data.update_setting_value('video', 'OUTPUT', 'hdmi')
if not self.data.settings['video']['HDMI_MODE']['value'] == "CEA 4 HDMI":
if self.data.settings['video']['HDMI_MODE']['value'] == "CEA 4 HDMI":
self.data.update_setting_value('video', 'HDMI_MODE', 'CEA 4 HDMI')
self.change_hdmi_settings('CEA 4 HDMI')

View File

@@ -23,20 +23,21 @@ class Capture(object):
def create_capture_device(self):
if self.use_capture:
if self.piCapture_with_no_source():
return False
self.update_capture_settings()
if self.data.settings['capture']['TYPE']['value'] != 'usb':
if self.use_capture:
if self.piCapture_with_no_source():
return False
self.update_capture_settings()
try:
self.device = picamera.PiCamera(resolution=self.resolution, framerate=self.framerate, sensor_mode = self.sensor_mode)
return True
except picamera.exc.PiCameraError as e:
self.use_capture = False
self.data.settings['capture']['DEVICE']['value'] = 'disabled'
print('camera exception is {}'.format(e))
self.message_handler.set_message('INFO', 'no capture device attached')
return False
try:
self.device = picamera.PiCamera(resolution=self.resolution, framerate=self.framerate, sensor_mode = self.sensor_mode)
return True
except picamera.exc.PiCameraError as e:
self.use_capture = False
self.data.settings['capture']['DEVICE']['value'] = 'disabled'
print('camera exception is {}'.format(e))
self.message_handler.set_message('INFO', 'no capture device attached')
return False
def piCapture_with_no_source(self):
is_piCapture = subprocess.check_output(['pivideo', '--query', 'ready'])