diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 015296529c..8c0ec6f43b 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -896,6 +896,7 @@ gst_element_link_filtered gst_element_class_get_metadata +gst_element_get_metadata gst_element_set_base_time gst_element_get_base_time gst_element_set_start_time @@ -911,6 +912,8 @@ gst_element_set_name gst_element_get_name gst_element_set_parent gst_element_get_parent +gst_element_get_pad_template +gst_element_get_pad_template_list gst_element_set_clock @@ -3824,6 +3827,7 @@ gst_device_provider_device_remove gst_device_provider_get_bus gst_device_provider_get_devices gst_device_provider_get_factory +gst_device_provider_get_metadata gst_device_provider_register gst_device_provider_start gst_device_provider_stop diff --git a/gst/gstdeviceprovider.c b/gst/gstdeviceprovider.c index 8038d0204f..c0c8c7b76d 100644 --- a/gst/gstdeviceprovider.c +++ b/gst/gstdeviceprovider.c @@ -351,6 +351,29 @@ gst_device_provider_class_get_metadata (GstDeviceProviderClass * klass, return gst_structure_get_string ((GstStructure *) klass->metadata, key); } +/** + * gst_device_provider_get_metadata: + * @provider: provider to get metadata for + * @key: the key to get + * + * Get metadata with @key in @provider. + * + * Returns: the metadata for @key. + * + * Since: 1.14 + */ +const gchar * +gst_device_provider_get_metadata (GstDeviceProvider * provider, + const gchar * key) +{ + g_return_val_if_fail (GST_IS_DEVICE_PROVIDER (provider), NULL); + g_return_val_if_fail (key != NULL, NULL); + + return + gst_device_provider_class_get_metadata (GST_DEVICE_PROVIDER_GET_CLASS + (provider), key); +} + /** * gst_device_provider_get_devices: * @provider: A #GstDeviceProvider diff --git a/gst/gstdeviceprovider.h b/gst/gstdeviceprovider.h index 5b32c576bf..ba768cace6 100644 --- a/gst/gstdeviceprovider.h +++ b/gst/gstdeviceprovider.h @@ -134,6 +134,9 @@ GST_EXPORT void gst_device_provider_unhide_provider (GstDeviceProvider * provider, const gchar * name); +GST_EXPORT +const gchar * gst_device_provider_get_metadata (GstDeviceProvider * provider, + const gchar * key); /* device provider class meta data */ diff --git a/gst/gstelement.c b/gst/gstelement.c index 28ff49dd50..4026009257 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1461,6 +1461,26 @@ gst_element_class_get_metadata (GstElementClass * klass, const gchar * key) return gst_structure_get_string ((GstStructure *) klass->metadata, key); } +/** + * gst_element_get_metadata: + * @element: class to get metadata for + * @key: the key to get + * + * Get metadata with @key in @klass. + * + * Returns: the metadata for @key. + * + * Since: 1.14 + */ +const gchar * +gst_element_get_metadata (GstElement * element, const gchar * key) +{ + g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); + g_return_val_if_fail (key != NULL, NULL); + + return gst_element_class_get_metadata (GST_ELEMENT_GET_CLASS (element), key); +} + /** * gst_element_class_get_pad_template_list: * @element_class: a #GstElementClass to get pad templates of. @@ -1482,6 +1502,27 @@ gst_element_class_get_pad_template_list (GstElementClass * element_class) return element_class->padtemplates; } +/** + * gst_element_get_pad_template_list: + * @element: a #GstElement to get pad templates of. + * + * Retrieves a list of the pad templates associated with @element. The + * list must not be modified by the calling code. + * + * Returns: (transfer none) (element-type Gst.PadTemplate): the #GList of + * pad templates. + * + * Since: 1.14 + */ +GList * +gst_element_get_pad_template_list (GstElement * element) +{ + g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); + + return + gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (element)); +} + /** * gst_element_class_get_pad_template: * @element_class: a #GstElementClass to get the pad template of. @@ -1519,6 +1560,29 @@ gst_element_class_get_pad_template (GstElementClass * return NULL; } +/** + * gst_element_get_pad_template: + * @element: a #GstElement to get the pad template of. + * @name: the name of the #GstPadTemplate to get. + * + * Retrieves a padtemplate from @element with the given name. + * + * Returns: (transfer none) (nullable): the #GstPadTemplate with the + * given name, or %NULL if none was found. No unreferencing is + * necessary. + * + * Since: 1.14 + */ +GstPadTemplate * +gst_element_get_pad_template (GstElement * element, const gchar * name) +{ + g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); + g_return_val_if_fail (name != NULL, NULL); + + return gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (element), + name); +} + static GstPadTemplate * gst_element_class_get_request_pad_template (GstElementClass * element_class, const gchar * name) diff --git a/gst/gstelement.h b/gst/gstelement.h index 83d9224044..781a21b23f 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -1008,6 +1008,14 @@ GST_EXPORT void gst_element_remove_property_notify_watch (GstElement * element, gulong watch_id); +GST_EXPORT +GstPadTemplate* gst_element_get_pad_template (GstElement *element, const gchar *name); + +GST_EXPORT +GList* gst_element_get_pad_template_list (GstElement *element); +GST_EXPORT +const gchar * gst_element_get_metadata (GstElement * element, const gchar * key); + #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstElement, gst_object_unref) #endif diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index c5dcf93480..db6f55a472 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -479,6 +479,7 @@ EXPORTS gst_device_provider_get_devices gst_device_provider_get_factory gst_device_provider_get_hidden_providers + gst_device_provider_get_metadata gst_device_provider_get_type gst_device_provider_hide_provider gst_device_provider_register @@ -536,6 +537,9 @@ EXPORTS gst_element_get_context_unlocked gst_element_get_contexts gst_element_get_factory + gst_element_get_metadata + gst_element_get_pad_template + gst_element_get_pad_template_list gst_element_get_request_pad gst_element_get_start_time gst_element_get_state