*
* Check if @query has scheduling mode set.
*
+ * <note>
+ * <para>
+ * When checking if upstream supports pull mode, it is usually not
+ * enough to just check for GST_PAD_MODE_PULL with this function, you
+ * also want to check whether the scheduling flags returned by
+ * gst_query_parse_scheduling() have the seeking flag set (meaning
+ * random access is supported, not only sequential pulls).
+ * </para>
+ * </note>
+ *
* Returns: TRUE when @mode is in the list of scheduling modes.
*/
gboolean
static gboolean
gst_base_parse_sink_activate (GstPad * sinkpad, GstObject * parent)
{
+ GstSchedulingFlags sched_flags;
GstBaseParse *parse;
GstQuery *query;
gboolean pull_mode;
goto baseparse_push;
}
- pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL);
+ gst_query_parse_scheduling (query, &sched_flags, NULL, NULL, NULL);
+
+ pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL)
+ && ((sched_flags & GST_SCHEDULING_FLAG_SEEKABLE) != 0);
+
gst_query_unref (query);
if (!pull_mode)
gboolean pull_mode;
GstCaps *found_caps = NULL;
GstTypeFindProbability probability = GST_TYPE_FIND_NONE;
+ GstSchedulingFlags sched_flags;
typefind = GST_TYPE_FIND_ELEMENT (parent);
goto typefind_push;
}
- pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL);
+ gst_query_parse_scheduling (query, &sched_flags, NULL, NULL, NULL);
+
+ pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL)
+ && ((sched_flags & GST_SCHEDULING_FLAG_SEEKABLE) != 0);
+
gst_query_unref (query);
if (!pull_mode)