update for new scheduling query

This commit is contained in:
Wim Taymans 2011-11-18 17:58:58 +01:00
parent 1ad4d20607
commit d0bd5f04c0
6 changed files with 25 additions and 16 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -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)

View file

@ -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;
}