mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
videomixer: Don't let GstCollectPad shadow custom sink pad query func
In the current implementation, the custom pad query function is not called. This patch, set that query function on the GstCollectPads to avoid this shadowing. See https://bugzilla.gnome.org/show_bug.cgi?id=684237
This commit is contained in:
parent
e3ba13632b
commit
76da367ecd
1 changed files with 10 additions and 16 deletions
|
@ -325,16 +325,13 @@ beach:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_videomixer2_pad_sink_getcaps (GstPad * pad, GstObject * parent,
|
gst_videomixer2_pad_sink_getcaps (GstPad * pad, GstVideoMixer2 * mix,
|
||||||
GstCaps * filter)
|
GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstVideoMixer2 *mix;
|
|
||||||
GstCaps *srccaps;
|
GstCaps *srccaps;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
gint i, n;
|
gint i, n;
|
||||||
|
|
||||||
mix = GST_VIDEO_MIXER2 (parent);
|
|
||||||
|
|
||||||
srccaps = gst_pad_get_current_caps (GST_PAD (mix->srcpad));
|
srccaps = gst_pad_get_current_caps (GST_PAD (mix->srcpad));
|
||||||
if (srccaps == NULL)
|
if (srccaps == NULL)
|
||||||
srccaps = gst_pad_get_pad_template_caps (GST_PAD (mix->srcpad));
|
srccaps = gst_pad_get_pad_template_caps (GST_PAD (mix->srcpad));
|
||||||
|
@ -358,16 +355,14 @@ gst_videomixer2_pad_sink_getcaps (GstPad * pad, GstObject * parent,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_videomixer2_pad_sink_acceptcaps (GstPad * pad, GstObject * parent,
|
gst_videomixer2_pad_sink_acceptcaps (GstPad * pad, GstVideoMixer2 * mix,
|
||||||
GstCaps * caps)
|
GstCaps * caps)
|
||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
GstVideoMixer2 *mix;
|
|
||||||
GstCaps *accepted_caps;
|
GstCaps *accepted_caps;
|
||||||
gint i, n;
|
gint i, n;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
|
|
||||||
mix = GST_VIDEO_MIXER2 (parent);
|
|
||||||
GST_DEBUG_OBJECT (pad, "%" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (pad, "%" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
accepted_caps = gst_pad_get_current_caps (GST_PAD (mix->srcpad));
|
accepted_caps = gst_pad_get_current_caps (GST_PAD (mix->srcpad));
|
||||||
|
@ -398,9 +393,10 @@ gst_videomixer2_pad_sink_acceptcaps (GstPad * pad, GstObject * parent,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_videomixer2_pad_sink_query (GstPad * pad, GstObject * parent,
|
gst_videomixer2_sink_query (GstCollectPads * pads, GstCollectData * cdata,
|
||||||
GstQuery * query)
|
GstQuery * query, GstVideoMixer2 * mix)
|
||||||
{
|
{
|
||||||
|
GstVideoMixer2Pad *pad = GST_VIDEO_MIXER2_PAD (cdata->pad);
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
switch (GST_QUERY_TYPE (query)) {
|
switch (GST_QUERY_TYPE (query)) {
|
||||||
|
@ -409,7 +405,7 @@ gst_videomixer2_pad_sink_query (GstPad * pad, GstObject * parent,
|
||||||
GstCaps *filter, *caps;
|
GstCaps *filter, *caps;
|
||||||
|
|
||||||
gst_query_parse_caps (query, &filter);
|
gst_query_parse_caps (query, &filter);
|
||||||
caps = gst_videomixer2_pad_sink_getcaps (pad, parent, filter);
|
caps = gst_videomixer2_pad_sink_getcaps (GST_PAD (pad), mix, filter);
|
||||||
gst_query_set_caps_result (query, caps);
|
gst_query_set_caps_result (query, caps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
@ -420,13 +416,13 @@ gst_videomixer2_pad_sink_query (GstPad * pad, GstObject * parent,
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
gst_query_parse_accept_caps (query, &caps);
|
gst_query_parse_accept_caps (query, &caps);
|
||||||
ret = gst_videomixer2_pad_sink_acceptcaps (pad, parent, caps);
|
ret = gst_videomixer2_pad_sink_acceptcaps (GST_PAD (pad), mix, caps);
|
||||||
gst_query_set_accept_caps_result (query, ret);
|
gst_query_set_accept_caps_result (query, ret);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ret = gst_pad_query_default (pad, parent, query);
|
ret = gst_pad_query_default (GST_PAD (pad), GST_OBJECT (mix), query);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -526,10 +522,6 @@ gst_videomixer2_pad_class_init (GstVideoMixer2PadClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_videomixer2_pad_init (GstVideoMixer2Pad * mixerpad)
|
gst_videomixer2_pad_init (GstVideoMixer2Pad * mixerpad)
|
||||||
{
|
{
|
||||||
/* setup some pad functions */
|
|
||||||
gst_pad_set_query_function (GST_PAD (mixerpad),
|
|
||||||
gst_videomixer2_pad_sink_query);
|
|
||||||
|
|
||||||
mixerpad->zorder = DEFAULT_PAD_ZORDER;
|
mixerpad->zorder = DEFAULT_PAD_ZORDER;
|
||||||
mixerpad->xpos = DEFAULT_PAD_XPOS;
|
mixerpad->xpos = DEFAULT_PAD_XPOS;
|
||||||
mixerpad->ypos = DEFAULT_PAD_YPOS;
|
mixerpad->ypos = DEFAULT_PAD_YPOS;
|
||||||
|
@ -2004,6 +1996,8 @@ gst_videomixer2_init (GstVideoMixer2 * mix)
|
||||||
mix);
|
mix);
|
||||||
gst_collect_pads_set_event_function (mix->collect,
|
gst_collect_pads_set_event_function (mix->collect,
|
||||||
(GstCollectPadsEventFunction) gst_videomixer2_sink_event, mix);
|
(GstCollectPadsEventFunction) gst_videomixer2_sink_event, mix);
|
||||||
|
gst_collect_pads_set_query_function (mix->collect,
|
||||||
|
(GstCollectPadsQueryFunction) gst_videomixer2_sink_query, mix);
|
||||||
gst_collect_pads_set_clip_function (mix->collect,
|
gst_collect_pads_set_clip_function (mix->collect,
|
||||||
(GstCollectPadsClipFunction) gst_videomixer2_sink_clip, mix);
|
(GstCollectPadsClipFunction) gst_videomixer2_sink_clip, mix);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue