Commit 4d243c1d authored by Jean-Paul Saman's avatar Jean-Paul Saman

Rewrote internal RTCP to support multiple client connections. TODO: rtcp...

Rewrote internal RTCP to support multiple client connections. TODO: rtcp scheduling function, server socket, hooking it up with RTP stream_out connections.
parent cec120d5
......@@ -1448,6 +1448,7 @@ then
VLC_ADD_PLUGINS([stream_out_dummy stream_out_standard stream_out_es stream_out_rtp stream_out_description vod_rtsp])
VLC_ADD_PLUGINS([stream_out_duplicate stream_out_gather stream_out_display stream_out_transcode stream_out_bridge stream_out_mosaic_bridge stream_out_autodel])
# VLC_ADD_PLUGINS([stream_out_transrate])
VLC_ADD_PLUGINS([rtcp])
VLC_ADD_PLUGINS([profile_parser])
AC_DEFINE(ENABLE_SOUT, 1, Define if you want the stream output support)
......
SOURCES_rtcp = rtcp.c rtcp.h rtp.h
SOURCES_rtcp = rtcp.c rtcp.h rtp.h
......@@ -22,9 +22,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/time.h>
#include <sys/time.h>
#include <vlc/vlc.h>
#include <vlc_bits.h>
......@@ -33,152 +33,576 @@
#include "rtp.h"
#include "rtcp.h"
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_block );
static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer );
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer );
static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer );
static int rtcp_decode_BYE( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer );
static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer );
static void send_RTCP( vlc_object_t *p_this, rtcp_event_t rtcp_event )
{
/* FIXME: higher level functions that should be in another file */
}
static void rtcp_schedule( vlc_object_t *p_this, uint64_t i_sched, rtcp_event_t rtcp_event )
{
/* FIXME: higher level functions that should be in another file */
}
/* SDES support functions */
static int SDES_client_item_add( rtcp_client_t *p_client, int i_item, char *psz_name )
{
rtcp_SDES_item_t *p_item = NULL;
p_item = (rtcp_SDES_item_t *) malloc( sizeof( rtcp_SDES_item_t ) );
if( !p_item )
return VLC_EGENERIC;
p_item->u_type = i_item;
p_item->psz_data = strdup( psz_name );
p_item->i_index = p_client->i_items + 1;;
INSERT_ELEM( p_client->pp_sdes, p_client->i_items,
p_item->i_index, p_item );
return VLC_EGENERIC;
}
static int SDES_client_item_del( rtcp_client_t *p_client )
{
uint32_t i = 0;
for( i=0; i < p_client->i_items; i++ )
{
rtcp_SDES_item_t *p_old = p_client->pp_sdes[i];
REMOVE_ELEM( p_client->pp_sdes, p_client->i_items, i );
p_client->i_items--;
if( p_old->psz_data)
free( p_old->psz_data );
free( p_old );
}
return VLC_SUCCESS;
}
int rtcp_add_client( vlc_object_t *p_this, uint32_t u_ssrc, uint32_t *i_pos )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
rtcp_client_t *p_client = NULL;
vlc_mutex_lock( &p_rtcp->object_lock );
p_client = (rtcp_client_t*) malloc( sizeof(rtcp_client_t) );
if( !p_client )
return VLC_EGENERIC;
p_client->i_index = p_rtcp->i_clients + 1;
p_client->b_deleted = VLC_FALSE;
*i_pos = p_client->i_index ;
INSERT_ELEM( p_rtcp->pp_clients, p_rtcp->i_clients,
p_client->i_index, p_client );
p_rtcp->i_clients++;
p_rtcp->u_clients++;
vlc_mutex_unlock( &p_rtcp->object_lock );
return VLC_SUCCESS;
}
int rtcp_del_client( vlc_object_t *p_this, uint32_t u_ssrc )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
uint32_t i_pos = 0;
vlc_mutex_lock( &p_rtcp->object_lock );
if( p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos ) == VLC_SUCCESS )
{
rtcp_client_t *p_old = p_rtcp->pp_clients[i_pos];
p_old->b_deleted = VLC_TRUE;
p_old->i_timeout = 5 * (p_rtcp->i_date - p_rtcp->i_last_date) +
p_rtcp->i_next_date;
p_rtcp->u_clients--;
}
vlc_mutex_unlock( &p_rtcp->object_lock );
return VLC_SUCCESS;
}
/* rtcp_cleanup_clients should not be called too often */
int rtcp_cleanup_clients( vlc_object_t *p_this )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
uint32_t i = 0;
vlc_mutex_lock( &p_rtcp->object_lock );
for( i=0; i < p_rtcp->i_clients; i++ )
{
rtcp_client_t *p_old = p_rtcp->pp_clients[i];
if( p_old->b_deleted &&
(p_old->i_timeout > mdate()) )
{
REMOVE_ELEM( p_rtcp->pp_clients, p_rtcp->i_clients, i );
p_rtcp->i_clients--;
SDES_client_item_del( p_old );
free( p_old );
}
}
vlc_mutex_unlock( &p_rtcp->object_lock );
return VLC_SUCCESS;
}
/* rtcp_find_client should be called with the object lock held.
* vlc_mutex_lock( &p_rtcp->obj_lock );
*/
int rtcp_find_client( vlc_object_t *p_this, uint32_t u_ssrc, uint32_t *i_pos )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
uint32_t i = 0;
for( i=0; i < p_rtcp->i_clients; i++ )
{
if( p_rtcp->pp_clients[i]->u_ssrc == u_ssrc )
{
*i_pos = i;
return VLC_SUCCESS;
}
}
*i_pos = -1;
return VLC_EGENERIC;
}
/*--------------------------------------------------------------------------
* rtcp_interval - Calculate the interval in seconds for sending RTCP packets.
*--------------------------------------------------------------------------
*/
uint64_t rtcp_interval( vlc_object_t *p_this, uint64_t u_bandwidth,
vlc_bool_t b_sender, vlc_bool_t b_first )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
rtcp_client_t *p_client = NULL;
uint32_t i_rtcp_min = 5; /* seconds */
uint32_t i_pos = 0;
double i_bandwidth = u_bandwidth;
const double i_compensation = 2.71828 - 1.5;
double i_interval = 0;
int n = p_rtcp->i_clients;
int u_ssrc = 0; /* FIXME: how to know which client we look for?? */
if( b_first )
i_rtcp_min = (i_rtcp_min >> 1);
if( (double)(p_rtcp->u_active) <= (double)(p_rtcp->u_clients * 0.25) )
{
if( b_sender )
{
i_bandwidth = i_bandwidth * 0.25;
n = p_rtcp->u_active;
}
else
{
i_bandwidth = i_bandwidth * ( 1 - 0.25 );
n = n - p_rtcp->u_active;
}
}
/* calculate average time between reports */
p_client = p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos );
if( !p_client )
return -1;
i_interval = p_client->p_stats->u_avg_pkt_size * ( n / i_bandwidth );
if( i_interval < i_rtcp_min )
i_interval = i_rtcp_min;
i_interval = i_interval * ( drand48() + 0.5 );
i_interval = (double) (i_interval / i_compensation);
return (uint64_t)i_interval;
}
/*--------------------------------------------------------------------------
* rtcp_expire - decides to sent an RTCP report or a BYE record
*--------------------------------------------------------------------------
*/
void rtcp_expire( vlc_object_t *p_this, rtcp_event_t rtcp_event,
uint64_t u_bandwidth, vlc_bool_t b_sender, vlc_bool_t *b_first )
{
rtcp_t *p_rtcp = (rtcp_t *) p_this;
rtcp_client_t *p_client = NULL;
rtcp_stats_t *p_stats = NULL;
mtime_t i_interval = 0;
uint32_t i_pos = 0;
int u_ssrc = 0; /* FIXME: how to know which client we look for?? */
p_client = p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos );
if( !p_client )
return;
p_stats = (rtcp_stats_t*) p_client->p_stats;
i_interval = (mtime_t) rtcp_interval( p_this, u_bandwidth,
b_sender, *b_first );
p_rtcp->i_next_date = p_rtcp->i_last_date + i_interval;
switch( rtcp_event )
{
case EVENT_BYE:
if( p_rtcp->i_next_date <= p_rtcp->i_date )
send_RTCP( p_this, rtcp_event );
else
rtcp_schedule( p_this, p_rtcp->i_next_date, rtcp_event );
break;
static block_t *rtcp_encode_SR( vlc_object_t *p_this, rtcp_t *p_rtcp );
static block_t *rtcp_encode_RR( vlc_object_t *p_this, rtcp_t *p_rtcp );
static block_t *rtcp_encode_SDES( vlc_object_t *p_this, rtcp_t *p_rtcp );
static block_t *rtcp_encode_BYE( vlc_object_t *p_this, rtcp_t *p_rtcp );
case EVENT_REPORT:
if( p_rtcp->i_next_date <= p_rtcp->i_date )
{
send_RTCP( p_this, rtcp_event );
/* Magic numbers are from RFC 3550 page 92
* 1.0/16.0 = 0.0625 and
* 15.0/16.0 = 0.9375
*/
p_stats->u_avg_pkt_size = (uint64_t)
( (double) ( (double)p_stats->u_sent_pkt_size / ((double)0.0625) ) +
( ((double)0.9357) * p_stats->u_avg_pkt_size ) );
/* recalculate */
p_rtcp->i_last_date = p_rtcp->i_date;
i_interval = rtcp_interval( p_this, u_bandwidth,
b_sender, *b_first );
rtcp_schedule( p_this, p_rtcp->i_next_date + i_interval, rtcp_event );
*b_first = VLC_FALSE;
}
else
{
rtcp_schedule( p_this, p_rtcp->i_next_date, rtcp_event );
}
break;
}
p_rtcp->i_date = p_rtcp->i_next_date;
}
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer )
/*--------------------------------------------------------------------------
* Local functions prototoypes
*--------------------------------------------------------------------------
*/
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
static int rtcp_decode_BYE( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_pkt_t *p_pkt );
/*--------------------------------------------------------------------------
* Local functions
*--------------------------------------------------------------------------
*/
static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
{
unsigned int u_ssrc_count;
rtcp_t *p_rtcp = (rtcp_t *) p_this;
unsigned int i = 0;
if( !p_rtcp && !p_buffer )
if( !p_pkt )
return VLC_EGENERIC;
msg_Dbg( p_this, "decoding record: SR" );
p_rtcp->stats.u_SR_received++;
p_rtcp->stats.u_pkt_count = p_buffer[20+RTCP_HEADER_LEN];
p_rtcp->stats.u_octet_count = p_buffer[24+RTCP_HEADER_LEN];
u_ssrc_count = p_buffer[RTCP_HEADER_LEN] & 0x1f;
msg_Dbg( p_this, "SR received %d, packet count %d, octect count %d, SSRC count %d",
p_rtcp->stats.u_SR_received,
p_rtcp->stats.u_pkt_count,
p_rtcp->stats.u_octet_count,
u_ssrc_count );
for( i=0; i < u_ssrc_count; i++ )
/* parse sender info */
p_pkt->u_payload_type = RTCP_SR;
p_pkt->report.sr.ntp_timestampH = bs_read( p_rtcp->bs, 32 );
p_pkt->report.sr.ntp_timestampL = bs_read( p_rtcp->bs, 32 );
p_pkt->report.sr.rtp_timestamp = bs_read( p_rtcp->bs, 32 );
p_pkt->report.sr.u_pkt_count = bs_read( p_rtcp->bs, 32 ); /*sender*/
p_pkt->report.sr.u_octet_count = bs_read( p_rtcp->bs, 32 ); /*sender*/
/* parse report block */
for( i=0; i < p_pkt->u_report; i++ )
{
unsigned char count[4];
p_rtcp->stats.u_fract_lost = p_buffer[32+RTCP_HEADER_LEN];
count[0] = 0;
count[1] = p_buffer[33+RTCP_HEADER_LEN];
count[2] = p_buffer[34+RTCP_HEADER_LEN];
count[3] = p_buffer[35+RTCP_HEADER_LEN];
/* FIXME: I don't like the sight of this */
p_rtcp->stats.u_pkt_lost = ntohl((int)count);
p_rtcp->stats.u_highest_seq_no = ntohl( p_buffer[36+RTCP_HEADER_LEN] );
p_rtcp->stats.u_jitter = ntohl( p_buffer[40+RTCP_HEADER_LEN] );
p_rtcp->stats.u_last_SR = ntohl( p_buffer[44+RTCP_HEADER_LEN] );
p_rtcp->stats.u_delay_since_last_SR = (mtime_t) ntohl( p_buffer[48+RTCP_HEADER_LEN] );
msg_Dbg( p_this, "fract lost %d, packet lost %d, highest seqno %d, jitter %d, last SR %d, delay %lld",
p_rtcp->stats.u_fract_lost,
p_rtcp->stats.u_pkt_lost,
p_rtcp->stats.u_highest_seq_no,
p_rtcp->stats.u_jitter,
p_rtcp->stats.u_last_SR,
p_rtcp->stats.u_delay_since_last_SR );
rtcp_client_t *p_client = NULL;
uint32_t i_pos = 0;
uint32_t u_ssrc = 0;
int result = 0;
u_ssrc = bs_read( p_rtcp->bs, 32 );
result = p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
{
result = p_rtcp->pf_add_client( p_this, p_pkt->u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
return VLC_ENOMEM;
}
vlc_mutex_lock( &p_rtcp->object_lock );
p_client = p_rtcp->pp_clients[i_pos];
p_client->p_stats->u_SR_received++;
p_client->p_stats->u_pkt_count++;
p_client->p_stats->u_octet_count++;
msg_Dbg( p_this, "SR received %d, packet count %d, octect count %d, SSRC count %d",
p_client->p_stats->u_SR_received,
p_client->p_stats->u_pkt_count,
p_client->p_stats->u_octet_count,
p_pkt->u_ssrc );
p_client->p_stats->u_fraction_lost = bs_read( p_rtcp->bs, 8 );
p_client->p_stats->u_pkt_lost = bs_read( p_rtcp->bs, 24 );
p_client->p_stats->u_highest_seq_no = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_jitter = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_last_SR = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_delay_since_last_SR = (mtime_t) bs_read( p_rtcp->bs, 32 );
/* Magic numbers are from RFC 3550 page 92
* 1.0/16.0 = 0.0625 and
* 15.0/16.0 = 0.9375
*/
p_client->p_stats->u_avg_pkt_size = (uint64_t)
( (double)((double)p_client->p_stats->u_sent_pkt_size * (double)(0.0625)) +
((double)(0.9375) * p_client->p_stats->u_avg_pkt_size) );
msg_Dbg( p_this, "fract lost %d, packet lost %d, highest seqno %d, "
"jitter %d, last SR %d, delay %lld",
p_client->p_stats->u_fraction_lost,
p_client->p_stats->u_pkt_lost,
p_client->p_stats->u_highest_seq_no,
p_client->p_stats->u_jitter,
p_client->p_stats->u_last_SR,
p_client->p_stats->u_delay_since_last_SR );
p_client = NULL;
vlc_mutex_unlock( &p_rtcp->object_lock );
}
return VLC_SUCCESS;
}
static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer )
static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
{
unsigned int u_ssrc_count;
rtcp_t *p_rtcp = (rtcp_t *) p_this;
unsigned int i = 0;
if( !p_rtcp && !p_buffer )
if( !p_pkt )
return VLC_EGENERIC;
msg_Dbg( p_this, "decoding record: RR" );
p_rtcp->stats.u_RR_received++;
u_ssrc_count = (p_buffer[RTCP_HEADER_LEN] & 0x1f);
msg_Dbg( p_this, "RR received %d, SSRC count %d", p_rtcp->stats.u_RR_received, u_ssrc_count );
for( i=0; i < u_ssrc_count; i++ )
for( i=0; i < p_pkt->u_report; i++ )
{
unsigned char count[4];
p_rtcp->stats.u_fract_lost = p_buffer[12+RTCP_HEADER_LEN];
count[0] = 0;
count[1] = p_buffer[13+RTCP_HEADER_LEN];
count[2] = p_buffer[14+RTCP_HEADER_LEN];
count[3] = p_buffer[15+RTCP_HEADER_LEN];
/* FIXME: I don't like the sight of this */
p_rtcp->stats.u_pkt_lost = ntohl((int)count);
p_rtcp->stats.u_highest_seq_no = ntohl( p_buffer[16+RTCP_HEADER_LEN] );
p_rtcp->stats.u_jitter = ntohl( p_buffer[20+RTCP_HEADER_LEN] );
p_rtcp->stats.u_last_RR = ntohl( p_buffer[24+RTCP_HEADER_LEN] );
p_rtcp->stats.u_delay_since_last_RR = (mtime_t) ntohl( p_buffer[28+RTCP_HEADER_LEN] );
msg_Dbg( p_this, "fract lost %d, packet lost %d, highest seqno %d, jitter %d, last RR %d, delay %lld",
p_rtcp->stats.u_fract_lost,
p_rtcp->stats.u_pkt_lost,
p_rtcp->stats.u_highest_seq_no,
p_rtcp->stats.u_jitter,
p_rtcp->stats.u_last_RR,
p_rtcp->stats.u_delay_since_last_RR );
rtcp_client_t *p_client = NULL;
uint32_t i_pos = 0;
uint32_t u_ssrc = 0;
int result = 0;
u_ssrc = bs_read( p_rtcp->bs, 32 );
result = p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
{
result = p_rtcp->pf_add_client( p_this, p_pkt->u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
return VLC_ENOMEM;
}
vlc_mutex_lock( &p_rtcp->object_lock );
p_client = p_rtcp->pp_clients[i_pos];
p_client->p_stats->u_RR_received++;
msg_Dbg( p_this, "RR received %d, SSRC %d",
p_client->p_stats->u_RR_received, u_ssrc );
p_client->p_stats->u_fraction_lost = bs_read( p_rtcp->bs, 8 );
p_client->p_stats->u_pkt_lost = bs_read( p_rtcp->bs, 24 );
p_client->p_stats->u_highest_seq_no = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_jitter = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_last_SR = bs_read( p_rtcp->bs, 32 );
p_client->p_stats->u_delay_since_last_SR = (mtime_t) bs_read( p_rtcp->bs, 32 );
/* Magic numbers are from RFC 3550 page 92
* 1.0/16.0 = 0.0625 and
* 15.0/16.0 = 0.9375
*/
p_client->p_stats->u_avg_pkt_size = (uint64_t)
( (double)((double)p_client->p_stats->u_sent_pkt_size * (double)(0.0625)) +
((double)(0.9375) * p_client->p_stats->u_avg_pkt_size) );
msg_Dbg( p_this, "fract lost %d, packet lost %d, highest seqno %d, "
"jitter %d, last SR %d, delay %lld",
p_client->p_stats->u_fraction_lost,
p_client->p_stats->u_pkt_lost,
p_client->p_stats->u_highest_seq_no,
p_client->p_stats->u_jitter,
p_client->p_stats->u_last_SR,
p_client->p_stats->u_delay_since_last_SR );
p_client = NULL;
vlc_mutex_unlock( &p_rtcp->object_lock );
}
return VLC_SUCCESS;
}
static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_t *p_rtcp, uint8_t *p_buffer )
static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
{
if( !p_rtcp && !p_buffer )
rtcp_t *p_rtcp = (rtcp_t *) p_this;
unsigned int i = 0;
if( !p_pkt )
return VLC_EGENERIC;
msg_Dbg( p_this, "decoding record: SDES" );
switch( p_buffer[8] )
for( i = 0; i < p_pkt->u_report; i++ )
{
case RTCP_INFO_CNAME:
p_rtcp->stats.l_dest_SSRC = ntohs( (int)(p_buffer[4+RTCP_HEADER_LEN]) );
break;
case RTCP_INFO_NAME:
case RTCP_INFO_EMAIL:
case RTCP_INFO_PHONE:
case RTCP_INFO_LOC:
case RTCP_INFO_TOOL:
case RTCP_INFO_NOTE:
case RTCP_INFO_PRIV: /* ignoring these */
break;
default:
return VLC_EGENERIC;
rtcp_client_t *p_client = NULL;
uint32_t i_pos = 0;
uint32_t u_ssrc = 0;
uint8_t u_item = 0;
uint8_t u_length = 0;
int i = 0;
int result = 0;
u_ssrc = bs_read( p_rtcp->bs, 32 );
result = p_rtcp->pf_find_client( p_this, u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
{
result = p_rtcp->pf_add_client( p_this, p_pkt->u_ssrc, &i_pos );
if( result == VLC_EGENERIC )
return VLC_ENOMEM;
}
vlc_mutex_lock( &p_rtcp->object_lock );
p_client = p_rtcp->pp_clients[i_pos];
u_item = bs_read( p_rtcp->bs, 8 );
switch( u_item )
{
case RTCP_SDES_CNAME:
case RTCP_SDES_NAME:
case RTCP_SDES_EMAIL:
case RTCP_SDES_PHONE:
case RTCP_SDES_LOC:
case RTCP_SDES_TOOL:
case RTCP_SDES_NOTE:
{
char psz_name[255];
u_length = bs_read( p_rtcp->bs, 8 );
for( i = 0 ; i < u_length; i++ )
{
psz_name[i] = bs_read( p_rtcp->bs, 8 );
}
SDES_client_item_add( p_client, u_item, psz_name );
}
break;
case RTCP_SDES_PRIV: /* ignoring these */
{
uint8_t u_prefix_len = 0;
uint8_t u_length = 0;
char psz_prefix_name[255];
char psz_name[255];
u_length = bs_read( p_rtcp->bs, 8 );
u_prefix_len = bs_read( p_rtcp->bs, 8 );
if( u_prefix_len > 254 )
u_prefix_len = 254;
for( i=0 ; i < u_prefix_len; i++ )
{
psz_prefix_name[i] = bs_read( p_rtcp->bs, 8 );
}
psz_prefix_name[255] = '\0';
SDES_client_item_add( p_client, u_item, psz_prefix_name );
for( i=0 ; i < u_length; i++ )
{
psz_name[i] = bs_read( p_rtcp->bs, 8 );
}
psz_name[255] = '\0';
SDES_client_item_add( p_client, u_item, psz_name );
}
break;
default:
return VLC_EGENERIC;
}
/* Magic numbers are from RFC 3550 page 92
* 1.0/16.0 = 0.0625 and
* 15.0/16.0 = 0.9375
*/