From: Tim-Philipp Müller Date: Sat, 25 Feb 2012 15:21:30 +0000 (+0000) Subject: appsink: implement SEEKING query X-Git-Tag: 1.19.3~511^2~6555^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fd82178980c982dfd747feb2fa36e646ae854b7;p=platform%2Fupstream%2Fgstreamer.git appsink: implement SEEKING query We don't support seeking (in the sense that upstream can make us jump back and forth to certain offsets in the output). --- diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 9a891b6c..871d6f0 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -158,6 +158,7 @@ static gboolean gst_app_sink_unlock_stop (GstBaseSink * bsink); static gboolean gst_app_sink_start (GstBaseSink * psink); static gboolean gst_app_sink_stop (GstBaseSink * psink); static gboolean gst_app_sink_event (GstBaseSink * sink, GstEvent * event); +static gboolean gst_app_sink_query (GstBaseSink * bsink, GstQuery * query); static GstFlowReturn gst_app_sink_preroll (GstBaseSink * psink, GstBuffer * buffer); static GstFlowReturn gst_app_sink_render_common (GstBaseSink * psink, @@ -436,6 +437,7 @@ gst_app_sink_class_init (GstAppSinkClass * klass) basesink_class->render = gst_app_sink_render; basesink_class->render_list = gst_app_sink_render_list; basesink_class->get_caps = gst_app_sink_getcaps; + basesink_class->query = gst_app_sink_query; klass->pull_preroll = gst_app_sink_pull_preroll; klass->pull_buffer = gst_app_sink_pull_buffer; @@ -875,6 +877,30 @@ gst_app_sink_getcaps (GstBaseSink * psink) return caps; } +static gboolean +gst_app_sink_query (GstBaseSink * bsink, GstQuery * query) +{ + gboolean ret; + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + /* we don't supporting seeking */ + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + gst_query_set_seeking (query, fmt, FALSE, 0, -1); + ret = TRUE; + break; + } + + default: + ret = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query); + break; + } + + return ret; +} + static GstMiniObject * gst_app_sink_pull_object (GstAppSink * appsink) {