mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
[904/906] mixer: ask for display handles on pad activation
This commit is contained in:
parent
6527008c2a
commit
f0b10d4edf
1 changed files with 38 additions and 0 deletions
|
@ -532,6 +532,8 @@ static void gst_gl_mixer_finalize (GObject * object);
|
||||||
|
|
||||||
static gboolean gst_gl_mixer_src_query (GstPad * pad, GstObject * object,
|
static gboolean gst_gl_mixer_src_query (GstPad * pad, GstObject * object,
|
||||||
GstQuery * query);
|
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,
|
static GstFlowReturn gst_gl_mixer_sink_clip (GstCollectPads * pads,
|
||||||
GstCollectData * data, GstBuffer * buf, GstBuffer ** outbuf,
|
GstCollectData * data, GstBuffer * buf, GstBuffer ** outbuf,
|
||||||
GstGLMixer * mix);
|
GstGLMixer * mix);
|
||||||
|
@ -703,6 +705,8 @@ gst_gl_mixer_init (GstGLMixer * mix)
|
||||||
GST_DEBUG_FUNCPTR (gst_gl_mixer_src_query));
|
GST_DEBUG_FUNCPTR (gst_gl_mixer_src_query));
|
||||||
gst_pad_set_event_function (GST_PAD (mix->srcpad),
|
gst_pad_set_event_function (GST_PAD (mix->srcpad),
|
||||||
GST_DEBUG_FUNCPTR (gst_gl_mixer_src_event));
|
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);
|
gst_element_add_pad (GST_ELEMENT (mix), mix->srcpad);
|
||||||
|
|
||||||
mix->collect = gst_collect_pads_new ();
|
mix->collect = gst_collect_pads_new ();
|
||||||
|
@ -980,6 +984,40 @@ gst_gl_mixer_set_context (GstElement * element, GstContext * context)
|
||||||
gst_gl_handle_set_context (element, context, &mix->display);
|
gst_gl_handle_set_context (element, context, &mix->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static gboolean
|
||||||
gst_gl_mixer_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
gst_gl_mixer_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue