Commit c0ba7985 authored by Vincent Penquerc'h's avatar Vincent Penquerc'h
Browse files

gstelement: add gst_element_class_add_pad_template_from_static

This function helps ensure the pad template is unreffed
without having to complicate the calling code.

https://bugzilla.gnome.org/show_bug.cgi?id=662664
parent 3b28af51
......@@ -1331,6 +1331,30 @@ gst_element_class_add_pad_template (GstElementClass * klass,
klass->numpadtemplates++;
}
/**
* gst_element_class_add_static_pad_template:
* @klass: the #GstElementClass to add the pad template to.
* @templ: (transfer none): a #GstStaticPadTemplate describing the pad
* to add to the element class.
*
* Adds a padtemplate to an element class. This is mainly used in the _base_init
* functions of classes.
*
* Since: 0.10.36
*/
void
gst_element_class_add_static_pad_template (GstElementClass * klass,
GstStaticPadTemplate * templ)
{
GstPadTemplate *pt;
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
pt = gst_static_pad_template_get (templ);
gst_element_class_add_pad_template (klass, pt);
gst_object_unref (pt);
}
static void
gst_element_class_add_meta_data (GstElementClass * klass,
const gchar * key, const gchar * value)
......
......@@ -680,6 +680,7 @@ struct _GstElementClass
/* element class pad templates */
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_class_add_static_pad_template (GstElementClass *klass, GstStaticPadTemplate *templ);
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
......
......@@ -299,6 +299,7 @@ EXPORTS
gst_element_add_pad
gst_element_change_state
gst_element_class_add_pad_template
gst_element_class_add_static_pad_template
gst_element_class_get_pad_template
gst_element_class_get_pad_template_list
gst_element_class_install_std_props
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment