summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/rtsp-server/rtsp-media.c25
-rw-r--r--gst/rtsp-server/rtsp-stream.c11
-rw-r--r--gst/rtsp-server/rtsp-stream.h2
3 files changed, 30 insertions, 8 deletions
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index 8b25e07..344ac27 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -2440,6 +2440,25 @@ preroll_failed:
}
}
+static GstElement *
+request_aux_sender (GstElement * rtpbin, guint sessid, GstRTSPMedia * media)
+{
+ GstRTSPMediaPrivate *priv = media->priv;
+ GstRTSPStream *stream = NULL;
+ guint i;
+
+ g_mutex_lock (&priv->lock);
+ for (i = 0; i < priv->streams->len; i++) {
+ stream = g_ptr_array_index (priv->streams, i);
+
+ if (sessid == gst_rtsp_stream_get_index (stream))
+ break;
+ }
+ g_mutex_unlock (&priv->lock);
+
+ return gst_rtsp_stream_request_aux_sender (stream, sessid);
+}
+
static gboolean
start_prepare (GstRTSPMedia * media)
{
@@ -2454,6 +2473,12 @@ start_prepare (GstRTSPMedia * media)
stream = g_ptr_array_index (priv->streams, i);
+ if (priv->rtx_time > 0) {
+ /* enable retransmission by setting rtprtxsend as the "aux" element of rtpbin */
+ g_signal_connect (priv->rtpbin, "request-aux-sender",
+ (GCallback) request_aux_sender, media);
+ }
+
if (!gst_rtsp_stream_join_bin (stream, GST_BIN (priv->pipeline),
priv->rtpbin, GST_STATE_NULL)) {
goto join_bin_failed;
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c
index dfbd4a3..8a4abed 100644
--- a/gst/rtsp-server/rtsp-stream.c
+++ b/gst/rtsp-server/rtsp-stream.c
@@ -1817,8 +1817,8 @@ request_rtp_rtcp_decoder (GstElement * rtpbin, guint session,
return gst_object_ref (priv->srtpdec);
}
-static GstElement *
-request_aux_sender (GstElement * rtpbin, guint sessid, GstRTSPStream * stream)
+GstElement *
+gst_rtsp_stream_request_aux_sender (GstRTSPStream * stream, guint sessid)
{
GstElement *bin;
GstPad *pad;
@@ -1827,6 +1827,8 @@ request_aux_sender (GstElement * rtpbin, guint sessid, GstRTSPStream * stream)
guint pt, rtx_pt;
gchar *pt_s;
+ g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL);
+
pt = gst_rtsp_stream_get_pt (stream);
pt_s = g_strdup_printf ("%u", pt);
rtx_pt = stream->priv->rtx_pt;
@@ -2012,11 +2014,6 @@ gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin,
(GCallback) request_rtp_rtcp_decoder, stream);
}
- if (priv->rtx_time > 0 && priv->srcpad) {
- /* enable retransmission by setting rtprtxsend as the "aux" element of rtpbin */
- g_signal_connect (rtpbin, "request-aux-sender",
- (GCallback) request_aux_sender, stream);
- }
if (priv->sinkpad) {
g_signal_connect (rtpbin, "request-pt-map",
(GCallback) request_pt_map, stream);
diff --git a/gst/rtsp-server/rtsp-stream.h b/gst/rtsp-server/rtsp-stream.h
index d5f890c..49771c3 100644
--- a/gst/rtsp-server/rtsp-stream.h
+++ b/gst/rtsp-server/rtsp-stream.h
@@ -163,7 +163,7 @@ void gst_rtsp_stream_set_retransmission_pt (GstRTSPStream * s
guint rtx_pt);
void gst_rtsp_stream_set_pt_map (GstRTSPStream * stream, guint pt, GstCaps * caps);
-
+GstElement * gst_rtsp_stream_request_aux_sender (GstRTSPStream * stream, guint sessid);
/**
* GstRTSPStreamTransportFilterFunc:
* @stream: a #GstRTSPStream object