}
}
+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)
{
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;
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;
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;
(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);
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