summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2008-08-24 19:46:46 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2008-08-24 19:46:46 +0000
commit187b55417a4ba1e882de424cbe5b34d287d62420 (patch)
tree38d670eae58f8a6bb22f029f3613f0711ce0e7c3
parent5c30426fdd12585a4a8f121761c5560851faee78 (diff)
Get VIDIOC_G_FMT working (makes ekiga happy).
-rw-r--r--sys/dev/usb/uvideo.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index d181b00cfa5..0c6d8a402fe 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.84 2008/08/24 11:43:00 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.85 2008/08/24 19:46:45 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -2446,9 +2446,19 @@ uvideo_s_fmt(void *v, struct v4l2_format *fmt)
int
uvideo_g_fmt(void *v, struct v4l2_format *fmt)
{
+ struct uvideo_softc *sc = v;
+
if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return (EINVAL);
+ fmt->fmt.pix.pixelformat = sc->sc_fmtgrp_cur->pixelformat;
+ fmt->fmt.pix.width = UGETW(sc->sc_fmtgrp_cur->frame_cur->wWidth);
+ fmt->fmt.pix.height = UGETW(sc->sc_fmtgrp_cur->frame_cur->wHeight);
+ fmt->fmt.pix.sizeimage = UGETDW(sc->sc_desc_probe.dwMaxVideoFrameSize);
+
+ DPRINTF(1, "%s: %s: current width=%d, height=%d\n",
+ DEVNAME(sc), __func__, fmt->fmt.pix.width, fmt->fmt.pix.height);
+
return (0);
}