]> git.sesse.net Git - vlc/commitdiff
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 fb93f2346a27c3d069d9f5e18291d4fd1ed6eb95..2f361c101610c0bf9c1c15500f5da68d28e32bbb 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 f2665903592a72421894d143d0cf53265ad789fe..6ced6ba12f032aff0730ee16f00cf57f18ac42e5 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 e866000cd78d20d0e9231e1f2c55e638ac9e994c..8181cedaa009a4d8ef2bc59533ac9f1744d94f7c 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;