summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <ystreet00@gmail.com>2014-03-15 13:55:39 +0100
committerMatthew Waters <ystreet00@gmail.com>2014-03-15 13:55:39 +0100
commit5e835c272374b8f176c9a082e75d97d881528467 (patch)
tree9389d9abac7854058ac32854169f37154b7c3e94
parent9aefcd68666f235cfe77cf96a2bf7d67b17f9ad1 (diff)
mixer: ask for display handles on pad activation
-rw-r--r--gst-libs/gst/gl/gstglmixer.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c
index 4f92ddc..fe08208 100644
--- a/gst-libs/gst/gl/gstglmixer.c
+++ b/gst-libs/gst/gl/gstglmixer.c
@@ -532,6 +532,8 @@ static void gst_gl_mixer_finalize (GObject * object);
static gboolean gst_gl_mixer_src_query (GstPad * pad, GstObject * object,
GstQuery * query);
+static gboolean gst_gl_mixer_src_activate_mode (GstPad * pad,
+ GstObject * parent, GstPadMode mode, gboolean active);
static GstFlowReturn gst_gl_mixer_sink_clip (GstCollectPads * pads,
GstCollectData * data, GstBuffer * buf, GstBuffer ** outbuf,
GstGLMixer * mix);
@@ -703,6 +705,8 @@ gst_gl_mixer_init (GstGLMixer * mix)
GST_DEBUG_FUNCPTR (gst_gl_mixer_src_query));
gst_pad_set_event_function (GST_PAD (mix->srcpad),
GST_DEBUG_FUNCPTR (gst_gl_mixer_src_event));
+ gst_pad_set_activatemode_function (mix->srcpad,
+ GST_DEBUG_FUNCPTR (gst_gl_mixer_src_activate_mode));
gst_element_add_pad (GST_ELEMENT (mix), mix->srcpad);
mix->collect = gst_collect_pads_new ();
@@ -981,6 +985,40 @@ gst_gl_mixer_set_context (GstElement * element, GstContext * context)
}
static gboolean
+gst_gl_mixer_activate (GstGLMixer * mix, gboolean active)
+{
+ gboolean result = TRUE;
+
+ if (active) {
+ if (!gst_gl_ensure_display (mix, &mix->display))
+ result = FALSE;
+ }
+
+ return result;
+}
+
+static gboolean
+gst_gl_mixer_src_activate_mode (GstPad * pad, GstObject * parent,
+ GstPadMode mode, gboolean active)
+{
+ gboolean result = FALSE;
+ GstGLMixer *mix;
+
+ mix = GST_GL_MIXER (parent);
+
+ switch (mode) {
+ case GST_PAD_MODE_PUSH:
+ case GST_PAD_MODE_PULL:
+ result = gst_gl_mixer_activate (mix, active);
+ break;
+ default:
+ result = TRUE;
+ break;
+ }
+ return result;
+}
+
+static gboolean
gst_gl_mixer_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
{
GstGLMixer *mix = GST_GL_MIXER (parent);