Loading openflexure_microscope/api/utilities/__init__.py +0 −9 Original line number Diff line number Diff line Loading @@ -24,15 +24,6 @@ def blueprint_name_for_module(module_name, api_ver=2, suffix=""): return f"v{api_ver}_{bp_name}_blueprint{suffix}" def gen(camera): """Video streaming generator function.""" while True: # the obtained frame is a jpeg frame = camera.get_frame() yield (b"--frame\r\n" b"Content-Type: image/jpeg\r\n\r\n" + frame + b"\r\n") def get_bool(get_arg): """Convert GET request argument string to a Python bool""" if get_arg == "true" or get_arg == "True" or get_arg == "1": Loading openflexure_microscope/api/v2/views/streams.py +8 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,14 @@ from flask import Response from labthings import find_component from labthings.views import PropertyView from openflexure_microscope.api.utilities import gen def gen(camera): """Video streaming generator function.""" while True: # the obtained frame is a jpeg frame = camera.get_frame() yield (b"--frame\r\n" b"Content-Type: image/jpeg\r\n\r\n" + frame + b"\r\n") class MjpegStream(PropertyView): Loading Loading
openflexure_microscope/api/utilities/__init__.py +0 −9 Original line number Diff line number Diff line Loading @@ -24,15 +24,6 @@ def blueprint_name_for_module(module_name, api_ver=2, suffix=""): return f"v{api_ver}_{bp_name}_blueprint{suffix}" def gen(camera): """Video streaming generator function.""" while True: # the obtained frame is a jpeg frame = camera.get_frame() yield (b"--frame\r\n" b"Content-Type: image/jpeg\r\n\r\n" + frame + b"\r\n") def get_bool(get_arg): """Convert GET request argument string to a Python bool""" if get_arg == "true" or get_arg == "True" or get_arg == "1": Loading
openflexure_microscope/api/v2/views/streams.py +8 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,14 @@ from flask import Response from labthings import find_component from labthings.views import PropertyView from openflexure_microscope.api.utilities import gen def gen(camera): """Video streaming generator function.""" while True: # the obtained frame is a jpeg frame = camera.get_frame() yield (b"--frame\r\n" b"Content-Type: image/jpeg\r\n\r\n" + frame + b"\r\n") class MjpegStream(PropertyView): Loading