From 584bdf1d80b34c3365508ca72ab33c12290beb0e Mon Sep 17 00:00:00 2001 From: DiTheRX Date: Mon, 12 Aug 2024 21:59:59 +0300 Subject: [PATCH] A little bit of change --- BabbleApp/camera_widget.py | 2 ++ BabbleApp/utils/misc_utils.py | 3 +-- requirements.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BabbleApp/camera_widget.py b/BabbleApp/camera_widget.py index 4d41909..d349505 100644 --- a/BabbleApp/camera_widget.py +++ b/BabbleApp/camera_widget.py @@ -268,6 +268,8 @@ class CameraWidget: "http" not in value and ".mp4" not in value and "udp" not in value + and "COM" not in value + and "/dev/tty" not in value and value not in self.camera_list ): # If http is not in camera address, add it. self.config.capture_source = f"http://{values[self.gui_camera_addr]}/" diff --git a/BabbleApp/utils/misc_utils.py b/BabbleApp/utils/misc_utils.py index 8dc3fcb..d1e5785 100644 --- a/BabbleApp/utils/misc_utils.py +++ b/BabbleApp/utils/misc_utils.py @@ -3,10 +3,10 @@ import typing from pygrabber.dshow_graph import FilterGraph is_nt = True if os.name == "nt" else False +graph = FilterGraph() def list_camera_names(): - graph = FilterGraph() cam_list = graph.get_input_devices() cam_names = [] for index, name in enumerate(cam_list): @@ -15,7 +15,6 @@ def list_camera_names(): def get_camera_index_by_name(name): - graph = FilterGraph() cam_list = graph.get_input_devices() for i, device_name in enumerate(cam_list): diff --git a/requirements.txt b/requirements.txt index 7284cad..a41a3ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ pyserial colorama winotify poetry +pygrabber