On Sat, Oct 16, 2010 at 12:52:17PM +0200, Jan Stary wrote:

> but the sizes are still not recognized:
> 
> h...@mac:hans$ video -v
> video device /dev/video:
>   encodings: uyvy
>   sizes: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
> 0x0, 0x0, 0x0
>   controls: brightness, saturation, gamma, sharpness
> Xv adaptor 0, Intel(R) Textured Video:
>   encodings: yuy2, uyvy
>   max size: 1280x800
> using uyvy encoding
> using frame size 0x0 (0 bytes)
> video: /dev/video: returned size not as requested


> Is this a video(1) problem?
> Is it a uvideo(4) problem?
> Is it a uvideo-firmware problem?


> bLength=38
> bDescriptorType=0x24 (CS_INTERFACE)
> bDescriptorSubtype=0x05 (UDESCSUB_VS_FRAME_UNCOMPRESSED)
> bLength=38
> bDescriptorType=0x24
> bDescriptorSubtype=0x05
> bFrameIndex=0x01
> bmCapabilities=0x00
> wWidth=640
> wHeight=480
> dwMinBitRate=383976960
> dwMaxBitRate=383976960
> dwMaxVideoFrameBufferSize=614400
> dwDefaultFrameInterval=333333
> bFrameIntervalType=0x00
> 
> bLength=38
> bDescriptorType=0x24 (CS_INTERFACE)
> bDescriptorSubtype=0x05 (UDESCSUB_VS_FRAME_UNCOMPRESSED)
> bLength=38
> bDescriptorType=0x24
> bDescriptorSubtype=0x05
> bFrameIndex=0x02
> bmCapabilities=0x00
> wWidth=352
> wHeight=288
> dwMinBitRate=383976960
> dwMaxBitRate=383976960
> dwMaxVideoFrameBufferSize=202752
> dwDefaultFrameInterval=333333
> bFrameIntervalType=0x00
> 
> bLength=38
> bDescriptorType=0x24 (CS_INTERFACE)
> bDescriptorSubtype=0x05 (UDESCSUB_VS_FRAME_UNCOMPRESSED)
> bLength=38
> bDescriptorType=0x24
> bDescriptorSubtype=0x05
> bFrameIndex=0x03
> bmCapabilities=0x00
> wWidth=320
> wHeight=240
> dwMinBitRate=383976960
> dwMaxBitRate=383976960
> dwMaxVideoFrameBufferSize=153600
> dwDefaultFrameInterval=333333
> bFrameIntervalType=0x00


it's a bug in uvideo(4).  bFrameIntervalType affects frame rates, not frame
sizes.  patch below should fix it.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: uvideo.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uvideo.c,v
retrieving revision 1.142
diff -u -p uvideo.c
--- uvideo.c    9 Oct 2010 09:48:03 -0000       1.142
+++ uvideo.c    16 Oct 2010 19:40:33 -0000
@@ -2769,20 +2777,11 @@ uvideo_enum_fsizes(void *v, struct v4l2_frmsizeenum *f
                /* no more frames left */
                return (EINVAL);
 
-       if (sc->sc_fmtgrp[idx].frame[i]->bFrameIntervalType == 0) {
-               /* TODO */
-               fsizes->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
-               fsizes->un.stepwise.min_width = 0;
-               fsizes->un.stepwise.min_height = 0;
-               fsizes->un.stepwise.max_width = 0;
-               fsizes->un.stepwise.max_height = 0;
-       } else {
-               fsizes->type = V4L2_FRMSIZE_TYPE_DISCRETE;
-               fsizes->un.discrete.width =
-                   UGETW(sc->sc_fmtgrp[idx].frame[i]->wWidth);
-               fsizes->un.discrete.height =
-                   UGETW(sc->sc_fmtgrp[idx].frame[i]->wHeight);
-       }
+       fsizes->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+       fsizes->un.discrete.width =
+           UGETW(sc->sc_fmtgrp[idx].frame[i]->wWidth);
+       fsizes->un.discrete.height =
+           UGETW(sc->sc_fmtgrp[idx].frame[i]->wHeight);
 
        return (0);
 }

Reply via email to