diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-08-07 11:14:17 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-08-07 11:14:17 +0000 |
commit | c8e115e4c4779b69c6e2622c0c5f34841d630671 (patch) | |
tree | 0256831a22ac48cced335ef6c8273757cb3f8a1f /sys/dev/usb | |
parent | 1be7007aa60e1993672d1e6d9a12f7cd0852e7e5 (diff) |
Add support for the KSMedia 8-bit IR format, a greyscale format,
as seen on the IR camera of my Lenovo X395.
ok jan@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uvideo.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/uvideo.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index c9b47aa986d..c90c563d569 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.201 2019/07/10 08:21:43 patrick Exp $ */ +/* $OpenBSD: uvideo.c,v 1.202 2019/08/07 11:14:16 patrick Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -998,6 +998,7 @@ uvideo_vs_parse_desc_format_uncompressed(struct uvideo_softc *sc, const usb_descriptor_t *desc) { struct usb_video_format_uncompressed_desc *d; + uint8_t guid_8bit_ir[16] = UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR; int i; d = (struct usb_video_format_uncompressed_desc *)(uint8_t *)desc; @@ -1030,6 +1031,9 @@ uvideo_vs_parse_desc_format_uncompressed(struct uvideo_softc *sc, sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_NV12; } else if (!strcmp(sc->sc_fmtgrp[i].format->u.uc.guidFormat, "UYVY")) { sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_UYVY; + } else if (!memcmp(sc->sc_fmtgrp[i].format->u.uc.guidFormat, + guid_8bit_ir, 16)) { + sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_GREY; } else { sc->sc_fmtgrp[i].pixelformat = 0; } diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h index fa4074015f2..25f0880a9bc 100644 --- a/sys/dev/usb/uvideo.h +++ b/sys/dev/usb/uvideo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.h,v 1.58 2019/07/09 09:33:55 patrick Exp $ */ +/* $OpenBSD: uvideo.h,v 1.59 2019/08/07 11:14:16 patrick Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -308,6 +308,10 @@ struct usb_video_probe_commit { 0x55, 0x59, 0x56, 0x59, 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +#define UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR { \ + 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + /* * USB Video Payload MJPEG */ |