From: Wim Taymans Date: Thu, 25 Mar 2010 17:13:02 +0000 (+0100) Subject: queue2: add element query function X-Git-Tag: RELEASE-0.10.29~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b1beba01dd378247093d87834623e66028a355d;p=platform%2Fupstream%2Fgstreamer.git queue2: add element query function Add an element query function that is a little more efficient than the generic default query handler. --- diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index adc435a..e1c1130 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -225,6 +225,8 @@ static gboolean gst_queue2_handle_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_queue2_handle_src_event (GstPad * pad, GstEvent * event); static gboolean gst_queue2_handle_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_queue2_handle_query (GstElement * element, + GstQuery * query); static GstCaps *gst_queue2_getcaps (GstPad * pad); static gboolean gst_queue2_acceptcaps (GstPad * pad, GstCaps * caps); @@ -347,6 +349,7 @@ gst_queue2_class_init (GstQueue2Class * klass) gobject_class->finalize = gst_queue2_finalize; gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_queue2_change_state); + gstelement_class->query = GST_DEBUG_FUNCPTR (gst_queue2_handle_query); } static void @@ -2063,6 +2066,13 @@ peer_failed: } } +static gboolean +gst_queue2_handle_query (GstElement * element, GstQuery * query) +{ + /* simply forward to the srcpad query function */ + return gst_queue2_handle_src_query (GST_QUEUE2_CAST (element)->srcpad, query); +} + static GstFlowReturn gst_queue2_get_range (GstPad * pad, guint64 offset, guint length, GstBuffer ** buffer)