gst_structure_set_parent_refcount (s, NULL);
gst_structure_free (s);
}
+#ifdef USE_POISONING
+ memset (query, 0xff, sizeof (GstQueryImpl));
+#endif
g_slice_free1 (sizeof (GstQueryImpl), query);
}
*
* Free-function: gst_query_unref()
*
- * Returns: (transfer full): a new #GstQuery
+ * Returns: (transfer full) (nullable): a new #GstQuery
*/
GstQuery *
gst_query_new_custom (GstQueryType type, GstStructure * structure)
*
* Get the structure of a query.
*
- * Returns: (transfer none): the #GstStructure of the query. The structure is
- * still owned by the query and will therefore be freed when the query
- * is unreffed.
+ * Returns: (transfer none) (nullable): the #GstStructure of the query. The
+ * structure is still owned by the query and will therefore be freed when the
+ * query is unreffed.
*/
const GstStructure *
gst_query_get_structure (GstQuery * query)
GstStructure *
gst_query_writable_structure (GstQuery * query)
{
+ GstStructure *structure;
+
g_return_val_if_fail (GST_IS_QUERY (query), NULL);
g_return_val_if_fail (gst_query_is_writable (query), NULL);
- return GST_QUERY_STRUCTURE (query);
+ structure = GST_QUERY_STRUCTURE (query);
+
+ if (structure == NULL) {
+ structure =
+ gst_structure_new_id_empty (gst_query_type_to_quark (GST_QUERY_TYPE
+ (query)));
+ gst_structure_set_parent_refcount (structure, &query->mini_object.refcount);
+ GST_QUERY_STRUCTURE (query) = structure;
+ }
+ return structure;
}
/**
/**
* gst_query_parse_nth_format:
* @query: a #GstQuery
- * @nth: (out): the nth format to retrieve.
+ * @nth: the nth format to retrieve.
* @format: (out) (allow-none): a pointer to store the nth format
*
* Parse the format query and retrieve the @nth format from it into
* @index: index to modify
* @query: A valid #GstQuery of type GST_QUERY_ALLOCATION.
* @pool: (transfer none) (allow-none): the #GstBufferPool
- * @size: the size
+ * @size: the buffer size
* @min_buffers: the min buffers
* @max_buffers: the max buffers
*
/**
* gst_query_parse_accept_caps_result:
* @query: a GST_QUERY_ACCEPT_CAPS type query #GstQuery
- * @result: location for the result
+ * @result: (out) (allow-none): location for the result
*
* Parse the result from @query and store in @result.
*/