mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-05 16:00:06 +01:00
fix boot and improve capture
This commit is contained in:
11
actions.py
11
actions.py
@@ -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')
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user