[vlc-devel] [PATCH] RTP output: no need to track dynamic payload types
Rémi Denis-Courmont
rdenis at simphalempin.com
Sun Sep 21 17:58:07 CEST 2008
RTP payload types distinguishes formats within a unique stream.
VLC only ever uses one format per (elementary) stream. As such, there
can be no payload format collision ever. We can use number 96 for all
dynamic payload types, and skip book-keeping. We already do this for
static payload formats (i.e. re-use the same value if there are
multiple streams).
---
modules/stream_out/rtp.c | 19 -------------------
1 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 3a1017b..5f2cb94 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -263,7 +263,6 @@ struct sout_stream_sys_t
/* */
char *psz_destination;
- uint32_t payload_bitmap;
uint16_t i_port;
uint16_t i_port_audio;
uint16_t i_port_video;
@@ -438,7 +437,6 @@ static int Open( vlc_object_t *p_this )
p_sys->b_latm = var_GetBool( p_stream, SOUT_CFG_PREFIX "mp4a-latm" );
- p_sys->payload_bitmap = 0;
p_sys->i_es = 0;
p_sys->es = NULL;
p_sys->rtsp = NULL;
@@ -851,12 +849,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
int i_port, cscov = -1;
char *psz_sdp;
- if (0xffffffff == p_sys->payload_bitmap)
- {
- msg_Err (p_stream, "too many RTP elementary streams");
- return NULL;
- }
-
id = vlc_object_create( p_stream, sizeof( sout_stream_id_t ) );
if( id == NULL )
return NULL;
@@ -894,12 +886,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id->p_stream = p_stream;
id->i_sequence = rand()&0xffff;
- /* Look for free dymanic payload type */
id->i_payload_type = 96;
- while (p_sys->payload_bitmap & (1 << (id->i_payload_type - 96)))
- id->i_payload_type++;
- assert (id->i_payload_type < 128);
-
id->ssrc[0] = rand()&0xff;
id->ssrc[1] = rand()&0xff;
id->ssrc[2] = rand()&0xff;
@@ -1247,9 +1234,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
"codec:%4.4s)", (char*)&p_fmt->i_codec );
goto error;
}
- if (id->i_payload_type >= 96)
- /* Mark dynamic payload type in use */
- p_sys->payload_bitmap |= 1 << (id->i_payload_type - 96);
if( cscov != -1 )
cscov += 8 /* UDP */ + 12 /* RTP */;
@@ -1312,9 +1296,6 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
p_sys->i_port_audio = id->i_port;
if( id->i_port == var_GetInteger( p_stream, "port-video" ) )
p_sys->i_port_video = id->i_port;
- /* Release dynamic payload type */
- if (id->i_payload_type >= 96)
- p_sys->payload_bitmap &= ~(1 << (id->i_payload_type - 96));
free( id->psz_fmtp );
--
1.5.6.5
More information about the vlc-devel
mailing list