diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-10-08 10:39:35 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-10-08 10:39:35 +0000 |
commit | 4865b3bf146fe7392aed1a9e2df2efcb63d19ead (patch) | |
tree | 05a5a6579e0a8101fdd6ccb31de3b9e4c753f43c /gst/rtpmanager/gstrtpbin.c | |
parent | e5a48677c1d9febf7f5d0ca170e3b91374a44343 (diff) | |
download | gst-plugins-bad-4865b3bf146fe7392aed1a9e2df2efcb63d19ead.tar.gz gst-plugins-bad-4865b3bf146fe7392aed1a9e2df2efcb63d19ead.tar.bz2 gst-plugins-bad-4865b3bf146fe7392aed1a9e2df2efcb63d19ead.zip |
gst/rtpmanager/gstrtpbin.c: Fix caps refcounting for payload maps.
Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (get_pt_map),
(gst_rtp_bin_clear_pt_map), (gst_rtp_bin_class_init):
Fix caps refcounting for payload maps.
When clearing payload maps, also clear sessions and streams payload
maps.
* gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_get_caps),
(gst_rtp_pt_demux_clear_pt_map), (gst_rtp_pt_demux_chain),
(find_pad_for_pt):
Implement clearing the payload map.
* gst/rtpmanager/gstrtpsession.c:
(gst_rtp_session_event_send_rtp_sink):
Forward flush events instead of leaking them.
* gst/rtpmanager/gstrtpssrcdemux.c:
(gst_rtp_ssrc_demux_rtcp_sink_event):
Correctly refcount events before pushing them.
Diffstat (limited to 'gst/rtpmanager/gstrtpbin.c')
-rw-r--r-- | gst/rtpmanager/gstrtpbin.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 59ad0155..eddd137c 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -140,7 +140,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtp_bin_debug); #define GST_CAT_DEFAULT gst_rtp_bin_debug - /* elementfactory information */ static const GstElementDetails rtpbin_details = GST_ELEMENT_DETAILS ("RTP Bin", "Filter/Network/RTP", @@ -562,6 +561,7 @@ get_pt_map (GstRtpBinSession * session, guint pt) g_hash_table_insert (session->ptmap, GINT_TO_POINTER (pt), caps); done: + gst_caps_ref (caps); GST_RTP_SESSION_UNLOCK (session); return caps; @@ -584,20 +584,26 @@ return_true (gpointer key, gpointer value, gpointer user_data) static void gst_rtp_bin_clear_pt_map (GstRtpBin * bin) { - GSList *walk; + GSList *sessions, *streams; GST_RTP_BIN_LOCK (bin); GST_DEBUG_OBJECT (bin, "clearing pt map"); - for (walk = bin->sessions; walk; walk = g_slist_next (walk)) { - GstRtpBinSession *session = (GstRtpBinSession *) walk->data; + for (sessions = bin->sessions; sessions; sessions = g_slist_next (sessions)) { + GstRtpBinSession *session = (GstRtpBinSession *) sessions->data; + + GST_DEBUG_OBJECT (bin, "clearing session %p", session); + g_signal_emit_by_name (session->session, "clear-pt-map", NULL); GST_RTP_SESSION_LOCK (session); -#if 0 - /* This requires GLib 2.12 */ - g_hash_table_remove_all (session->ptmap); -#else g_hash_table_foreach_remove (session->ptmap, return_true, NULL); -#endif + + for (streams = session->streams; streams; streams = g_slist_next (streams)) { + GstRtpBinStream *stream = (GstRtpBinStream *) streams->data; + + GST_DEBUG_OBJECT (bin, "clearing stream %p", stream); + g_signal_emit_by_name (stream->buffer, "clear-pt-map", NULL); + g_signal_emit_by_name (stream->demux, "clear-pt-map", NULL); + } GST_RTP_SESSION_UNLOCK (session); } GST_RTP_BIN_UNLOCK (bin); @@ -1049,8 +1055,9 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) */ gst_rtp_bin_signals[SIGNAL_CLEAR_PT_MAP] = g_signal_new ("clear-pt-map", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstRtpBinClass, clear_pt_map), - NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstRtpBinClass, + clear_pt_map), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, + 0, G_TYPE_NONE); /** * GstRtpBin::on-new-ssrc: |