From fe95a539baa4fead5567506de33e8d021232667d Mon Sep 17 00:00:00 2001 From: Josh Miklos Date: Mon, 13 Apr 2020 20:07:27 -0700 Subject: [PATCH] fixed pub_cam_loop_pyv4l2 mypy, docstring --- displayarray/frame/frame_publishing.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/displayarray/frame/frame_publishing.py b/displayarray/frame/frame_publishing.py index ce371ea..e44099f 100644 --- a/displayarray/frame/frame_publishing.py +++ b/displayarray/frame/frame_publishing.py @@ -35,24 +35,24 @@ def pub_cam_loop_pyv4l2( fps_limit: float = float("inf"), ): """ - Publish whichever camera you select to CVCams..Vid, using v4l2 instead of opencv. + Publish whichever camera you select to CVCams..Vid, using v4l2 instead of opencv. - You can send a quit command 'quit' to CVCams..Cmd - Status information, such as failure to open, will be posted to CVCams..Status + You can send a quit command 'quit' to CVCams..Cmd + Status information, such as failure to open, will be posted to CVCams..Status - :param high_speed: Selects mjpeg transferring, which most cameras seem to support, so speed isn't limited - :param fps_limit: Limits the frames per second. - :param cam_id: An integer representing which webcam to use, or a string representing a video file. - :param request_size: A tuple with width, then height, to request the video size. - :return: True if loop ended normally, False if it failed somehow. - """ + :param high_speed: Selects mjpeg transferring, which most cameras seem to support, so speed isn't limited + :param fps_limit: Limits the frames per second. + :param cam_id: An integer representing which webcam to use, or a string representing a video file. + :param request_size: A tuple with width, then height, to request the video size. + :return: True if loop ended normally, False if it failed somehow. + """ name = uid_for_source(cam_id) if isinstance(cam_id, (int, str)): if isinstance(cam_id, int): - cam: pyv4lcamera = pyv4lcamera(f"/dev/video{cam_id}", *request_size) + cam: pyv4lcamera = pyv4lcamera(f"/dev/video{cam_id}", *request_size) # type: ignore else: - cam: pyv4lcamera = pyv4lcamera(cam_id, *request_size) + cam = pyv4lcamera(cam_id, *request_size) # type: ignore else: raise TypeError( "Only strings or ints representing cameras are supported with v4l2."