set_capability( "sout access", 100 );
add_shortcut( "udp" );
- add_shortcut( "rtp" ); // Will work only with ts muxer
set_callbacks( Open, Close );
vlc_module_end();
struct sout_access_out_sys_t
{
int i_mtu;
-
- vlc_bool_t b_rtpts; // true for RTP/MP2 encapsulation
vlc_bool_t b_mtu_warning;
- uint16_t i_sequence_number;
- uint32_t i_ssrc;
block_t *p_buffer;
}
p_access->p_sys = p_sys;
- if( p_access->psz_access != NULL )
- {
- if (strcmp (p_access->psz_access, "rtp") == 0)
- p_sys->b_rtpts = VLC_TRUE;
- }
-
if (var_GetBool (p_access, SOUT_CFG_PREFIX"lite"))
{
protoname = "UDP-Lite";
var_GetInteger( p_access, SOUT_CFG_PREFIX "group" );
p_sys->i_mtu = var_CreateGetInteger( p_this, "mtu" );
- if( p_sys->b_rtpts && ( p_sys->i_mtu < RTP_HEADER_LENGTH ) )
- p_sys->i_mtu = 576 - 20 - 8;
-
- srand( (uint32_t)mdate());
- p_sys->p_buffer = NULL;
- p_sys->i_sequence_number = rand()&0xffff;
- p_sys->i_ssrc = rand()&0xffffffff;
+ p_sys->p_buffer = NULL;
if (i_rtcp_port && OpenRTCP (VLC_OBJECT (p_access), &p_sys->p_thread->rtcp,
i_handle, proto, i_rtcp_port))
while( p_buffer->i_buffer )
{
int i_payload_size = p_sys->i_mtu;
- if( p_sys->b_rtpts )
- i_payload_size -= RTP_HEADER_LENGTH;
int i_write = __MIN( p_buffer->i_buffer, i_payload_size );
p_buffer->i_dts = i_dts;
p_buffer->i_buffer = 0;
- if( p_sys->b_rtpts )
- {
- mtime_t i_timestamp = p_buffer->i_dts * 9 / 100;
-
- /* add rtp/ts header */
- p_buffer->p_buffer[0] = 0x80;
- p_buffer->p_buffer[1] = 33; // mpeg2-ts
-
- SetWBE( p_buffer->p_buffer + 2, p_sys->i_sequence_number );
- p_sys->i_sequence_number++;
- SetDWBE( p_buffer->p_buffer + 4, i_timestamp );
- SetDWBE( p_buffer->p_buffer + 8, p_sys->i_ssrc );
-
- p_buffer->i_buffer = RTP_HEADER_LENGTH;
- }
-
return p_buffer;
}
if( psz_url && strrchr( psz_url, '.' ) )
{
/* by extension */
- static struct { const char *ext; const char *mux; } exttomux[] =
+ static struct { const char ext[6]; const char mux[16]; } exttomux[] =
{
{ "avi", "avi" },
{ "ogg", "ogg" },
{ "mpeg","ps" },
{ "ps", "ps" },
{ "mpeg1","mpeg1" },
- { "wav","wav" },
+ { "wav", "wav" },
{ "flv", "ffmpeg{mux=flv}" },
- { NULL, NULL }
+ { "", "" }
};
const char *psz_ext = strrchr( psz_url, '.' ) + 1;
int i;
msg_Dbg( p_this, "extension is %s", psz_ext );
- for( i = 0; exttomux[i].ext != NULL; i++ )
+ for( i = 0; exttomux[i].ext[0]; i++ )
{
if( !strcasecmp( psz_ext, exttomux[i].ext ) )
{