mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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.
This commit is contained in:
parent
23dbeaabc1
commit
53025584c3
4 changed files with 36 additions and 6 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2008-08-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2008-08-27 Michael Smith <msmith@songbirdnest.com>
|
2008-08-27 Michael Smith <msmith@songbirdnest.com>
|
||||||
|
|
||||||
* gst/aiffparse/aiffparse.c:
|
* gst/aiffparse/aiffparse.c:
|
||||||
|
|
|
@ -259,7 +259,7 @@ static GstFlowReturn gst_rtp_session_process_rtp (RTPSession * sess,
|
||||||
static GstFlowReturn gst_rtp_session_send_rtp (RTPSession * sess,
|
static GstFlowReturn gst_rtp_session_send_rtp (RTPSession * sess,
|
||||||
RTPSource * src, GstBuffer * buffer, gpointer user_data);
|
RTPSource * src, GstBuffer * buffer, gpointer user_data);
|
||||||
static GstFlowReturn gst_rtp_session_send_rtcp (RTPSession * sess,
|
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,
|
static GstFlowReturn gst_rtp_session_sync_rtcp (RTPSession * sess,
|
||||||
RTPSource * src, GstBuffer * buffer, gpointer user_data);
|
RTPSource * src, GstBuffer * buffer, gpointer user_data);
|
||||||
static gint gst_rtp_session_clock_rate (RTPSession * sess, guint8 payload,
|
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
|
/* 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
|
static GstFlowReturn
|
||||||
gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
|
gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
|
||||||
GstBuffer * buffer, gpointer user_data)
|
GstBuffer * buffer, gboolean eos, gpointer user_data)
|
||||||
{
|
{
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
GstRtpSession *rtpsession;
|
GstRtpSession *rtpsession;
|
||||||
|
@ -1122,6 +1123,12 @@ gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
|
||||||
gst_buffer_set_caps (buffer, caps);
|
gst_buffer_set_caps (buffer, caps);
|
||||||
GST_LOG_OBJECT (rtpsession, "sending RTCP");
|
GST_LOG_OBJECT (rtpsession, "sending RTCP");
|
||||||
result = gst_pad_push (rtpsession->send_rtcp_src, buffer);
|
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 {
|
} else {
|
||||||
GST_DEBUG_OBJECT (rtpsession, "not sending RTCP, no output pad");
|
GST_DEBUG_OBJECT (rtpsession, "not sending RTCP, no output pad");
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
@ -1557,8 +1564,11 @@ gst_rtp_session_event_send_rtp_sink (GstPad * pad, GstEvent * event)
|
||||||
case GST_EVENT_EOS:{
|
case GST_EVENT_EOS:{
|
||||||
GstClockTime current_time;
|
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);
|
ret = gst_pad_push_event (rtpsession->send_rtp_src, event);
|
||||||
current_time = gst_clock_get_time (rtpsession->priv->sysclock);
|
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",
|
rtp_session_send_bye (rtpsession->priv->session, "End of stream",
|
||||||
current_time);
|
current_time);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2300,6 +2300,7 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
|
||||||
if (is_rtcp_time (sess, current_time, &data)) {
|
if (is_rtcp_time (sess, current_time, &data)) {
|
||||||
if (sess->source->received_bye) {
|
if (sess->source->received_bye) {
|
||||||
/* generate BYE instead */
|
/* generate BYE instead */
|
||||||
|
GST_DEBUG ("generating BYE message");
|
||||||
session_bye (sess, &data);
|
session_bye (sess, &data);
|
||||||
sess->sent_bye = TRUE;
|
sess->sent_bye = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2367,11 +2368,14 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
|
||||||
/* close the RTCP packet */
|
/* close the RTCP packet */
|
||||||
gst_rtcp_buffer_end (data.rtcp);
|
gst_rtcp_buffer_end (data.rtcp);
|
||||||
|
|
||||||
|
GST_DEBUG ("sending packet");
|
||||||
if (sess->callbacks.send_rtcp)
|
if (sess->callbacks.send_rtcp)
|
||||||
result = sess->callbacks.send_rtcp (sess, sess->source, data.rtcp,
|
result = sess->callbacks.send_rtcp (sess, sess->source, data.rtcp,
|
||||||
sess->send_rtcp_user_data);
|
sess->sent_bye, sess->send_rtcp_user_data);
|
||||||
else
|
else {
|
||||||
|
GST_DEBUG ("freeing packet");
|
||||||
gst_buffer_unref (data.rtcp);
|
gst_buffer_unref (data.rtcp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -72,6 +72,7 @@ typedef GstFlowReturn (*RTPSessionSendRTP) (RTPSession *sess, RTPSource *src, Gs
|
||||||
* @sess: an #RTPSession
|
* @sess: an #RTPSession
|
||||||
* @src: the #RTPSource
|
* @src: the #RTPSource
|
||||||
* @buffer: the RTCP buffer ready for sending
|
* @buffer: the RTCP buffer ready for sending
|
||||||
|
* @eos: if an EOS event should be pushed
|
||||||
* @user_data: user data specified when registering
|
* @user_data: user data specified when registering
|
||||||
*
|
*
|
||||||
* This callback will be called when @sess has @buffer ready for sending to
|
* This callback will be called when @sess has @buffer ready for sending to
|
||||||
|
@ -79,7 +80,8 @@ typedef GstFlowReturn (*RTPSessionSendRTP) (RTPSession *sess, RTPSource *src, Gs
|
||||||
*
|
*
|
||||||
* Returns: a #GstFlowReturn.
|
* Returns: a #GstFlowReturn.
|
||||||
*/
|
*/
|
||||||
typedef GstFlowReturn (*RTPSessionSendRTCP) (RTPSession *sess, RTPSource *src, GstBuffer *buffer, gpointer user_data);
|
typedef GstFlowReturn (*RTPSessionSendRTCP) (RTPSession *sess, RTPSource *src, GstBuffer *buffer,
|
||||||
|
gboolean eos, gpointer user_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RTPSessionSyncRTCP:
|
* RTPSessionSyncRTCP:
|
||||||
|
|
Loading…
Reference in a new issue