Skip to content

Commit 8c7f5f7

Browse files
committed
driver/usbvideodriver: add support for HD 2MP WEBCAM
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
1 parent bd0ede7 commit 8c7f5f7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

labgrid/driver/usbvideodriver.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def get_qualities(self):
4040
("mid", "image/jpeg,width=1280,height=720,framerate=10/1"),
4141
("high", "image/jpeg,width=1920,height=1080,framerate=10/1"),
4242
])
43+
if match == (0x1d6c, 0x0103): # HD 2MP WEBCAM
44+
return ("mid", [
45+
("low", "video/x-h264,width=640,height=480,framerate=25/1"),
46+
("mid", "video/x-h264,width=1280,height=720,framerate=25/1"),
47+
("high", "video/x-h264,width=1920,height=1080,framerate=25/1"),
48+
])
4349
raise InvalidConfigError("Unknown USB video device {:04x}:{:04x}".format(*match))
4450

4551
def select_caps(self, hint=None):
@@ -65,6 +71,9 @@ def get_pipeline(self, path, caps, controls=None):
6571
inner = None
6672
elif match == (0x534d, 0x2109):
6773
inner = None # just forward the jpeg frames
74+
elif match == (0x1d6c, 0x0103):
75+
controls = controls or "focus_auto=1"
76+
inner = "h264parse"
6877
else:
6978
raise InvalidConfigError("Unknown USB video device {:04x}:{:04x}".format(*match))
7079

0 commit comments

Comments
 (0)