GNOME Bugzilla – Bug 354908
videoflipping interface for v4l2src
Last modified: 2006-09-18 15:56:35 UTC
Some cameras export these two controls #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) Along with that some provice a sensor (e.g. as a HID device) to give info about flipping status. The v4l2src needs to implement an interface that exports one or both controls, to allow apps to flip the video (flipping is done in the camera hardware or the driver). The proposal is to add such to gst-plugins-base/gst-libs/gst/interfaces/ as videoflipping.{c,h} -> GST_TYPE_VIDEO_FLIPPING Apart, would it make sense that gst-plugins-good/gst/videofilter/gstvideoflip.{c,h} implements this iface? Finally there is also #define V4L2_CID_HCENTER (V4L2_CID_BASE+22) #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) If we'd call the iface e.g. videolayout we can support all of them in one iface. The iface migh need a mechanism anyway to report which properties are really work on the device. http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec/x474.htm
Hi Stefan, There are other controls: V4L2_CID_AUDIO_VOLUME V4L2_CID_AUDIO_BALANCE V4L2_CID_AUDIO_BASS V4L2_CID_AUDIO_TREBLE V4L2_CID_AUDIO_MUTE V4L2_CID_AUDIO_LOUDNESS those I think we could handle with GstMixerInterface, right? for: V4L2_CID_HFLIP V4L2_CID_VFLIP V4L2_CID_HCENTER V4L2_CID_VCENTER We could handle using the interface you proposed, but I rather like to use something more generic. I'll explain bellow: I have seen v4l2 devices having the following PRIVATE controls: Auto Luminace Control [false-true], Horizontal Edge Enhancement [0-255], Vertical Edge Enhancement [0-255], Lens Shading Compensation [0-63], Maximum Exposure Time [0-3] In addition to that, controls can be V4L2_CTRL_TYPE_INTEGER - a range of values; V4L2_CTRL_TYPE_BOOLEAN - true or false; V4L2_CTRL_TYPE_BUTTON - You just set it to perform an action (doesn't make sence to query its value); V4L2_CTRL_TYPE_MENU - A enumeration of values. I really like how v4l2 enumerates its controls. So my proposal would be to create a interface called GstControl and GstControlItem (like GstColorBalance and GstColorBalanceChannel) having id, type(int, bool, button, enum), name, min, max, step, default_val, category (see bellow) And GstControlMenuItem having id, index, name. About category: GstControlItem category could be one of "ColorBalance", "Audio", "VideoLayout" and "Others". ...I don't know...it would make GstColorBalance obsolete. What about GstMixerInterface ? - - - - - - - - - - - - - - - - - - - Humm....I don't know, may be your approach is better. We could have a GstVideoLayout interface and also a GstControl interface (just like I explained above. This way, we could have GstColorbalance for known V4L2_CID_ (like V4L2_CID_CONTRAST), GstMixer for known V4L2_CID_AUDIO_ (like BASS), GstVideoFlip/Layout for (HCENTER, VCENTER, HFLIP, VFLIP) and GstControl for PRIVATE ones. It would be good to ask to Thomas and Wingo too. What do you think?
Edgard, thanks for commenting. I am still more in favour of GstLayout or GstGeometry (name can be discussed). An interface is inherrently specific for a task. E.g. the 'media control' interface on cd-players, tapes and videorecorders has play, stop, pause, rewind and skip buttons. If you know the interface ou can operate these function on the device. In the gstreamer case an application could connect such an interface that to an appropriate UI.
Ok, ...and what in case of PRIVATE controls? (we don't know what they are...just the name, min, and max,....) for example, I would like to create an app using gstreamer. Thia app should show GUI to manipulate available controls. what for -> "I have seen v4l2 devices having the following PRIVATE controls: Auto Luminace Control [false-true], Horizontal Edge Enhancement [0-255], Vertical Edge Enhancement [0-255], Lens Shading Compensation [0-63], Maximum Exposure Time [0-3]" ...so it would be good to have a mechanism, something like GstControls (or whatever) I proposed above to dynamically enumerate PRIVATE controls. BR
Maybe we need a specific iface that handles the private controls, as here we can rarely forsee all the cases. But thats another issues. First thing is to get the flipping stuff done.