diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-06-29 16:21:05 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-11 02:30:46 +0100 |
commit | 9f330992f5548ea07821a02cb779a2da2c13c46b (patch) | |
tree | da0a68ffd3532df2e9172f1949211e5db3647001 /gst/rtpmanager/rtpsource.c | |
parent | d8496fb105d8733af2923dfc05f1d23466164043 (diff) |
rtpbin: add SDES property that takes GstStructure
Remove all individual SDES properties and use one sdes property that takes a
GstStructure instead. This will allow us to add more custom stuff to the SDES
messages later.
Diffstat (limited to 'gst/rtpmanager/rtpsource.c')
-rw-r--r-- | gst/rtpmanager/rtpsource.c | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/gst/rtpmanager/rtpsource.c b/gst/rtpmanager/rtpsource.c index 209c17b5..4d7c468d 100644 --- a/gst/rtpmanager/rtpsource.c +++ b/gst/rtpmanager/rtpsource.c @@ -316,8 +316,16 @@ rtp_source_create_stats (RTPSource * src) return s; } -static GstStructure * -rtp_source_create_sdes (RTPSource * src) +/** + * rtp_source_get_sdes_struct: + * @src: an #RTSPSource + * + * Get the SDES data as a GstStructure + * + * Returns: a GstStructure with SDES items for @src. + */ +GstStructure * +rtp_source_get_sdes_struct (RTPSource * src) { GstStructure *s; gchar *str; @@ -356,6 +364,44 @@ rtp_source_create_sdes (RTPSource * src) return s; } +/** + * rtp_source_set_sdes_struct: + * @src: an #RTSPSource + * @sdes: a #GstStructure with SDES info + * + * Set the SDES items from @sdes. + */ +void +rtp_source_set_sdes_struct (RTPSource * src, const GstStructure * sdes) +{ + const gchar *str; + + if (!gst_structure_has_name (sdes, "application/x-rtp-source-sdes")) + return; + + if ((str = gst_structure_get_string (sdes, "cname"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_CNAME, str); + } + if ((str = gst_structure_get_string (sdes, "name"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_NAME, str); + } + if ((str = gst_structure_get_string (sdes, "email"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_EMAIL, str); + } + if ((str = gst_structure_get_string (sdes, "phone"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_PHONE, str); + } + if ((str = gst_structure_get_string (sdes, "location"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_LOC, str); + } + if ((str = gst_structure_get_string (sdes, "tool"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_TOOL, str); + } + if ((str = gst_structure_get_string (sdes, "note"))) { + rtp_source_set_sdes_string (src, GST_RTCP_SDES_NOTE, str); + } +} + static void rtp_source_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) @@ -396,7 +442,7 @@ rtp_source_get_property (GObject * object, guint prop_id, g_value_set_boolean (value, rtp_source_is_sender (src)); break; case PROP_SDES: - g_value_take_boxed (value, rtp_source_create_sdes (src)); + g_value_take_boxed (value, rtp_source_get_sdes_struct (src)); break; case PROP_STATS: g_value_take_boxed (value, rtp_source_create_stats (src)); |