net_Close( sink.rtp_fd );
}
+uint16_t rtp_get_seq( const sout_stream_id_t *id )
+{
+ /* This will return values for the next packet.
+ * Accounting for caching would not be totally trivial. */
+ return id->i_sequence;
+}
+
+/* FIXME: this is pretty bad - if we remove and then insert an ES
+ * the number will get unsynched from inside RTSP */
+unsigned rtp_get_num( const sout_stream_id_t *id )
+{
+ sout_stream_sys_t *p_sys = id->p_stream->p_sys;
+ int i;
+
+ vlc_mutex_lock( &p_sys->lock_es );
+ for( i = 0; i < p_sys->i_es; i++ )
+ {
+ if( id == p_sys->es[i] )
+ break;
+ }
+ vlc_mutex_unlock( &p_sys->lock_es );
+
+ return i;
+}
+
+
/****************************************************************************
* rtp_packetize_*:
****************************************************************************/
int rtp_add_sink( sout_stream_id_t *id, int fd, vlc_bool_t rtcp_mux );
void rtp_del_sink( sout_stream_id_t *id, int fd );
+uint16_t rtp_get_seq( const sout_stream_id_t *id );
+unsigned rtp_get_num( const sout_stream_id_t *id );
/* RTCP */
typedef struct rtcp_sender_t rtcp_sender_t;
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 );
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 );