Renamed video_resolution to stream_resolution
This commit is contained in:
parent
36ee715fcb
commit
e30956d761
5 changed files with 15 additions and 15 deletions
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class ConfigAPI(MicroscopeView):
|
|||
"plugins": [
|
||||
"openflexure_microscope.plugins.default:Plugin"
|
||||
],
|
||||
"video_resolution": [
|
||||
"stream_resolution": [
|
||||
832,
|
||||
624
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
||||
|
|
|
|||
|
|
@ -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)]:
|
||||
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue