Commit 9dd0e6cc authored by Edward Hervey's avatar Edward Hervey Committed by Edward Hervey
Browse files

ext/gst: Ensure default query/event handlers are used

And in some cases, just remove our implementation that does nothing
parent e2597e1e
......@@ -81,8 +81,6 @@ static gboolean gst_audio_visualizer_sink_event (GstPad * pad,
static gboolean gst_audio_visualizer_src_query (GstPad * pad,
GstObject * parent, GstQuery * query);
static gboolean gst_audio_visualizer_sink_query (GstPad * pad,
GstObject * parent, GstQuery * query);
static GstStateChangeReturn gst_audio_visualizer_change_state (GstElement *
element, GstStateChange transition);
......@@ -584,8 +582,6 @@ gst_audio_visualizer_init (GstAudioVisualizer * scope,
GST_DEBUG_FUNCPTR (gst_audio_visualizer_chain));
gst_pad_set_event_function (scope->sinkpad,
GST_DEBUG_FUNCPTR (gst_audio_visualizer_sink_event));
gst_pad_set_query_function (scope->sinkpad,
GST_DEBUG_FUNCPTR (gst_audio_visualizer_sink_query));
gst_element_add_pad (GST_ELEMENT (scope), scope->sinkpad);
pad_template =
......@@ -1241,7 +1237,7 @@ gst_audio_visualizer_src_event (GstPad * pad, GstObject * parent,
res = TRUE;
break;
default:
res = gst_pad_push_event (scope->sinkpad, event);
res = gst_pad_event_default (pad, parent, event);
break;
}
......@@ -1266,9 +1262,6 @@ gst_audio_visualizer_sink_event (GstPad * pad, GstObject * parent,
res = gst_audio_visualizer_sink_setcaps (scope, caps);
break;
}
case GST_EVENT_FLUSH_START:
res = gst_pad_push_event (scope->srcpad, event);
break;
case GST_EVENT_FLUSH_STOP:
gst_audio_visualizer_reset (scope);
res = gst_pad_push_event (scope->srcpad, event);
......@@ -1284,7 +1277,7 @@ gst_audio_visualizer_sink_event (GstPad * pad, GstObject * parent,
break;
}
default:
res = gst_pad_push_event (scope->srcpad, event);
res = gst_pad_event_default (pad, parent, event);
break;
}
......@@ -1350,20 +1343,6 @@ gst_audio_visualizer_src_query (GstPad * pad, GstObject * parent,
return res;
}
static gboolean
gst_audio_visualizer_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query)
{
gboolean res = FALSE;
switch (GST_QUERY_TYPE (query)) {
default:
res = gst_pad_query_default (pad, parent, query);
break;
}
return res;
}
static GstStateChangeReturn
gst_audio_visualizer_change_state (GstElement * element,
GstStateChange transition)
......
......@@ -988,7 +988,7 @@ gst_base_text_overlay_src_query (GstPad * pad, GstObject * parent,
break;
}
default:
ret = gst_pad_peer_query (overlay->video_sinkpad, query);
ret = gst_pad_query_default (pad, parent, query);
break;
}
......
......@@ -375,30 +375,6 @@ beach:
return res;
}
static gboolean
gst_stream_splitter_src_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
GstStreamSplitter *stream_splitter = (GstStreamSplitter *) parent;
GST_DEBUG_OBJECT (pad, "%s", GST_EVENT_TYPE_NAME (event));
/* Forward upstream as is */
return gst_pad_push_event (stream_splitter->sinkpad, event);
}
static gboolean
gst_stream_splitter_src_query (GstPad * pad, GstObject * parent,
GstQuery * query)
{
GstStreamSplitter *stream_splitter = (GstStreamSplitter *) parent;
GST_DEBUG_OBJECT (pad, "%s", GST_QUERY_TYPE_NAME (query));
/* Forward upstream as is */
return gst_pad_peer_query (stream_splitter->sinkpad, query);
}
static void
gst_stream_splitter_init (GstStreamSplitter * stream_splitter)
{
......@@ -423,8 +399,6 @@ gst_stream_splitter_request_new_pad (GstElement * element,
GstPad *srcpad;
srcpad = gst_pad_new_from_static_template (&src_template, name);
gst_pad_set_event_function (srcpad, gst_stream_splitter_src_event);
gst_pad_set_query_function (srcpad, gst_stream_splitter_src_query);
STREAMS_LOCK (stream_splitter);
stream_splitter->srcpads = g_list_append (stream_splitter->srcpads, srcpad);
......
......@@ -136,25 +136,6 @@ gst_stream_synchronizer_iterate_internal_links (GstPad * pad,
return it;
}
static gboolean
gst_stream_synchronizer_query (GstPad * pad, GstObject * parent,
GstQuery * query)
{
GstPad *opad;
gboolean ret = FALSE;
GST_LOG_OBJECT (pad, "Handling query %s", GST_QUERY_TYPE_NAME (query));
opad =
gst_stream_get_other_pad_from_pad (GST_STREAM_SYNCHRONIZER (parent), pad);
if (opad) {
ret = gst_pad_peer_query (opad, query);
gst_object_unref (opad);
}
return ret;
}
/* srcpad functions */
static gboolean
gst_stream_synchronizer_src_event (GstPad * pad, GstObject * parent,
......@@ -699,8 +680,6 @@ gst_stream_synchronizer_request_new_pad (GstElement * element,
gst_pad_set_element_private (stream->sinkpad, stream);
gst_pad_set_iterate_internal_links_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_iterate_internal_links));
gst_pad_set_query_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_query));
gst_pad_set_event_function (stream->sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_sink_event));
gst_pad_set_chain_function (stream->sinkpad,
......@@ -712,8 +691,6 @@ gst_stream_synchronizer_request_new_pad (GstElement * element,
gst_pad_set_element_private (stream->srcpad, stream);
gst_pad_set_iterate_internal_links_function (stream->srcpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_iterate_internal_links));
gst_pad_set_query_function (stream->srcpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_query));
gst_pad_set_event_function (stream->srcpad,
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_src_event));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment