[Bug 698837] v4l2: cache CIDs until the device is opened

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed May 29 02:44:08 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=698837
  GStreamer | gst-plugins-good | git

--- Comment #12 from Michael Olbrich <m.olbrich at pengutronix.de> 2013-05-29 09:44:06 UTC ---
(From update of attachment 245536)
>diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
>index b46b7e9..ec40c31 100644
>--- a/sys/v4l2/gstv4l2object.c
>+++ b/sys/v4l2/gstv4l2object.c
>@@ -490,6 +490,20 @@ gst_v4l2_object_install_properties_helper (GObjectClass * gobject_class,
>           "I/O mode",
>           GST_TYPE_V4L2_IO_MODE, DEFAULT_PROP_IO_MODE,
>           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
>+
>+  /**
>+   * GstV4l2Src:extra-controls
>+   *
>+   * Additional v4l2 controls for the device. The controls are identified
>+   * by the control name (lowercase with '_' for any non-alphanumeric
>+   * characters).
>+   *
>+   * Since: 1.1

Is this correct? I wasn't sure what version to put there.

>+   */
>+  g_object_class_install_property (gobject_class, PROP_EXTRA_CONTROLS,
>+      g_param_spec_boxed ("extra-controls", "Extra Controls",
>+          "Extra v4l2 controls (CIDs) for the device",
>+          GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
> }
> 
> GstV4l2Object *
[...]
>diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
>index 6946e1b..61f442e 100644
>--- a/sys/v4l2/v4l2_calls.c
>+++ b/sys/v4l2/v4l2_calls.c
>@@ -269,6 +269,32 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
>       GST_DEBUG_OBJECT (e, "skipping disabled control");
>       continue;
>     }
>+    switch (control.type) {
>+      case V4L2_CTRL_TYPE_INTEGER:
>+      case V4L2_CTRL_TYPE_BOOLEAN:
>+      case V4L2_CTRL_TYPE_MENU:
>+      case V4L2_CTRL_TYPE_INTEGER_MENU:
>+      case V4L2_CTRL_TYPE_BITMASK:
>+      case V4L2_CTRL_TYPE_BUTTON:{
>+        int i;
>+        control.name[31] = '\0';
>+        for (i = 0; control.name[i]; ++i) {
>+          control.name[i] = g_ascii_tolower (control.name[i]);
>+          if (!g_ascii_isalnum (control.name[i]))
>+            control.name[i] = '_';
>+        }
>+        GST_INFO_OBJECT (e, "adding generic controls '%s'", control.name);
>+        g_datalist_id_set_data (&v4l2object->controls,
>+            g_quark_from_string ((const gchar *) control.name),
>+            GINT_TO_POINTER (n));

I think GST_INFO_OBJECT is a good idea here, to make it easier to figure out
what controls are actually available.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list