mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
caps: add gst_clear_caps()
Basically, you can use this instead of using gst_caps_unref (which needs to be preceded by a NULL-check). Also fixes #275
This commit is contained in:
parent
fa1d7a86af
commit
a0fd447abe
1 changed files with 19 additions and 0 deletions
|
@ -223,6 +223,25 @@ gst_caps_unref (GstCaps * caps)
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (caps));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (caps));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_clear_caps: (skip)
|
||||||
|
* @caps_ptr: a pointer to a #GstCaps reference
|
||||||
|
*
|
||||||
|
* Clears a reference to a #GstCaps.
|
||||||
|
*
|
||||||
|
* @caps_ptr must not be %NULL.
|
||||||
|
*
|
||||||
|
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||||
|
* reference count of the caps is decreased and the pointer is set to %NULL.
|
||||||
|
*
|
||||||
|
* Since: 1.16
|
||||||
|
*/
|
||||||
|
static inline void
|
||||||
|
gst_clear_caps (GstCaps ** caps_ptr)
|
||||||
|
{
|
||||||
|
gst_clear_mini_object (caps_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/* copy caps */
|
/* copy caps */
|
||||||
GST_API
|
GST_API
|
||||||
GstCaps * gst_caps_copy (const GstCaps * caps);
|
GstCaps * gst_caps_copy (const GstCaps * caps);
|
||||||
|
|
Loading…
Reference in a new issue