diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c b/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c index 948c8b9494..679195240e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c @@ -652,8 +652,8 @@ gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext) return g_strdup_printf ("extmap-%u", priv->ext_id); } -/* - * gst_rtp_header_extension_set_caps_from_attributes_default +/** + * gst_rtp_header_extension_set_caps_from_attributes_helper: * @ext: the #GstRTPHeaderExtension * @caps: #GstCaps to write fields into * @@ -665,17 +665,20 @@ gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext) * advertised in @caps. * * Returns: whether the @ext attributes could be set on @caps. + * + * Since: 1.20 */ -static gboolean -gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension - * ext, GstCaps * caps) +gboolean +gst_rtp_header_extension_set_caps_from_attributes_helper (GstRTPHeaderExtension + * ext, GstCaps * caps, const gchar * attributes) { GstRTPHeaderExtensionPrivate *priv = gst_rtp_header_extension_get_instance_private (ext); gchar *field_name = gst_rtp_header_extension_get_sdp_caps_field_name (ext); GstStructure *s = gst_caps_get_structure (caps, 0); - if (priv->direction & GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED) { + if (priv->direction & GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED && + (attributes == NULL || attributes[0] == 0)) { gst_structure_set (s, field_name, G_TYPE_STRING, gst_rtp_header_extension_get_uri (ext), NULL); } else { @@ -705,7 +708,7 @@ gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension gst_value_array_append_value (&arr, &val); /* attributes */ - g_value_set_string (&val, ""); + g_value_set_string (&val, attributes); gst_value_array_append_value (&arr, &val); gst_structure_set_value (s, field_name, &arr); @@ -720,6 +723,14 @@ gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension return TRUE; } +static gboolean +gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension + * ext, GstCaps * caps) +{ + return gst_rtp_header_extension_set_caps_from_attributes_helper (ext, caps, + NULL); +} + static gboolean gst_rtp_ext_list_filter (GstPluginFeature * feature, gpointer user_data) { diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.h b/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.h index 5fbf013e98..73e6daf053 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.h @@ -281,6 +281,11 @@ void gst_rtp_header_extension_set_direction (GstRTPHeaderExtension * GST_RTP_API GstRTPHeaderExtensionDirection gst_rtp_header_extension_get_direction (GstRTPHeaderExtension * ext); +GST_RTP_API +gboolean gst_rtp_header_extension_set_caps_from_attributes_helper (GstRTPHeaderExtension * ext, + GstCaps * caps, + const gchar * attributes); + G_END_DECLS #endif /* __GST_RTPHDREXT_H__ */