diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-02-25 15:21:30 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-02-25 15:21:30 +0000 |
commit | 3fd82178980c982dfd747feb2fa36e646ae854b7 (patch) | |
tree | 7ab3bfc695bf65c7921a0cee50585b060457eb99 | |
parent | 0cb4ccb1f09d39820682e052fc106f5fd7fa1309 (diff) |
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).
-rw-r--r-- | gst-libs/gst/app/gstappsink.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 9a891b6c9..871d6f0ae 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) { |