httpd_url_t *url;
const char *dst;
int ttl;
- unsigned loport, hiport;
+ uint32_t ssrc;
+ uint16_t loport, hiport;
};
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 )
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 )
id->hiport = hiport;
}
+ /* FIXME: num screws up if any ES has been removed and re-added */
snprintf( urlbuf, sizeof( urlbuf ), rtsp->track_fmt, rtsp->psz_path,
num );
msg_Dbg( rtsp->owner, "RTSP: adding %s", urlbuf );
answer->i_body = 0;
answer->p_body = NULL;
+ if( query->i_proto != HTTPD_PROTO_RTSP )
+ {
+ answer->i_status = 505;
+ }
+ else
if( httpd_MsgGet( query, "Require" ) != NULL )
{
answer->i_status = 551;
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;
ses = RtspClientGet( rtsp, psz_session );
if( ses != NULL )
{
+ /* FIXME: we really need to limit the number of tracks... */
+ char info[ses->trackc * ( strlen( control )
+ + sizeof("/trackID=123;seq=65535, ") ) + 1];
+ size_t infolen = 0;
+
for( int i = 0; i < ses->trackc; i++ )
{
rtsp_strack_t *tr = ses->trackv + i;
- if( !tr->playing
- && ( ( id == NULL ) || ( tr->id == id->sout_id ) ) )
+ if( ( id == NULL ) || ( tr->id == id->sout_id ) )
{
- tr->playing = VLC_TRUE;
- rtp_add_sink( tr->id, tr->fd, VLC_FALSE );
+ if( !tr->playing )
+ {
+ tr->playing = VLC_TRUE;
+ rtp_add_sink( tr->id, tr->fd, VLC_FALSE );
+ }
+ infolen += sprintf( info + infolen,
+ "%s/trackID=%u;seq=%u, ", control,
+ rtp_get_num( tr->id ),
+ rtp_get_seq( tr->id ) );
}
}
+ if( infolen > 0 )
+ {
+ info[infolen - 2] = '\0'; /* remove trailing ", " */
+ httpd_MsgAdd( answer, "RTP-Info", "%s", info );
+ }
}
vlc_mutex_unlock( &rtsp->lock );