"GstEventInstantRateChange",
"GstEventInstantRateSyncTime", "GstMessageInstantRateRequest",
"upstream-running-time", "base", "offset", "plugin-api", "plugin-api-flags",
- "gap-flags"
+ "gap-flags", "GstQuerySelectable", "selectable"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GST_QUARK_PLUGIN_API = 200,
GST_QUARK_PLUGIN_API_FLAGS = 201,
GST_QUARK_GAP_FLAGS = 202,
- GST_QUARK_MAX = 203
+ GST_QUARK_QUERY_SELECTABLE = 203,
+ GST_QUARK_SELECTABLE = 204,
+ GST_QUARK_MAX = 205
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
}
/**
+ * gst_query_new_selectable:
+ *
+ * Constructs a new query object for querying the stream selection capability.
+ *
+ * Free-function: gst_query_unref()
+ *
+ * Returns: (transfer full): a new #GstQuery
+ *
+ * Since: 1.22
+ */
+GstQuery *
+gst_query_new_selectable (void)
+{
+ GstQuery *query;
+ GstStructure *structure;
+
+ structure = gst_structure_new_id_empty (GST_QUARK (QUERY_SELECTABLE));
+ query = gst_query_new_custom (GST_QUERY_SELECTABLE, structure);
+
+ return query;
+}
+
+/**
+ * gst_query_set_selectable:
+ * @query: a GST_QUERY_SELECTABLE type #GstQuery
+ * @selectable: Whether the element can handle stream selection.
+ *
+ * Set the results of a selectable query. If the element answering the query can
+ * handle stream selection, @selectable should be set to %TRUE.
+ *
+ * Since: 1.22
+ */
+void
+gst_query_set_selectable (GstQuery * query, gboolean selectable)
+{
+ GstStructure *s;
+
+ g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_SELECTABLE);
+
+ s = GST_QUERY_STRUCTURE (query);
+
+ gst_structure_id_set (s,
+ GST_QUARK (SELECTABLE), G_TYPE_BOOLEAN, selectable, NULL);
+}
+
+/**
+ * gst_query_parse_selectable:
+ * @query: a GST_QUERY_SELECTABLE type #GstQuery
+ * @selectable: (out) (allow-none): The resulting stream selection capability
+ *
+ * Get the results of a selectable query. See also gst_query_set_selectable().
+ *
+ * Since: 1.22
+ */
+void
+gst_query_parse_selectable (GstQuery * query, gboolean * selectable)
+{
+ GstStructure *structure;
+
+ g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_SELECTABLE);
+
+ structure = GST_QUERY_STRUCTURE (query);
+
+ if (selectable) {
+ const GValue *value =
+ gst_structure_id_get_value (structure, GST_QUARK (SELECTABLE));
+ if (value)
+ *selectable = g_value_get_boolean (value);
+ else
+ *selectable = FALSE;
+ }
+}
+
+/**
* gst_query_ref:
* @q: a #GstQuery to increase the refcount of.
*
* @GST_QUERY_CONTEXT: query the pipeline-local context from
* downstream or upstream (since 1.2)
* @GST_QUERY_BITRATE: the bitrate query (since 1.16)
+ * @GST_QUERY_SELECTABLE: Query stream selection capability (Since: 1.22)
*
* Standard predefined Query types
*/
GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, _FLAG(BOTH)),
GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, _FLAG(DOWNSTREAM)),
+
+ /**
+ * GST_QUERY_SELECTABLE:
+ *
+ * Query stream selection capability.
+ *
+ * Since: 1.22
+ */
+ GST_QUERY_SELECTABLE = GST_QUERY_MAKE_TYPE (210, _FLAG(BOTH)),
} GstQueryType;
#undef _FLAG
GST_API
void gst_query_parse_bitrate (GstQuery * query, guint * nominal_bitrate);
+/* selectable query */
+
+GST_API
+GstQuery * gst_query_new_selectable (void) G_GNUC_MALLOC;
+
+GST_API
+void gst_query_set_selectable (GstQuery *query, gboolean selectable);
+
+GST_API
+void gst_query_parse_selectable (GstQuery *query, gboolean * selectable);
+
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstQuery, gst_query_unref)
G_END_DECLS