V4L2 subdevice controls

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

V4L2 subdevice controls

simo-zz
Hello,

I am using a camera device and it's driver supports the following V4L2 subdevice controls:
  • 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


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.

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 ?

Thank you in advance.
Regards,
Simon

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: V4L2 subdevice controls

Nicolas Dufresne-5
Le jeudi 12 avril 2018 à 10:57 +0000, [hidden email] 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
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment