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
|
.. code-block:: yaml
|
||||||
|
|
||||||
# Resolutions for streaming and capture
|
# Resolutions for streaming and capture
|
||||||
video_resolution: [832, 624]
|
stream_resolution: [832, 624]
|
||||||
image_resolution: [2592, 1944]
|
image_resolution: [2592, 1944]
|
||||||
numpy_resolution: [1312, 976]
|
numpy_resolution: [1312, 976]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ class ConfigAPI(MicroscopeView):
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"openflexure_microscope.plugins.default:Plugin"
|
"openflexure_microscope.plugins.default:Plugin"
|
||||||
],
|
],
|
||||||
"video_resolution": [
|
"stream_resolution": [
|
||||||
832,
|
832,
|
||||||
624
|
624
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ Video port:
|
||||||
Splitter port 2: Video capture
|
Splitter port 2: Video capture
|
||||||
Splitter port 3: [Currently unused]
|
Splitter port 3: [Currently unused]
|
||||||
|
|
||||||
StreamingCamera streams at video_resolution
|
StreamingCamera streams at stream_resolution
|
||||||
Camera capture resolution set to video_resolution in frames()
|
Camera capture resolution set to stream_resolution in frames()
|
||||||
Video port uses that resolution for everything. If a different resolution
|
Video port uses that resolution for everything. If a different resolution
|
||||||
is specified for video capture, this is handled by the resizer.
|
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
|
# Handle config and picamera settings
|
||||||
CONFIG_KEYS = {
|
CONFIG_KEYS = {
|
||||||
'video_resolution': (1640, 1232),
|
'stream_resolution': (832, 624),
|
||||||
'image_resolution': (2592, 1944), # Default for PiCamera v1. Overridden in __init__
|
'image_resolution': (2592, 1944), # Default for PiCamera v1. Overridden in __init__
|
||||||
'numpy_resolution': (1312, 976),
|
'numpy_resolution': (1312, 976),
|
||||||
'jpeg_quality': 75,
|
'jpeg_quality': 75,
|
||||||
|
|
@ -304,7 +304,7 @@ class StreamingCamera(BaseCamera):
|
||||||
output_stream,
|
output_stream,
|
||||||
format=fmt,
|
format=fmt,
|
||||||
splitter_port=2,
|
splitter_port=2,
|
||||||
resize=self.config['video_resolution'],
|
resize=self.config['stream_resolution'],
|
||||||
quality=quality)
|
quality=quality)
|
||||||
|
|
||||||
# Update state dictionary
|
# Update state dictionary
|
||||||
|
|
@ -365,7 +365,7 @@ class StreamingCamera(BaseCamera):
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
splitter_port (int): Splitter port to start recording on
|
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 stream object was destroyed
|
||||||
if not hasattr(self, 'stream'):
|
if not hasattr(self, 'stream'):
|
||||||
|
|
@ -373,7 +373,7 @@ class StreamingCamera(BaseCamera):
|
||||||
|
|
||||||
# If no explicit resolution is passed
|
# If no explicit resolution is passed
|
||||||
if not resolution:
|
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
|
# Reduce the resolution for video streaming
|
||||||
try:
|
try:
|
||||||
|
|
@ -461,7 +461,7 @@ class StreamingCamera(BaseCamera):
|
||||||
"""
|
"""
|
||||||
with self.lock:
|
with self.lock:
|
||||||
if use_video_port:
|
if use_video_port:
|
||||||
resolution = self.config['video_resolution']
|
resolution = self.config['stream_resolution']
|
||||||
else:
|
else:
|
||||||
resolution = self.config['numpy_resolution']
|
resolution = self.config['numpy_resolution']
|
||||||
|
|
||||||
|
|
@ -501,7 +501,7 @@ class StreamingCamera(BaseCamera):
|
||||||
"""
|
"""
|
||||||
with self.lock:
|
with self.lock:
|
||||||
if use_video_port:
|
if use_video_port:
|
||||||
resolution = self.config['video_resolution']
|
resolution = self.config['stream_resolution']
|
||||||
else:
|
else:
|
||||||
resolution = self.config['numpy_resolution']
|
resolution = self.config['numpy_resolution']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class TestCapture(unittest.TestCase):
|
||||||
|
|
||||||
expected_keys = [
|
expected_keys = [
|
||||||
'image_resolution',
|
'image_resolution',
|
||||||
'video_resolution',
|
'stream_resolution',
|
||||||
'numpy_resolution',
|
'numpy_resolution',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ class TestCapture(unittest.TestCase):
|
||||||
|
|
||||||
def test_capture_videoport(self):
|
def test_capture_videoport(self):
|
||||||
connection = APIconnection(host="localhost", port=5000, api_ver="v1")
|
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)]:
|
for resize in [None, (640, 480)]:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class TestCaptureMethods(unittest.TestCase):
|
||||||
dims = resize
|
dims = resize
|
||||||
else:
|
else:
|
||||||
if use_video_port:
|
if use_video_port:
|
||||||
dims = camera.config['video_resolution']
|
dims = camera.config['stream_resolution']
|
||||||
else:
|
else:
|
||||||
dims = camera.config['image_resolution']
|
dims = camera.config['image_resolution']
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ class TestUnencodedMethods(unittest.TestCase):
|
||||||
dims = resize
|
dims = resize
|
||||||
else:
|
else:
|
||||||
if use_video_port:
|
if use_video_port:
|
||||||
dims = camera.config['video_resolution']
|
dims = camera.config['stream_resolution']
|
||||||
else:
|
else:
|
||||||
dims = camera.config['numpy_resolution']
|
dims = camera.config['numpy_resolution']
|
||||||
|
|
||||||
|
|
@ -180,7 +180,7 @@ class TestUnencodedMethods(unittest.TestCase):
|
||||||
dims = resize
|
dims = resize
|
||||||
else:
|
else:
|
||||||
if use_video_port:
|
if use_video_port:
|
||||||
dims = camera.config['video_resolution']
|
dims = camera.config['stream_resolution']
|
||||||
else:
|
else:
|
||||||
dims = camera.config['numpy_resolution']
|
dims = camera.config['numpy_resolution']
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue