glvideomixer: swap control binding proxy
authorMatthew Waters <matthew@centricular.com>
Mon, 3 Aug 2015 09:48:16 +0000 (19:48 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:07 +0000 (19:32 +0000)
The ref_object and object parameters were the wrong way around.

For the typical use case where an application is setting a
GstControlBinding on the returned ghost pad:
1. our control binding would be removed when the new one was set
2. sync_values calls were not being forwarded from the internal
   pad to the ghost pad.

If an application attempts to perform other control binding
operations (get_* family of functions) on the internal pad, they
will also be forwarded to the ghost pad where a possible
GstControlBinding will provide the necessary values.

ext/gl/gstglvideomixer.c

index 25897d8..d17a744 100644 (file)
@@ -327,10 +327,10 @@ _create_video_mixer_input (GstGLMixerBin * self, GstPad * mixer_pad)
     gst_object_unref (input);
     return NULL;
   }
-#define ADD_PROXY_CONTROL_BINDING(prop)                                 \
-  cb = gst_gl_mixer_control_binding_proxy_new (GST_OBJECT (input),      \
-      G_STRINGIFY (prop), GST_OBJECT (mixer_pad), G_STRINGIFY (prop));  \
-  gst_object_add_control_binding (GST_OBJECT (input), cb)
+#define ADD_PROXY_CONTROL_BINDING(prop)                                \
+  cb = gst_gl_mixer_control_binding_proxy_new (GST_OBJECT (mixer_pad), \
+      G_STRINGIFY (prop), GST_OBJECT (input), G_STRINGIFY (prop));     \
+  gst_object_add_control_binding (GST_OBJECT (mixer_pad), cb)
 
   ADD_PROXY_CONTROL_BINDING (zorder);
   ADD_PROXY_CONTROL_BINDING (xpos);