diff --git a/docs/source/config.rst b/docs/source/config.rst index 6af120d1..2444e860 100644 --- a/docs/source/config.rst +++ b/docs/source/config.rst @@ -22,7 +22,7 @@ Default microscope_settings.yaml .. code-block:: yaml # Resolutions for streaming and capture - video_resolution: [832, 624] + stream_resolution: [832, 624] image_resolution: [2592, 1944] numpy_resolution: [1312, 976] diff --git a/openflexure_microscope/api/v1/blueprints/base.py b/openflexure_microscope/api/v1/blueprints/base.py index 2dc7c600..2195a025 100644 --- a/openflexure_microscope/api/v1/blueprints/base.py +++ b/openflexure_microscope/api/v1/blueprints/base.py @@ -126,7 +126,7 @@ class ConfigAPI(MicroscopeView): "plugins": [ "openflexure_microscope.plugins.default:Plugin" ], - "video_resolution": [ + "stream_resolution": [ 832, 624 ] diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 68e8a837..e8df298c 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -12,8 +12,8 @@ Video port: Splitter port 2: Video capture Splitter port 3: [Currently unused] -StreamingCamera streams at video_resolution -Camera capture resolution set to video_resolution in frames() +StreamingCamera streams at stream_resolution +Camera capture resolution set to stream_resolution in frames() Video port uses that resolution for everything. If a different resolution is specified for video capture, this is handled by the resizer. @@ -41,7 +41,7 @@ from .set_picamera_gain import set_analog_gain, set_digital_gain # Handle config and picamera settings CONFIG_KEYS = { - 'video_resolution': (1640, 1232), + 'stream_resolution': (832, 624), 'image_resolution': (2592, 1944), # Default for PiCamera v1. Overridden in __init__ 'numpy_resolution': (1312, 976), 'jpeg_quality': 75, @@ -304,7 +304,7 @@ class StreamingCamera(BaseCamera): output_stream, format=fmt, splitter_port=2, - resize=self.config['video_resolution'], + resize=self.config['stream_resolution'], quality=quality) # Update state dictionary @@ -365,7 +365,7 @@ class StreamingCamera(BaseCamera): Args: splitter_port (int): Splitter port to start recording on - resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['video_resolution']`. + resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.config['stream_resolution']`. """ # If stream object was destroyed if not hasattr(self, 'stream'): @@ -373,7 +373,7 @@ class StreamingCamera(BaseCamera): # If no explicit resolution is passed if not resolution: - resolution = self.config['video_resolution'] # Default to video recording resolution + resolution = self.config['stream_resolution'] # Default to video recording resolution # Reduce the resolution for video streaming try: @@ -461,7 +461,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: - resolution = self.config['video_resolution'] + resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] @@ -501,7 +501,7 @@ class StreamingCamera(BaseCamera): """ with self.lock: if use_video_port: - resolution = self.config['video_resolution'] + resolution = self.config['stream_resolution'] else: resolution = self.config['numpy_resolution'] diff --git a/tests/test_api.py b/tests/test_api.py index 1cbfd09c..60a2142b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -17,7 +17,7 @@ class TestCapture(unittest.TestCase): expected_keys = [ 'image_resolution', - 'video_resolution', + 'stream_resolution', 'numpy_resolution', ] @@ -26,7 +26,7 @@ class TestCapture(unittest.TestCase): def test_capture_videoport(self): connection = APIconnection(host="localhost", port=5000, api_ver="v1") - resolution = connection.get_config()['video_resolution'] + resolution = connection.get_config()['stream_resolution'] for resize in [None, (640, 480)]: diff --git a/tests/test_camera.py b/tests/test_camera.py index 4c81f9b4..99238f91 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -81,7 +81,7 @@ class TestCaptureMethods(unittest.TestCase): dims = resize else: if use_video_port: - dims = camera.config['video_resolution'] + dims = camera.config['stream_resolution'] else: dims = camera.config['image_resolution'] @@ -148,7 +148,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: - dims = camera.config['video_resolution'] + dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution'] @@ -180,7 +180,7 @@ class TestUnencodedMethods(unittest.TestCase): dims = resize else: if use_video_port: - dims = camera.config['video_resolution'] + dims = camera.config['stream_resolution'] else: dims = camera.config['numpy_resolution']