Hi,
> > The UVC driver returns the size of the currently set format. So if you do
> > a S_FMT with 640x480 first, CROPCAP should indeed return 640x480.
> >
> > The problem with CROPCAP is that for the most part it doesn't apply to
> > digital devices. For a while, the call wasn't supported at all but it
> > seems that it is mandatory, so we just tried to return _something_ that
> > makes sense. If you have any suggestions as to the interpretation of the
> > V4L2 spec, I'd be happy to hear your view.
>
> Currently i think very less information is given by uvcvideo driver.
> When i applied one by one ioctl's to get what my webcam can supports
> and what not in terms of frame formats, various width and heights.
Could you elaborate ? I don't understand what you mean.
> I found if i use v4l2_enumfrmfmt.h then i am getting various sizes.
> Is not it possible ti include this header file in uvcviodeo.c and let
> ioctl given in that header file give the various sizes supported by
> webcam hardware. So is it possible to make that VIDIOC_ENUM_FMT be
> included in uvcviudeo.c
You don't need to include v4l2_enumfrmfmt.h in uvcvideo.c. v4l2_enumfrmfmt.h
defines a few new ioctls. Those ioctls will be submitted for inclusion to the
V4L2 maintainer, so the v4l2_enumfrmfmt.h file is only needed until the
ioctls will be included in the standard. In other words, if you want to use
the new ioctls, just include the file v4l2_enumfrmfmt.h in your application
until those ioctls are added to linux/videodev2.h.
> OR / ALSO
> in my example when i see this output
> Device /dev/video0 opened: USB Video Class device.
>
> Enumerating frame formats:
>
> { pixelformat = 'MJPG', description = 'MJPEG' }
> { discrete: width = 160, height = 120 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 176, height = 144 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 320, height = 240 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 352, height = 288 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 432, height = 240 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 480, height = 360 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 512, height = 288 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 640, height = 360 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 640, height = 480 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { pixelformat = 'YUYV', description = 'Uncompressed' }
> { discrete: width = 640, height = 360 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
> { discrete: width = 640, height = 480 }
> { discrete: 1/30 }
> { discrete: 1/25 }
> { discrete: 1/20 }
> { discrete: 1/15 }
> { discrete: 1/10 }
> { discrete: 1/5 }
>
> It clearly showed that as MJPG is default frame thru ioclt,s i am
> getting therefore i am getting the first value in above output as
> width=160 and height=120.
> But same output showed max width=640 and height=480. So can it be
> possible to modify ioctl code to return either max values for default
> frame when applied VIDIOC_CROPCAP ??
I understand what you mean. VIDIOC_CROPCAP should be changed to return the
sensor size. But that leaves a question: how do we find out the sensor size ?
It might not be the maximum resolution, as the camera could upscale the
image. The biggest width/height could also not be available at the same time.
Imagine a webcam with a 1024x768 sensor which could do 1024x512 and 800x756
only ? (I know it sounds weird, but manufacturers sometimes come up with
weirder things).
> Or can it be possible in uvcvideo to have max and min width and height
> structure members and let them return max and min values. I know it
> was case for V4l but not for V4l2.
>
> All above are my thought for uvcvideo. This all i am thinking for if
> anyone want to write a video viewer app then how come he will get that
> info to show streaming video in various supported sizes( Me is also
> trying to write video viewer but first to understand all v4l2 API
> well)
You should use the frame rate enumeration ioctls if you need information
regarding all the supported formats and sizes. The UVC driver is currently
the only driver supporting those ioctls, but other drivers will hopefully be
migrated soon when the ioctls will be submitted for inclusion in the v4l2
spec.
Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel