diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-08-28 15:21:45 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-08-28 15:21:45 +0000 |
commit | 53025584c3e8491bfec4b8b474fbf39b4155319c (patch) | |
tree | 14cd5064dc8dd13929699d5a1ec8133a527d5138 /gst/rtpmanager/gstrtpsession.c | |
parent | 23dbeaabc115ec76225ed44d65ade7ed4d668885 (diff) | |
download | gst-plugins-bad-53025584c3e8491bfec4b8b474fbf39b4155319c.tar.gz gst-plugins-bad-53025584c3e8491bfec4b8b474fbf39b4155319c.tar.bz2 gst-plugins-bad-53025584c3e8491bfec4b8b474fbf39b4155319c.zip |
gst/rtpmanager/gstrtpsession.c: Send EOS when the session object instructs us to.
Original commit message from CVS:
* gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_send_rtcp),
(gst_rtp_session_event_send_rtp_sink):
Send EOS when the session object instructs us to.
* gst/rtpmanager/rtpsession.c: (rtp_session_on_timeout):
* gst/rtpmanager/rtpsession.h:
Make it possible for the session manager to instruct us to send EOS. We
currently will EOS when the session is a sender and when the sender part
goes EOS. This is not entirely correct behaviour because the session
could still participate as a receiver.
Fixes #549409.
Diffstat (limited to 'gst/rtpmanager/gstrtpsession.c')
-rw-r--r-- | gst/rtpmanager/gstrtpsession.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 75437977..cc794b62 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -259,7 +259,7 @@ static GstFlowReturn gst_rtp_session_process_rtp (RTPSession * sess, static GstFlowReturn gst_rtp_session_send_rtp (RTPSession * sess, RTPSource * src, GstBuffer * buffer, gpointer user_data); static GstFlowReturn gst_rtp_session_send_rtcp (RTPSession * sess, - RTPSource * src, GstBuffer * buffer, gpointer user_data); + RTPSource * src, GstBuffer * buffer, gboolean eos, gpointer user_data); static GstFlowReturn gst_rtp_session_sync_rtcp (RTPSession * sess, RTPSource * src, GstBuffer * buffer, gpointer user_data); static gint gst_rtp_session_clock_rate (RTPSession * sess, guint8 payload, @@ -1098,10 +1098,11 @@ gst_rtp_session_send_rtp (RTPSession * sess, RTPSource * src, } /* called when the session manager has an RTCP packet ready for further - * sending */ + * sending. The eos flag is set when an EOS event should be sent downstream as + * well. */ static GstFlowReturn gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src, - GstBuffer * buffer, gpointer user_data) + GstBuffer * buffer, gboolean eos, gpointer user_data) { GstFlowReturn result; GstRtpSession *rtpsession; @@ -1122,6 +1123,12 @@ gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src, gst_buffer_set_caps (buffer, caps); GST_LOG_OBJECT (rtpsession, "sending RTCP"); result = gst_pad_push (rtpsession->send_rtcp_src, buffer); + + /* we have to send EOS after this packet */ + if (eos) { + GST_LOG_OBJECT (rtpsession, "sending EOS"); + gst_pad_push_event (rtpsession->send_rtcp_src, gst_event_new_eos ()); + } } else { GST_DEBUG_OBJECT (rtpsession, "not sending RTCP, no output pad"); gst_buffer_unref (buffer); @@ -1557,8 +1564,11 @@ gst_rtp_session_event_send_rtp_sink (GstPad * pad, GstEvent * event) case GST_EVENT_EOS:{ GstClockTime current_time; + /* push downstream FIXME, we are not supposed to leave the session just + * because we stop sending. */ ret = gst_pad_push_event (rtpsession->send_rtp_src, event); current_time = gst_clock_get_time (rtpsession->priv->sysclock); + GST_DEBUG_OBJECT (rtpsession, "scheduling BYE message"); rtp_session_send_bye (rtpsession->priv->session, "End of stream", current_time); break; |