Skip to content

Commit b90ac44

Browse files
authored
Merge pull request #1486 from jluebbe/logilink-ua0379
USBVideoDriver: add support LogiLink UA0379
2 parents 49f636a + 87cc175 commit b90ac44

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

labgrid/driver/usbvideodriver.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,49 @@ def get_qualities(self):
2727
("mid", "video/x-h264,width=1280,height=720,framerate=15/2"),
2828
("high", "video/x-h264,width=1920,height=1080,framerate=10/1"),
2929
])
30-
if match == (0x046d, 0x0892):
30+
elif match == (0x046d, 0x0892):
3131
return ("mid", [
3232
("low", "image/jpeg,width=640,height=360,framerate=5/1"),
3333
("mid", "image/jpeg,width=1280,height=720,framerate=15/2"),
3434
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
3535
])
36-
if match == (0x046d, 0x08e5): # Logitech HD Pro Webcam C920
36+
elif match == (0x046d, 0x08e5): # Logitech HD Pro Webcam C920
3737
return ("mid", [
3838
("low", "image/jpeg,width=640,height=360,framerate=5/1"),
3939
("mid", "image/jpeg,width=1280,height=720,framerate=15/2"),
4040
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
4141
])
42-
if match == (0x1224, 0x2825): # LogiLink UA0371
42+
elif match == (0x1224, 0x2825): # LogiLink UA0371
4343
return ("mid", [
4444
("low", "image/jpeg,width=640,height=480,framerate=30/1"),
4545
("mid", "image/jpeg,width=1280,height=720,framerate=30/1"),
4646
("high", "image/jpeg,width=1920,height=1080,framerate=30/1"),
4747
])
48-
if match == (0x05a3, 0x9331): # WansView Webcam 102
48+
elif match == (0x05a3, 0x9331): # WansView Webcam 102
4949
return ("mid", [
5050
("low","video/x-h264,width=640,height=360,framerate=30/1"),
5151
("mid","video/x-h264,width=1280,height=720,framerate=30/1"),
5252
("high","video/x-h264,width=1920,height=1080,framerate=30/1"),
5353
])
54-
if match == (0x534d, 0x2109): # MacroSilicon
54+
elif match == (0x534d, 0x2109): # MacroSilicon
5555
return ("mid", [
5656
("low", "image/jpeg,width=720,height=480,framerate=10/1"),
5757
("mid", "image/jpeg,width=1280,height=720,framerate=10/1"),
5858
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
5959
])
60-
if match == (0x1d6c, 0x0103): # HD 2MP WEBCAM
60+
elif match == (0x1d6c, 0x0103): # HD 2MP WEBCAM
6161
return ("mid", [
6262
("low", "video/x-h264,width=640,height=480,framerate=25/1"),
6363
("mid", "video/x-h264,width=1280,height=720,framerate=25/1"),
6464
("high", "video/x-h264,width=1920,height=1080,framerate=25/1"),
6565
])
66-
if match == (0x0c45, 0x636d): # AUKEY PC-LM1E
66+
elif match == (0x0c45, 0x636b): # LogiLink UA0379 / Microdia
67+
return ("mid", [
68+
("low", "image/jpeg,width=640,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
69+
("mid", "image/jpeg,width=1280,height=720,pixel-aspect-ratio=1/1,framerate=30/1"),
70+
("high", "image/jpeg,width=1920,height=1080,pixel-aspect-ratio=1/1,framerate=30/1"),
71+
])
72+
elif match == (0x0c45, 0x636d): # AUKEY PC-LM1E
6773
return ("mid", [
6874
("low", "image/jpeg,width=640,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
6975
("mid", "image/jpeg,width=864,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
@@ -108,6 +114,9 @@ def get_pipeline(self, path, caps, controls=None):
108114
elif match == (0x1d6c, 0x0103):
109115
controls = controls or "focus_auto=1"
110116
inner = "h264parse"
117+
elif match == (0x0c54, 0x636b):
118+
controls = controls or "focus_auto=1"
119+
inner = None # just forward the jpeg frames
111120
elif match == (0x0c54, 0x636d):
112121
controls = controls or "focus_auto=1"
113122
inner = None # just forward the jpeg frames
@@ -130,8 +139,7 @@ def stream(self, caps_hint=None, controls=None):
130139

131140
tx_cmd = self.video.command_prefix + ["gst-launch-1.0", "-q"]
132141
tx_cmd += pipeline.split()
133-
rx_cmd = ["gst-launch-1.0"]
134-
rx_cmd += "playbin3 buffer-duration=0 uri=fd://0".split()
142+
rx_cmd = ["gst-launch-1.0", "playbin3", "buffer-duration=0", "uri=fd://0"]
135143

136144
tx = subprocess.Popen(
137145
tx_cmd,

0 commit comments

Comments
 (0)