Commit d0bd5f04 authored by Wim Taymans's avatar Wim Taymans

update for new scheduling query

parent 1ad4d206
...@@ -256,9 +256,9 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) ...@@ -256,9 +256,9 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query)
case GST_QUERY_SCHEDULING: case GST_QUERY_SCHEDULING:
{ {
gchar *scheme; gchar *scheme;
gboolean pull_mode; GstSchedulingFlags flags;
pull_mode = FALSE; flags = 0;
if (src->file == NULL) if (src->file == NULL)
goto forward_parent; goto forward_parent;
...@@ -268,7 +268,7 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) ...@@ -268,7 +268,7 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query)
if (strcmp (scheme, "file") == 0) { if (strcmp (scheme, "file") == 0) {
GST_LOG_OBJECT (src, "local URI, assuming random access is possible"); 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) { } else if (strcmp (scheme, "http") == 0 || strcmp (scheme, "https") == 0) {
GST_LOG_OBJECT (src, "blacklisted protocol '%s', " GST_LOG_OBJECT (src, "blacklisted protocol '%s', "
"no random access possible", scheme); "no random access possible", scheme);
...@@ -278,7 +278,11 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query) ...@@ -278,7 +278,11 @@ gst_gio_src_query (GstBaseSrc * base_src, GstQuery * query)
} }
g_free (scheme); 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; res = TRUE;
break; break;
} }
......
...@@ -4320,7 +4320,7 @@ gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent) ...@@ -4320,7 +4320,7 @@ gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent)
goto activate_push; 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); gst_query_unref (query);
if (!pull_mode) if (!pull_mode)
......
...@@ -786,17 +786,17 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query) ...@@ -786,17 +786,17 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query)
} }
case GST_QUERY_SCHEDULING: 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) { switch (priv->stream_type) {
case GST_APP_STREAM_TYPE_STREAM: case GST_APP_STREAM_TYPE_STREAM:
case GST_APP_STREAM_TYPE_SEEKABLE: case GST_APP_STREAM_TYPE_SEEKABLE:
break; break;
case GST_APP_STREAM_TYPE_RANDOM_ACCESS: case GST_APP_STREAM_TYPE_RANDOM_ACCESS:
pull_mode = TRUE; gst_query_add_scheduling_mode (query, GST_PAD_MODE_PULL);
break; break;
} }
gst_query_set_scheduling (query, pull_mode, TRUE, FALSE, 1, -1, 1);
res = TRUE; res = TRUE;
break; break;
} }
......
...@@ -642,11 +642,13 @@ gst_audio_base_src_query (GstBaseSrc * bsrc, GstQuery * query) ...@@ -642,11 +642,13 @@ gst_audio_base_src_query (GstBaseSrc * bsrc, GstQuery * query)
} }
case GST_QUERY_SCHEDULING: case GST_QUERY_SCHEDULING:
{ {
/* we allow limited pull base operation of which the details /* We allow limited pull base operation. Basically pulling can be
* will eventually exposed in an as of yet non-existing query. * done on any number of bytes as long as the offset is -1 or
* Basically pulling can be done on any number of bytes as long * sequentially increasing. */
* as the offset is -1 or sequentially increasing. */ gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEQUENTIAL, 1, -1,
gst_query_set_scheduling (query, TRUE, FALSE, TRUE, 1, -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; res = TRUE;
break; break;
......
...@@ -1123,7 +1123,7 @@ gst_tag_demux_sink_activate (GstPad * sinkpad, GstObject * parent) ...@@ -1123,7 +1123,7 @@ gst_tag_demux_sink_activate (GstPad * sinkpad, GstObject * parent)
goto activate_push; 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); gst_query_unref (query);
if (!pull_mode) if (!pull_mode)
......
...@@ -328,8 +328,11 @@ gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery * query) ...@@ -328,8 +328,11 @@ gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery * query)
case GST_QUERY_SCHEDULING: case GST_QUERY_SCHEDULING:
{ {
/* if we can operate in pull mode */ /* if we can operate in pull mode */
gst_query_set_scheduling (query, src->can_activate_pull, TRUE, FALSE, 1, gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0);
-1, 1); 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; res = TRUE;
break; break;
} }
......
Markdown is supported
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