From d0bd5f04c0f9dec74194862cfa3b44c1dfaf750c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Nov 2011 17:58:58 +0100 Subject: [PATCH] update for new scheduling query --- ext/gio/gstgiosrc.c | 12 ++++++++---- ext/ogg/gstoggdemux.c | 2 +- gst-libs/gst/app/gstappsrc.c | 6 +++--- gst-libs/gst/audio/gstaudiobasesrc.c | 12 +++++++----- gst-libs/gst/tag/gsttagdemux.c | 2 +- gst/audiotestsrc/gstaudiotestsrc.c | 7 +++++-- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/ext/gio/gstgiosrc.c b/ext/gio/gstgiosrc.c index 5e077ad..ec9da40 100644 --- a/ext/gio/gstgiosrc.c +++ b/ext/gio/gstgiosrc.c @@ -256,9 +256,9 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) case GST_QUERY_SCHEDULING: { gchar *scheme; - gboolean pull_mode; + GstSchedulingFlags flags; - pull_mode = FALSE; + flags = 0; if (src->file == NULL) goto forward_parent; @@ -268,7 +268,7 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) if (strcmp (scheme, "file") == 0) { GST_LOG_OBJECT (src, "local URI, assuming random access is possible"); - pull_mode = TRUE; + flags |= GST_SCHEDULING_FLAG_SEEKABLE; } else if (strcmp (scheme, "http") == 0 || strcmp (scheme, "https") == 0) { GST_LOG_OBJECT (src, "blacklisted protocol '%s', " "no random access possible", scheme); @@ -278,7 +278,11 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) } g_free (scheme); - gst_query_set_scheduling (query, pull_mode, pull_mode, FALSE, 1, -1, 1); + gst_query_set_scheduling (query, flags, 1, -1, 0); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); + if (flags & GST_SCHEDULING_FLAG_SEEKABLE) + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PULL); + res = TRUE; break; } diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 3614001..1e4cd4e 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -4320,7 +4320,7 @@ gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent) goto activate_push; } - gst_query_parse_scheduling (query, &pull_mode, NULL, NULL, NULL, NULL, NULL); + pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL); gst_query_unref (query); if (!pull_mode) diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 9e4d11c..9444fd7 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -786,17 +786,17 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query) } case GST_QUERY_SCHEDULING: { - gboolean pull_mode = FALSE; + gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); switch (priv->stream_type) { case GST_APP_STREAM_TYPE_STREAM: case GST_APP_STREAM_TYPE_SEEKABLE: break; case GST_APP_STREAM_TYPE_RANDOM_ACCESS: - pull_mode = TRUE; + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PULL); break; } - gst_query_set_scheduling (query, pull_mode, TRUE, FALSE, 1, -1, 1); res = TRUE; break; } diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index 4c272f9..20838a9 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -642,11 +642,13 @@ gst_audio_base_src_query (GstBaseSrc * bsrc, GstQuery * query) } case GST_QUERY_SCHEDULING: { - /* we allow limited pull base operation of which the details - * will eventually exposed in an as of yet non-existing query. - * Basically pulling can be done on any number of bytes as long - * as the offset is -1 or sequentially increasing. */ - gst_query_set_scheduling (query, TRUE, FALSE, TRUE, 1, -1, 1); + /* We allow limited pull base operation. Basically pulling can be + * done on any number of bytes as long as the offset is -1 or + * sequentially increasing. */ + gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEQUENTIAL, 1, -1, + 0); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PULL); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); res = TRUE; break; diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index 4d02a64..c84ef32 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -1123,7 +1123,7 @@ gst_tag_demux_sink_activate (GstPad * sinkpad, GstObject * parent) goto activate_push; } - gst_query_parse_scheduling (query, &pull_mode, NULL, NULL, NULL, NULL, NULL); + pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL); gst_query_unref (query); if (!pull_mode) diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index 7ded397..6a59884 100644 --- a/gst/audiotestsrc/gstaudiotestsrc.c +++ b/gst/audiotestsrc/gstaudiotestsrc.c @@ -328,8 +328,11 @@ gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery * query) case GST_QUERY_SCHEDULING: { /* if we can operate in pull mode */ - gst_query_set_scheduling (query, src->can_activate_pull, TRUE, FALSE, 1, - -1, 1); + gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); + if (src->can_activate_pull) + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PULL); + res = TRUE; break; } -- 2.7.4