Skip to content

Commit

Permalink
Merge pull request #1486 from jluebbe/logilink-ua0379
Browse files Browse the repository at this point in the history
USBVideoDriver: add support LogiLink UA0379
  • Loading branch information
jluebbe authored Nov 19, 2024
2 parents 49f636a + 87cc175 commit b90ac44
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions labgrid/driver/usbvideodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,49 @@ def get_qualities(self):
("mid", "video/x-h264,width=1280,height=720,framerate=15/2"),
("high", "video/x-h264,width=1920,height=1080,framerate=10/1"),
])
if match == (0x046d, 0x0892):
elif match == (0x046d, 0x0892):
return ("mid", [
("low", "image/jpeg,width=640,height=360,framerate=5/1"),
("mid", "image/jpeg,width=1280,height=720,framerate=15/2"),
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
])
if match == (0x046d, 0x08e5): # Logitech HD Pro Webcam C920
elif match == (0x046d, 0x08e5): # Logitech HD Pro Webcam C920
return ("mid", [
("low", "image/jpeg,width=640,height=360,framerate=5/1"),
("mid", "image/jpeg,width=1280,height=720,framerate=15/2"),
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
])
if match == (0x1224, 0x2825): # LogiLink UA0371
elif match == (0x1224, 0x2825): # LogiLink UA0371
return ("mid", [
("low", "image/jpeg,width=640,height=480,framerate=30/1"),
("mid", "image/jpeg,width=1280,height=720,framerate=30/1"),
("high", "image/jpeg,width=1920,height=1080,framerate=30/1"),
])
if match == (0x05a3, 0x9331): # WansView Webcam 102
elif match == (0x05a3, 0x9331): # WansView Webcam 102
return ("mid", [
("low","video/x-h264,width=640,height=360,framerate=30/1"),
("mid","video/x-h264,width=1280,height=720,framerate=30/1"),
("high","video/x-h264,width=1920,height=1080,framerate=30/1"),
])
if match == (0x534d, 0x2109): # MacroSilicon
elif match == (0x534d, 0x2109): # MacroSilicon
return ("mid", [
("low", "image/jpeg,width=720,height=480,framerate=10/1"),
("mid", "image/jpeg,width=1280,height=720,framerate=10/1"),
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
])
if match == (0x1d6c, 0x0103): # HD 2MP WEBCAM
elif match == (0x1d6c, 0x0103): # HD 2MP WEBCAM
return ("mid", [
("low", "video/x-h264,width=640,height=480,framerate=25/1"),
("mid", "video/x-h264,width=1280,height=720,framerate=25/1"),
("high", "video/x-h264,width=1920,height=1080,framerate=25/1"),
])
if match == (0x0c45, 0x636d): # AUKEY PC-LM1E
elif match == (0x0c45, 0x636b): # LogiLink UA0379 / Microdia
return ("mid", [
("low", "image/jpeg,width=640,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
("mid", "image/jpeg,width=1280,height=720,pixel-aspect-ratio=1/1,framerate=30/1"),
("high", "image/jpeg,width=1920,height=1080,pixel-aspect-ratio=1/1,framerate=30/1"),
])
elif match == (0x0c45, 0x636d): # AUKEY PC-LM1E
return ("mid", [
("low", "image/jpeg,width=640,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
("mid", "image/jpeg,width=864,height=480,pixel-aspect-ratio=1/1,framerate=30/1"),
Expand Down Expand Up @@ -108,6 +114,9 @@ def get_pipeline(self, path, caps, controls=None):
elif match == (0x1d6c, 0x0103):
controls = controls or "focus_auto=1"
inner = "h264parse"
elif match == (0x0c54, 0x636b):
controls = controls or "focus_auto=1"
inner = None # just forward the jpeg frames
elif match == (0x0c54, 0x636d):
controls = controls or "focus_auto=1"
inner = None # just forward the jpeg frames
Expand All @@ -130,8 +139,7 @@ def stream(self, caps_hint=None, controls=None):

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

tx = subprocess.Popen(
tx_cmd,
Expand Down

0 comments on commit b90ac44

Please sign in to comment.