* v4l2 api: supported resolution negotiation
@ 2015-10-04 9:23 Matwey V. Kornilov
2015-10-04 18:49 ` Sakari Ailus
0 siblings, 1 reply; 4+ messages in thread
From: Matwey V. Kornilov @ 2015-10-04 9:23 UTC (permalink / raw)
To: linux-media
Hello,
I learned from V2L2 API how to detect all supported formats using
VIDIOC_ENUM_FMT.
When I perform VIDIOC_S_FMT I don't know how to fill fmt.pix.width and
fmt.pix.height, since I know only format.
How should I negotiate device resolution? Could you point me?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: v4l2 api: supported resolution negotiation
2015-10-04 9:23 v4l2 api: supported resolution negotiation Matwey V. Kornilov
@ 2015-10-04 18:49 ` Sakari Ailus
2015-10-04 23:15 ` Nicolas Dufresne
2015-10-12 10:24 ` Hans Verkuil
0 siblings, 2 replies; 4+ messages in thread
From: Sakari Ailus @ 2015-10-04 18:49 UTC (permalink / raw)
To: Matwey V. Kornilov; +Cc: linux-media
On Sun, Oct 04, 2015 at 12:23:08PM +0300, Matwey V. Kornilov wrote:
> Hello,
>
> I learned from V2L2 API how to detect all supported formats using
> VIDIOC_ENUM_FMT.
> When I perform VIDIOC_S_FMT I don't know how to fill fmt.pix.width and
> fmt.pix.height, since I know only format.
> How should I negotiate device resolution? Could you point me?
VIDIOC_ENUM_FRAMESIZES may give you hints, but it's optional. You can use
values you prefer to try if drivers support them; I think the GStreamer
v4lsrc tries very small and very large values. The driver will clamp them to
a supported values which are passed to the application from the IOCTL.
<URL:http://hverkuil.home.xs4all.nl/spec/media.html#vidioc-enum-framesizes>
--
Regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: v4l2 api: supported resolution negotiation
2015-10-04 18:49 ` Sakari Ailus
@ 2015-10-04 23:15 ` Nicolas Dufresne
2015-10-12 10:24 ` Hans Verkuil
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Dufresne @ 2015-10-04 23:15 UTC (permalink / raw)
To: Sakari Ailus, Matwey V. Kornilov; +Cc: linux-media
[-- Attachment #1: Type: text/plain, Size: 558 bytes --]
Le dimanche 04 octobre 2015 à 21:49 +0300, Sakari Ailus a écrit :
> I think the GStreamer
> v4lsrc tries very small and very large values. The driver will clamp
> them to
> a supported values which are passed to the application from the
> IOCTL.
In GStreamer we try ENUM_FRAMESIZE, and when no supported, we fallback
to try_fmt() with 1x1 (driver will raise it to the minimum) and then
MAX,MAX (driver will lower it to the maximum). We assume that the
driver supports a range, as iterating over all possibilities takes too
much time.
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: v4l2 api: supported resolution negotiation
2015-10-04 18:49 ` Sakari Ailus
2015-10-04 23:15 ` Nicolas Dufresne
@ 2015-10-12 10:24 ` Hans Verkuil
1 sibling, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2015-10-12 10:24 UTC (permalink / raw)
To: Sakari Ailus, Matwey V. Kornilov; +Cc: linux-media
On 10/04/2015 08:49 PM, Sakari Ailus wrote:
> On Sun, Oct 04, 2015 at 12:23:08PM +0300, Matwey V. Kornilov wrote:
>> Hello,
>>
>> I learned from V2L2 API how to detect all supported formats using
>> VIDIOC_ENUM_FMT.
>> When I perform VIDIOC_S_FMT I don't know how to fill fmt.pix.width and
>> fmt.pix.height, since I know only format.
>> How should I negotiate device resolution? Could you point me?
>
> VIDIOC_ENUM_FRAMESIZES may give you hints, but it's optional. You can use
> values you prefer to try if drivers support them; I think the GStreamer
> v4lsrc tries very small and very large values. The driver will clamp them to
> a supported values which are passed to the application from the IOCTL.
>
> <URL:http://hverkuil.home.xs4all.nl/spec/media.html#vidioc-enum-framesizes>
>
You can also call G_FMT first, then change the pixelformat and call S_FMT.
This will only change the pixelformat and leave the resolution the same (unless
the driver has some restrictions for the new pixelformat, but that's unlikely).
Regards,
Hans
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-12 10:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-04 9:23 v4l2 api: supported resolution negotiation Matwey V. Kornilov
2015-10-04 18:49 ` Sakari Ailus
2015-10-04 23:15 ` Nicolas Dufresne
2015-10-12 10:24 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).