V4L2 subdevice controls

Nicolas Dufresne nicolas at ndufresne.ca
Thu Apr 12 14:42:51 UTC 2018


Le jeudi 12 avril 2018 à 10:57 +0000, simon.zz at yahoo.com a écrit :
> Hello,
> 
> I am using a camera device and it's driver supports the following
> V4L2 subdevice controls:

Note that GStreamer only opens the entry point exposed as /dev/videoN.
If the control is not forwarded from the sub device to that entry
point, it won't be usable from GStreamer. You'll have to do you own
calls.

> V4L2_CID_SATURATION
> V4L2_CID_AUTO_WHITE_BALANCE
> V4L2_CID_AUTOGAIN
> V4L2_CID_EXPOSURE_AUTO
> V4L2_CID_TEST_PATTERN
> V4L2_CID_HFLIP
> V4L2_CID_VFLIP
> From the docs
> 
> https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins
> -good/html/gst-plugins-good-plugins-v4l2src.html
> 
> seems, as default, I can set 'saturation' parameters which match the
> control listed above, but how can I set, for example, autogain, white
> balance etc ? These are not listed in the v4lsrc properties, but I
> suppose it's possible to set them.

Some of this is exposed through the VideoBalance interface, some is
only usable through the extra-controls property, with the syntax like:

  extra-controls="s,autogain=1"

This is very limited support, write only.

> 
> How can I set these controls using gststreamer and what is/are the
> proper GstElement/s and C syntax to set them ?
> May you have a simple example to achieve this ?

In C, this property requires a GstStructure, refer to the documentation
on how to use that, it's relatively simple. If you want to do more,
support more type of controls, and detect control changes, you can read
the device file descriptor with "device-fd" and do you own v4l2 ioctl.

> 
> Thank you in advance.
> Regards,
> Simon
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180412/9fe834ff/attachment.sig>


More information about the gstreamer-devel mailing list