diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 0443951c92..e9bd81969b 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -827,6 +827,7 @@ GST_ELEMENT_METADATA_LONGNAME 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_set_metadata diff --git a/gst/gstelement.c b/gst/gstelement.c index 6bc013d8fd..cfac92f2a2 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1229,6 +1229,26 @@ 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: #GstStaticPadTemplate to add as pad template to the element class. + * + * Adds a pad template to an element class based on the static pad template + * @templ. This is mainly used in the _class_init functions of element + * implementations. If a pad template with the same name already exists, + * the old one is replaced by the new one. + * + * Since: 1.8 + */ +void +gst_element_class_add_static_pad_template (GstElementClass * klass, + GstStaticPadTemplate * static_templ) +{ + gst_element_class_add_pad_template (klass, + gst_static_pad_template_get (static_templ)); +} + /** * gst_element_class_add_metadata: * @klass: class to set metadata for diff --git a/gst/gstelement.h b/gst/gstelement.h index 0bd92d0d0c..942248d216 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -663,6 +663,9 @@ 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 *static_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); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 9f96c1301f..3fa3c401aa 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -480,6 +480,7 @@ EXPORTS gst_element_class_add_metadata gst_element_class_add_pad_template gst_element_class_add_static_metadata + gst_element_class_add_static_pad_template gst_element_class_get_metadata gst_element_class_get_pad_template gst_element_class_get_pad_template_list