mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 13:11:06 +00:00
context: Add convenience function gst_context_has_context_type()
This commit is contained in:
parent
0ecdc31efb
commit
f09b122453
4 changed files with 24 additions and 0 deletions
|
@ -679,6 +679,7 @@ gst_context_ref
|
||||||
gst_context_unref
|
gst_context_unref
|
||||||
gst_context_copy
|
gst_context_copy
|
||||||
gst_context_get_context_type
|
gst_context_get_context_type
|
||||||
|
gst_context_has_context_type
|
||||||
gst_context_is_persistent
|
gst_context_is_persistent
|
||||||
gst_context_get_structure
|
gst_context_get_structure
|
||||||
gst_context_writable_structure
|
gst_context_writable_structure
|
||||||
|
|
|
@ -190,6 +190,27 @@ gst_context_get_context_type (const GstContext * context)
|
||||||
return context->context_type;
|
return context->context_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_context_has_context_type:
|
||||||
|
* @context: The #GstContext.
|
||||||
|
* @context_type: Context type to check.
|
||||||
|
*
|
||||||
|
* Checks if @context has @context_type.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if @context has @context_type.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_context_has_context_type (const GstContext * context,
|
||||||
|
const gchar * context_type)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GST_IS_CONTEXT (context), NULL);
|
||||||
|
g_return_val_if_fail (context_type != NULL, NULL);
|
||||||
|
|
||||||
|
return strcmp (context->context_type, context_type) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_context_get_structure:
|
* gst_context_get_structure:
|
||||||
* @context: The #GstContext.
|
* @context: The #GstContext.
|
||||||
|
|
|
@ -148,6 +148,7 @@ GstContext * gst_context_new (const gchar * contex
|
||||||
gboolean persistent) G_GNUC_MALLOC;
|
gboolean persistent) G_GNUC_MALLOC;
|
||||||
|
|
||||||
const gchar * gst_context_get_context_type (const GstContext * context);
|
const gchar * gst_context_get_context_type (const GstContext * context);
|
||||||
|
gboolean gst_context_has_context_type (const GstContext * context, const gchar * context_type);
|
||||||
const GstStructure * gst_context_get_structure (const GstContext * context);
|
const GstStructure * gst_context_get_structure (const GstContext * context);
|
||||||
GstStructure * gst_context_writable_structure (GstContext * context);
|
GstStructure * gst_context_writable_structure (GstContext * context);
|
||||||
|
|
||||||
|
|
|
@ -305,6 +305,7 @@ EXPORTS
|
||||||
gst_context_get_context_type
|
gst_context_get_context_type
|
||||||
gst_context_get_structure
|
gst_context_get_structure
|
||||||
gst_context_get_type
|
gst_context_get_type
|
||||||
|
gst_context_has_context_type
|
||||||
gst_context_is_persistent
|
gst_context_is_persistent
|
||||||
gst_context_new
|
gst_context_new
|
||||||
gst_context_writable_structure
|
gst_context_writable_structure
|
||||||
|
|
Loading…
Reference in a new issue