diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-12-10 18:36:04 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-12-10 18:36:04 +0000 |
commit | 8b973428f3f1b2df938ea4a2f5786b3ff5f1e925 (patch) | |
tree | 4e953bb6e85aa3633c82f884c153332885e25098 /gst/rtpmanager/gstrtpbin.c | |
parent | 5c1c4a4477f4177c84435b225ce161798ffc21f9 (diff) | |
download | gst-plugins-bad-8b973428f3f1b2df938ea4a2f5786b3ff5f1e925.tar.gz gst-plugins-bad-8b973428f3f1b2df938ea4a2f5786b3ff5f1e925.tar.bz2 gst-plugins-bad-8b973428f3f1b2df938ea4a2f5786b3ff5f1e925.zip |
gst/rtpmanager/: Post a message when the SDES infor changes for a source.
Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_class_init),
(gst_rtp_bin_handle_message):
* gst/rtpmanager/gstrtpsession.c: (source_get_sdes_structure),
(on_ssrc_sdes):
Post a message when the SDES infor changes for a source.
* gst/rtpmanager/rtpsession.c:
* gst/rtpmanager/rtpsource.c:
Update some comments.
Diffstat (limited to 'gst/rtpmanager/gstrtpbin.c')
-rw-r--r-- | gst/rtpmanager/gstrtpbin.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 9e642dff..9277a8b1 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -1021,6 +1021,7 @@ static GstStateChangeReturn gst_rtp_bin_change_state (GstElement * element, static GstPad *gst_rtp_bin_request_new_pad (GstElement * element, GstPadTemplate * templ, const gchar * name); static void gst_rtp_bin_release_pad (GstElement * element, GstPad * pad); +static void gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message); static void gst_rtp_bin_clear_pt_map (GstRtpBin * bin); GST_BOILERPLATE (GstRtpBin, gst_rtp_bin, GstBin, GST_TYPE_BIN); @@ -1054,9 +1055,11 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; + GstBinClass *gstbin_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; + gstbin_class = (GstBinClass *) klass; g_type_class_add_private (klass, sizeof (GstRtpBinPrivate)); @@ -1244,6 +1247,8 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) GST_DEBUG_FUNCPTR (gst_rtp_bin_request_new_pad); gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gst_rtp_bin_release_pad); + gstbin_class->handle_message = GST_DEBUG_FUNCPTR (gst_rtp_bin_handle_message); + klass->clear_pt_map = GST_DEBUG_FUNCPTR (gst_rtp_bin_clear_pt_map); GST_DEBUG_CATEGORY_INIT (gst_rtp_bin_debug, "rtpbin", 0, "RTP bin"); @@ -1471,6 +1476,50 @@ gst_rtp_bin_provide_clock (GstElement * element) } static void +gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message) +{ + GstRtpBin *rtpbin; + + rtpbin = GST_RTP_BIN (bin); + + switch (GST_MESSAGE_TYPE (message)) { + case GST_MESSAGE_ELEMENT: + { + const GstStructure *s = gst_message_get_structure (message); + + /* we change the structure name and add the session ID to it */ + if (gst_structure_has_name (s, "GstRTPSessionSDES")) { + GSList *walk; + + /* find the session, the message source has it */ + for (walk = rtpbin->sessions; walk; walk = g_slist_next (walk)) { + GstRtpBinSession *sess = (GstRtpBinSession *) walk->data; + + /* if we found the session, change message. else we exit the loop and + * leave the message unchanged */ + if (GST_OBJECT_CAST (sess->session) == GST_MESSAGE_SRC (message)) { + message = gst_message_make_writable (message); + s = gst_message_get_structure (message); + + gst_structure_set_name ((GstStructure *) s, "GstRTPBinSDES"); + + gst_structure_set ((GstStructure *) s, "session", G_TYPE_UINT, + sess->id, NULL); + break; + } + } + } + /* fallthrough to forward the modified message to the parent */ + } + default: + { + GST_BIN_CLASS (parent_class)->handle_message (bin, message); + break; + } + } +} + +static void calc_ntp_ns_base (GstRtpBin * bin) { GstClockTime now; |