The getrange function is called when a peer pad performs a _pull_range() on the pad. This
downstream pad can be a pulling element or another _pull_range() based element.
+
+Scheduling Query
+~~~~~~~~~~~~~~~~
+
+A sinkpad can ask the upstream srcpad for its scheduling attributes. It does
+this with the SCHEDULING query.
+
+
+ (out) "pull-mode", G_TYPE_BOOLEAN (default FALSE)
+ - if the pad can operate in pull mode, if this flag is not set the pad
+ will operate in push mode.
+
+ (out) "random-access", G_TYPE_BOOLEAN (default FALSE)
+ - the offset of a pull operation can be specified, if this flag is false,
+ the offset should be -1,
+
+ (out) "sequential", G_TYPE_BOOLEAN (default TRUE)
+ - suggest sequential access to the data. If random-access is specified,
+ seeks are allowed but should be avoided. This is common for network
+ streams. (
+
+ (out) "minsize", G_TYPE_INT (default 1)
+ - the suggested minimum size of pull requests
+
+ (out) "maxsize", G_TYPE_INT (default -1, unlimited)
+ - the suggested maximum size of pull requests
+
+ (out) "align", G_TYPE_INT (default 1)
+ - the suggested alignment for the pull requests.
+
+
+
Plug-in techniques
~~~~~~~~~~~~~~~~~~
}
return ret;
}
+
+/**
+ * gst_query_new_scheduling
+ *
+ * Constructs a new query object for querying the scheduling properties.
+ *
+ * Free-function: gst_query_unref
+ *
+ * Returns: (transfer full): a new #GstQuery
+ */
+GstQuery *
+gst_query_new_scheduling (void)
+{
+ GstQuery *query;
+ GstStructure *structure;
+
+ structure = gst_structure_id_new (GST_QUARK (QUERY_SCHEDULING),
+ GST_QUARK (PULL_MODE), G_TYPE_BOOLEAN, FALSE,
+ GST_QUARK (RANDOM_ACCESS), G_TYPE_BOOLEAN, FALSE,
+ GST_QUARK (SEQUENTIAL), G_TYPE_BOOLEAN, TRUE,
+ GST_QUARK (MINSIZE), G_TYPE_INT, 1,
+ GST_QUARK (MAXSIZE), G_TYPE_INT, -1,
+ GST_QUARK (ALIGN), G_TYPE_INT, 1, NULL);
+ query = gst_query_new (GST_QUERY_SCHEDULING, structure);
+
+ return query;
+}
+
+/**
+ * gst_query_set_scheduling
+ * @query: A valid #GstQuery of type GST_QUERY_SCHEDULING.
+ * @pull_mode: if pull mode scheduling is supported
+ * @random_access: if random access is possible
+ * @sequential: if sequential access is recommended
+ * @minsize: the suggested minimum size of pull requests
+ * @maxsize the suggested maximum size of pull requests:
+ * @align: the suggested alignment of pull requests
+ *
+ * Set the scheduling properties.
+ */
+void
+gst_query_set_scheduling (GstQuery * query, gboolean pull_mode,
+ gboolean random_access, gboolean sequential,
+ gint minsize, gint maxsize, gint align)
+{
+ GstStructure *structure;
+
+ g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_SCHEDULING);
+ g_return_if_fail (gst_query_is_writable (query));
+
+ structure = GST_QUERY_STRUCTURE (query);
+ gst_structure_id_set (structure,
+ GST_QUARK (PULL_MODE), G_TYPE_BOOLEAN, pull_mode,
+ GST_QUARK (RANDOM_ACCESS), G_TYPE_BOOLEAN, random_access,
+ GST_QUARK (SEQUENTIAL), G_TYPE_BOOLEAN, sequential,
+ GST_QUARK (MINSIZE), G_TYPE_INT, minsize,
+ GST_QUARK (MAXSIZE), G_TYPE_INT, maxsize,
+ GST_QUARK (ALIGN), G_TYPE_INT, align, NULL);
+}
+
+/**
+ * gst_query_parse_scheduling
+ * @query: A valid #GstQuery of type GST_QUERY_SCHEDULING.
+ * @pull_mode: if pull mode scheduling is supported
+ * @random_access: if random access is possible
+ * @sequential: if sequential access is recommended
+ * @minsize: the suggested minimum size of pull requests
+ * @maxsize the suggested maximum size of pull requests:
+ * @align: the suggested alignment of pull requests
+ *
+ * Set the scheduling properties.
+ */
+void
+gst_query_parse_scheduling (GstQuery * query, gboolean * pull_mode,
+ gboolean * random_access, gboolean * sequential,
+ gint * minsize, gint * maxsize, gint * align)
+{
+ GstStructure *structure;
+
+ g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_SCHEDULING);
+
+ structure = GST_QUERY_STRUCTURE (query);
+ gst_structure_id_get (structure,
+ GST_QUARK (PULL_MODE), G_TYPE_BOOLEAN, pull_mode,
+ GST_QUARK (RANDOM_ACCESS), G_TYPE_BOOLEAN, random_access,
+ GST_QUARK (SEQUENTIAL), G_TYPE_BOOLEAN, sequential,
+ GST_QUARK (MINSIZE), G_TYPE_INT, minsize,
+ GST_QUARK (MAXSIZE), G_TYPE_INT, maxsize,
+ GST_QUARK (ALIGN), G_TYPE_INT, align, NULL);
+}
* 0.10.22.
* @GST_QUERY_URI: query the URI of the source or sink. Since 0.10.22.
* @GST_QUERY_ALLOCATION: the buffer allocation properties
+ * @GST_QUERY_SCHEDULING: the scheduling properties
*
* Standard predefined Query types
*/
GST_QUERY_BUFFERING,
GST_QUERY_CUSTOM,
GST_QUERY_URI,
- GST_QUERY_ALLOCATION
+ GST_QUERY_ALLOCATION,
+ GST_QUERY_SCHEDULING
} GstQueryType;
/**
guint gst_query_get_n_allocation_metas (GstQuery *query);
const gchar * gst_query_parse_nth_allocation_meta (GstQuery *query, guint index);
+/* scheduling query */
+GstQuery * gst_query_new_scheduling (void);
+
+void gst_query_set_scheduling (GstQuery *query, gboolean pull_mode,
+ gboolean random_access, gboolean sequential,
+ gint minsize, gint maxsize, gint align);
+void gst_query_parse_scheduling (GstQuery *query, gboolean *pull_mode,
+ gboolean *random_access, gboolean *sequential,
+ gint *minsize, gint *maxsize, gint *align);
G_END_DECLS