summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-05-22 13:45:15 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-05-22 13:45:15 +0200
commitd48dcb04998835469d15cba23e455c61dfb1a80c (patch)
tree4792d108284c28499aa0b00ef80197ec2d1837fd /gst
parent50d9bc92fb3914cc2128f204bed7a7dd43360f5a (diff)
downloadgst-plugins-bad-d48dcb04998835469d15cba23e455c61dfb1a80c.tar.gz
gst-plugins-bad-d48dcb04998835469d15cba23e455c61dfb1a80c.tar.bz2
gst-plugins-bad-d48dcb04998835469d15cba23e455c61dfb1a80c.zip
rtpsession: reuse source code for SDES
Reuse the RTPSource object property instead of duplicating code.
Diffstat (limited to 'gst')
-rw-r--r--gst/rtpmanager/gstrtpsession.c60
1 files changed, 2 insertions, 58 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c
index 035d82a8..c33fdfc6 100644
--- a/gst/rtpmanager/gstrtpsession.c
+++ b/gst/rtpmanager/gstrtpsession.c
@@ -323,63 +323,6 @@ on_ssrc_active (RTPSession * session, RTPSource * src, GstRtpSession * sess)
src->ssrc);
}
-static GstStructure *
-source_get_sdes_structure (RTPSource * src)
-{
- GstStructure *result;
- GValue val = { 0 };
- gchar *str;
-
- result = gst_structure_empty_new ("GstRTPSessionSDES");
-
- gst_structure_set (result, "ssrc", G_TYPE_UINT, src->ssrc, NULL);
-
- g_value_init (&val, G_TYPE_STRING);
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_CNAME);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "cname", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_NAME);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "name", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_EMAIL);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "email", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_PHONE);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "phone", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_LOC);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "location", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_TOOL);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "tool", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_NOTE);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "note", &val);
- }
- str = rtp_source_get_sdes_string (src, GST_RTCP_SDES_PRIV);
- if (str) {
- g_value_take_string (&val, str);
- gst_structure_set_value (result, "priv", &val);
- }
- g_value_unset (&val);
-
- return result;
-}
-
static void
on_ssrc_sdes (RTPSession * session, RTPSource * src, GstRtpSession * sess)
{
@@ -388,8 +331,9 @@ on_ssrc_sdes (RTPSession * session, RTPSource * src, GstRtpSession * sess)
/* convert the new SDES info into a message */
RTP_SESSION_LOCK (session);
- s = source_get_sdes_structure (src);
+ g_object_get (src, "sdes", &s, NULL);
RTP_SESSION_UNLOCK (session);
+
m = gst_message_new_custom (GST_MESSAGE_ELEMENT, GST_OBJECT (sess), s);
gst_element_post_message (GST_ELEMENT_CAST (sess), m);