Specify SSRC in SETUP response
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 29 Sep 2007 11:20:48 +0000 (11:20 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 29 Sep 2007 11:20:48 +0000 (11:20 +0000)
modules/stream_out/rtp.c
modules/stream_out/rtp.h
modules/stream_out/rtsp.c

index fb93f23..2f361c1 100644 (file)
@@ -601,7 +601,7 @@ static void SDPHandleUrl( sout_stream_t *p_stream, char *psz_url )
         if( p_sys->p_mux != NULL )
         {
             sout_stream_id_t *id = p_sys->es[0];
-            id->rtsp_id = RtspAddId( p_sys->rtsp, id, 0,
+            id->rtsp_id = RtspAddId( p_sys->rtsp, id, 0, GetDWBE( id->ssrc ),
                                      p_sys->psz_destination, p_sys->i_ttl,
                                      id->i_port, id->i_port + 1 );
         }
@@ -1143,6 +1143,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
 
     if( p_sys->rtsp != NULL )
         id->rtsp_id = RtspAddId( p_sys->rtsp, id, p_sys->i_es,
+                                 GetDWBE( id->ssrc ),
                                  p_sys->psz_destination,
                                  p_sys->i_ttl, id->i_port, id->i_port + 1 );
 
index f266590..6ced6ba 100644 (file)
@@ -29,7 +29,7 @@ rtsp_stream_t *RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url );
 void RtspUnsetup( rtsp_stream_t *rtsp );
 
 rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
-                             unsigned i,
+                             unsigned i, uint32_t ssrc,
                              const char *dst, int ttl,
                              unsigned loport, unsigned hiport );
 void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t * );
index e866000..8181ced 100644 (file)
@@ -144,7 +144,8 @@ struct rtsp_stream_id_t
     httpd_url_t      *url;
     const char       *dst;
     int               ttl;
-    unsigned          loport, hiport;
+    uint32_t          ssrc;
+    uint16_t          loport, hiport;
 };
 
 
@@ -172,7 +173,7 @@ struct rtsp_strack_t
 
 
 rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
-                             unsigned num,
+                             unsigned num, uint32_t ssrc,
                              /* Multicast stuff - TODO: cleanup */
                              const char *dst, int ttl,
                              unsigned loport, unsigned hiport )
@@ -186,6 +187,7 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
 
     id->stream = rtsp;
     id->sout_id = sid;
+    id->ssrc = ssrc;
     /* TODO: can we assume that this need not be strdup'd? */
     id->dst = dst;
     if( id->dst != NULL )
@@ -569,17 +571,18 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                         httpd_MsgAdd( answer, "Transport",
                                       "RTP/AVP/UDP;unicast;source=%s;"
                                       "client_port=%u-%u;server_port=%u-%u;"
-                                      "mode=play",
+                                      "ssrc=%08X;mode=play",
                                       src, loport, loport + 1, sport,
-                                      sport + 1 );
+                                      sport + 1, id->ssrc );
                     }
                     else
                     {
                         httpd_MsgAdd( answer, "Transport",
                                       "RTP/AVP/UDP;unicast;"
                                       "client_port=%u-%u;server_port=%u-%u;"
-                                      "mode=play",
-                                      loport, loport + 1, sport, sport + 1 );
+                                      "ssrc=%08X;mode=play",
+                                      loport, loport + 1, sport, sport + 1,
+                                      id->ssrc );
                     }
 
                     answer->i_status = 200;