mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
rtphdrext: Set caps without attributes as the default
Most subclasses just use the simple function, so just let the base class do it. It makes less code in subclasses. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/906>
This commit is contained in:
parent
498740fe57
commit
ba328fb98d
4 changed files with 12 additions and 13 deletions
|
@ -34,6 +34,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension
|
||||||
|
* ext, GstCaps * caps);
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (rtphderext_debug);
|
GST_DEBUG_CATEGORY_STATIC (rtphderext_debug);
|
||||||
#define GST_CAT_DEFAULT (rtphderext_debug)
|
#define GST_CAT_DEFAULT (rtphderext_debug)
|
||||||
|
|
||||||
|
@ -178,6 +182,8 @@ gst_rtp_header_extension_class_set_uri (GstRTPHeaderExtensionClass * klass,
|
||||||
static void
|
static void
|
||||||
gst_rtp_header_extension_class_init (GstRTPHeaderExtensionClass * klass)
|
gst_rtp_header_extension_class_init (GstRTPHeaderExtensionClass * klass)
|
||||||
{
|
{
|
||||||
|
klass->set_caps_from_attributes =
|
||||||
|
gst_rtp_header_extension_set_caps_from_attributes_default;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -620,8 +626,8 @@ gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext)
|
||||||
return g_strdup_printf ("extmap-%u", priv->ext_id);
|
return g_strdup_printf ("extmap-%u", priv->ext_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* gst_rtp_header_extension_set_caps_from_attributes_simple_sdp:
|
* gst_rtp_header_extension_set_caps_from_attributes_default
|
||||||
* @ext: the #GstRTPHeaderExtension
|
* @ext: the #GstRTPHeaderExtension
|
||||||
* @caps: #GstCaps to write fields into
|
* @caps: #GstCaps to write fields into
|
||||||
*
|
*
|
||||||
|
@ -633,12 +639,11 @@ gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext)
|
||||||
* advertised in @caps.
|
* advertised in @caps.
|
||||||
*
|
*
|
||||||
* Returns: whether the @ext attributes could be set on @caps.
|
* Returns: whether the @ext attributes could be set on @caps.
|
||||||
*
|
|
||||||
* Since: 1.20
|
|
||||||
*/
|
*/
|
||||||
gboolean
|
static gboolean
|
||||||
gst_rtp_header_extension_set_caps_from_attributes_simple_sdp
|
gst_rtp_header_extension_set_caps_from_attributes_default (GstRTPHeaderExtension
|
||||||
(GstRTPHeaderExtension * ext, GstCaps * caps) {
|
* ext, GstCaps * caps)
|
||||||
|
{
|
||||||
gchar *field_name = gst_rtp_header_extension_get_sdp_caps_field_name (ext);
|
gchar *field_name = gst_rtp_header_extension_get_sdp_caps_field_name (ext);
|
||||||
GstStructure *s = gst_caps_get_structure (caps, 0);
|
GstStructure *s = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
|
|
|
@ -247,8 +247,6 @@ GstRTPHeaderExtension * gst_rtp_header_extension_create_from_uri (const gchar *
|
||||||
|
|
||||||
GST_RTP_API
|
GST_RTP_API
|
||||||
gchar * gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext);
|
gchar * gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext);
|
||||||
GST_RTP_API
|
|
||||||
gboolean gst_rtp_header_extension_set_caps_from_attributes_simple_sdp (GstRTPHeaderExtension * ext, GstCaps *caps);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -451,8 +451,6 @@ static void
|
||||||
gst_rtp_header_extension_colorspace_set_non_rtp_sink_caps;
|
gst_rtp_header_extension_colorspace_set_non_rtp_sink_caps;
|
||||||
rtp_hdr_class->update_non_rtp_src_caps =
|
rtp_hdr_class->update_non_rtp_src_caps =
|
||||||
gst_rtp_header_extension_colorspace_update_non_rtp_src_caps;
|
gst_rtp_header_extension_colorspace_update_non_rtp_src_caps;
|
||||||
rtp_hdr_class->set_caps_from_attributes =
|
|
||||||
gst_rtp_header_extension_set_caps_from_attributes_simple_sdp;
|
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (gstelement_class,
|
gst_element_class_set_static_metadata (gstelement_class,
|
||||||
"Color Space", GST_RTP_HDREXT_ELEMENT_CLASS,
|
"Color Space", GST_RTP_HDREXT_ELEMENT_CLASS,
|
||||||
|
|
|
@ -104,8 +104,6 @@ gst_rtp_header_extension_twcc_class_init (GstRTPHeaderExtensionTWCCClass *
|
||||||
rtp_hdr_class->get_max_size = gst_rtp_header_extension_twcc_get_max_size;
|
rtp_hdr_class->get_max_size = gst_rtp_header_extension_twcc_get_max_size;
|
||||||
rtp_hdr_class->write = gst_rtp_header_extension_twcc_write;
|
rtp_hdr_class->write = gst_rtp_header_extension_twcc_write;
|
||||||
rtp_hdr_class->read = gst_rtp_header_extension_twcc_read;
|
rtp_hdr_class->read = gst_rtp_header_extension_twcc_read;
|
||||||
rtp_hdr_class->set_caps_from_attributes =
|
|
||||||
gst_rtp_header_extension_set_caps_from_attributes_simple_sdp;
|
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (gstelement_class,
|
gst_element_class_set_static_metadata (gstelement_class,
|
||||||
"Transport Wide Congestion Control", GST_RTP_HDREXT_ELEMENT_CLASS,
|
"Transport Wide Congestion Control", GST_RTP_HDREXT_ELEMENT_CLASS,
|
||||||
|
|
Loading…
Reference in a new issue