mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
goom: add a sink_query to eat allocation queries
We should not forward allocation queries for audio to the video sink.
This commit is contained in:
parent
de020130e6
commit
3e82471125
1 changed files with 26 additions and 0 deletions
|
@ -99,6 +99,7 @@ static gboolean gst_goom_src_event (GstPad * pad, GstEvent * event);
|
|||
static gboolean gst_goom_sink_event (GstPad * pad, GstEvent * event);
|
||||
|
||||
static gboolean gst_goom_src_query (GstPad * pad, GstQuery * query);
|
||||
static gboolean gst_goom_sink_query (GstPad * pad, GstQuery * query);
|
||||
|
||||
#define gst_goom_parent_class parent_class
|
||||
G_DEFINE_TYPE (GstGoom, gst_goom, GST_TYPE_ELEMENT);
|
||||
|
@ -135,6 +136,8 @@ gst_goom_init (GstGoom * goom)
|
|||
GST_DEBUG_FUNCPTR (gst_goom_chain));
|
||||
gst_pad_set_event_function (goom->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_goom_sink_event));
|
||||
gst_pad_set_query_function (goom->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_goom_sink_query));
|
||||
gst_element_add_pad (GST_ELEMENT (goom), goom->sinkpad);
|
||||
|
||||
goom->srcpad = gst_pad_new_from_static_template (&src_template, "src");
|
||||
|
@ -461,6 +464,29 @@ gst_goom_src_query (GstPad * pad, GstQuery * query)
|
|||
return res;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_goom_sink_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
GstGoom *goom;
|
||||
|
||||
goom = GST_GOOM (gst_pad_get_parent (pad));
|
||||
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_ALLOCATION:
|
||||
/* we convert audio to video, don't pass allocation queries for audio
|
||||
* through */
|
||||
break;
|
||||
default:
|
||||
res = gst_pad_peer_query (goom->srcpad, query);
|
||||
break;
|
||||
}
|
||||
|
||||
gst_object_unref (goom);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* make sure we are negotiated */
|
||||
static GstFlowReturn
|
||||
ensure_negotiated (GstGoom * goom)
|
||||
|
|
Loading…
Reference in a new issue