SOURCES_gme = gme.cpp
SOURCES_tta = tta.c
SOURCES_vc1 = vc1.c
+SOURCES_rtp = rtp.c
/*****************************************************************************
* a52.c : raw A/52 stream input module for vlc
*****************************************************************************
- * Copyright (C) 2001 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
vlc_bool_t b_big_endian;
};
-static int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian );
+static int CheckSync( const uint8_t *p_peek, vlc_bool_t *p_big_endian );
#define PCM_FRAME_SIZE (1536 * 4)
#define A52_PACKET_SIZE (4 * PCM_FRAME_SIZE)
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- byte_t *p_peek;
+ const byte_t*p_peek;
int i_peek = 0;
vlc_bool_t b_big_endian = 0; /* Arbitrary initialisation */
/*****************************************************************************
* CheckSync: Check if buffer starts with an A52 sync code
*****************************************************************************/
-static int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian )
+static int CheckSync( const uint8_t *p_peek, vlc_bool_t *p_big_endian )
{
/* Little endian version of the bitstream */
if( p_peek[0] == 0x77 && p_peek[1] == 0x0b &&
/*****************************************************************************
* aiff.c: Audio Interchange File Format demuxer
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 )
return VLC_EGENERIC;
- if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) )
+ if( memcmp( p_peek, "FORM", 4 )
+ || memcmp( &p_peek[8], "AIFF", 4 ) )
return VLC_EGENERIC;
/* skip aiff header */
msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size );
- if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) )
+ if( !memcmp( p_peek, "COMM", 4 ) )
{
CHECK_PEEK_GOTO( p_peek, 18+8 );
es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
msg_Dbg( p_demux, "COMM: channels=%d samples_frames=%d bits=%d rate=%d",
GetWBE( &p_peek[8] ), GetDWBE( &p_peek[10] ), GetWBE( &p_peek[14] ), GetF80BE( &p_peek[16] ) );
}
- else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) )
+ else if( !memcmp( p_peek, "SSND", 4 ) )
{
CHECK_PEEK_GOTO( p_peek, 8+8 );
p_sys->i_ssnd_pos = stream_Tell( p_demux->s );
/*****************************************************************************
* au.c : au file input module for vlc
*****************************************************************************
- * Copyright (C) 2001-2003 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
demux_sys_t *p_sys;
uint8_t hdr[20];
- uint8_t *p_peek;
+ const uint8_t *p_peek;
int i_cat;
int i_samples, i_modulo;
/*****************************************************************************
* dts.c : raw DTS stream input module for vlc
*****************************************************************************
- * Copyright (C) 2001 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
int i_mux_rate;
};
-static int CheckSync( uint8_t *p_peek );
+static int CheckSync( const uint8_t *p_peek );
#define DTS_PACKET_SIZE 16384
#define DTS_PROBE_SIZE (DTS_PACKET_SIZE * 4)
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- byte_t * p_peek;
+ const byte_t *p_peek;
int i_peek = 0;
/* Check if we are dealing with a WAV file */
/*****************************************************************************
* CheckSync: Check if buffer starts with a DTS sync code
*****************************************************************************/
-static int CheckSync( uint8_t *p_peek )
+static int CheckSync( const uint8_t *p_peek )
{
/* 14 bits, little endian version of the bitstream */
if( p_peek[0] == 0xff && p_peek[1] == 0x1f &&
/*****************************************************************************
* flac.c : FLAC demux module for vlc
*****************************************************************************
- * Copyright (C) 2001-2003 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
#include <vlc_input.h>
#include <vlc_codec.h>
#include <assert.h>
+#include <vlc_charset.h>
/*****************************************************************************
* Module descriptor
demux_t *p_demux = (demux_t*)p_this;
module_t *p_id3;
demux_sys_t *p_sys;
- byte_t *p_peek;
+ const byte_t *p_peek;
uint8_t *p_streaminfo;
int i_streaminfo;
}
return i_length;
}
+
static int64_t ControlGetTime( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
return __MAX(p_sys->i_pts, p_sys->i_pts_start) + p_sys->i_time_offset;
}
+
static int ControlSetTime( demux_t *p_demux, int64_t i_time )
{
demux_sys_t *p_sys = p_demux->p_sys;
META_PICTURE = 6,
};
-static inline int Get24bBE( uint8_t *p )
+static inline int Get24bBE( const uint8_t *p )
{
return (p[0] << 16)|(p[1] << 8)|(p[2]);
}
static void ParseStreamInfo( demux_t *p_demux, int *pi_rate, int64_t *pi_count, uint8_t *p_data, int i_data );
-static void ParseSeekTable( demux_t *p_demux, uint8_t *p_data, int i_data, int i_sample_rate );
-static void ParseComment( demux_t *, uint8_t *p_data, int i_data );
-static void ParsePicture( demux_t *, uint8_t *p_data, int i_data );
+static void ParseSeekTable( demux_t *p_demux, const uint8_t *p_data, int i_data,
+ int i_sample_rate );
+static void ParseComment( demux_t *, const uint8_t *p_data, int i_data );
+static void ParsePicture( demux_t *, const uint8_t *p_data, int i_data );
static int ReadMeta( demux_t *p_demux, uint8_t **pp_streaminfo, int *pi_streaminfo )
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_peek;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
vlc_bool_t b_last;
int i_sample_rate;
int64_t i_sample_count;
*pi_rate = GetDWBE(&p_data[i_skip+4+6]) >> 12;
*pi_count = GetQWBE(&p_data[i_skip+4+6]) & ((I64C(1)<<36)-1);
}
-static void ParseSeekTable( demux_t *p_demux, uint8_t *p_data, int i_data, int i_sample_rate )
+
+static void ParseSeekTable( demux_t *p_demux, const uint8_t *p_data, int i_data,
+ int i_sample_rate )
{
demux_sys_t *p_sys = p_demux->p_sys;
seekpoint_t *s;
}
/* TODO sort it by size and remove wrong seek entry (time not increasing) */
}
+
static inline void astrcat( char **ppsz_dst, const char *psz_src )
{
char *psz_old = *ppsz_dst;
if( psz_old )
{
- asprintf( ppsz_dst, "%s,%s", psz_old, psz_src );
+ if( asprintf( ppsz_dst, "%s,%s", psz_old, psz_src ) == -1 )
+ *ppsz_dst = NULL;
free( psz_old );
}
else
}
#define RM(x) do { i_data -= (x); p_data += (x); } while(0)
-static void ParseComment( demux_t *p_demux, uint8_t *p_data, int i_data )
+static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data )
{
demux_sys_t *p_sys = p_demux->p_sys;
int n;
#undef RM
}
-static void ParsePicture( demux_t *p_demux, uint8_t *p_data, int i_data )
+static void ParsePicture( demux_t *p_demux, const uint8_t *p_data, int i_data )
{
static const int pi_cover_score[] = {
0, /* other */
{
/* See if it looks like a SDP
v, o, s fields are mandatory and in this order */
- uint8_t *p_peek;
+ const uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 7 ) < 7 ) return VLC_EGENERIC;
- if( memcmp( (char*)p_peek, "v=0\r\n", 5 ) &&
- memcmp( (char*)p_peek, "v=0\n", 4 ) &&
+ if( memcmp( p_peek, "v=0\r\n", 5 ) &&
+ memcmp( p_peek, "v=0\n", 4 ) &&
( p_peek[0] < 'a' || p_peek[0] > 'z' || p_peek[1] != '=' ) )
{
return VLC_EGENERIC;
/*****************************************************************************
* nsv.c: NullSoft Video demuxer.
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 8 ) < 8 )
return VLC_EGENERIC;
- if( strncmp( (char *)p_peek, "NSVf", 4 )
- && strncmp( (char *)p_peek, "NSVs", 4 ))
+ if( memcmp( p_peek, "NSVf", 4 ) && memcmp( p_peek, "NSVs", 4 ) )
{
/* In case we had force this demuxer we try to resynch */
if( strcmp( p_demux->psz_demux, "nsv" ) || ReSynch( p_demux ) )
demux_sys_t *p_sys = p_demux->p_sys;
uint8_t header[5];
- uint8_t *p_peek;
+ const uint8_t *p_peek;
int i_size;
block_t *p_frame;
return 0;
}
- if( !strncmp( (char *)p_peek, "NSVf", 4 ) )
+ if( !memcmp( p_peek, "NSVf", 4 ) )
{
if( ReadNSVf( p_demux ) )
{
return -1;
}
}
- else if( !strncmp( (char *)p_peek, "NSVs", 4 ) )
+ else if( !memcmp( p_peek, "NSVs", 4 ) )
{
if( ReadNSVs( p_demux ) )
{
}
else
{
- msg_Err( p_demux, "invalid signature 0x%x (%4.4s)", *(uint32_t*)p_peek, (char*)p_peek );
+ msg_Err( p_demux, "invalid signature 0x%x (%4.4s)", GetDWLE( p_peek ), (const char*)p_peek );
if( ReSynch( p_demux ) )
{
return -1;
*****************************************************************************/
static int ReSynch( demux_t *p_demux )
{
- uint8_t *p_peek;
+ const uint8_t *p_peek;
int i_skip;
int i_peek;
while( i_skip < i_peek - 4 )
{
- if( !strncmp( (char *)p_peek, "NSVf", 4 )
- || !strncmp( (char *)p_peek, "NSVs", 4 ) )
+ if( !memcmp( p_peek, "NSVf", 4 )
+ || !memcmp( p_peek, "NSVs", 4 ) )
{
if( i_skip > 0 )
{
static int ReadNSVf( demux_t *p_demux )
{
/* demux_sys_t *p_sys = p_demux->p_sys; */
- uint8_t *p;
+ const uint8_t *p;
int i_size;
msg_Dbg( p_demux, "new NSVf chunk" );
/*****************************************************************************
* ogg.c : ogg stream demux module for vlc
*****************************************************************************
- * Copyright (C) 2001-2003 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
demux_t *p_demux = (demux_t *)p_this;
input_thread_t *p_input;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
/* Check if we are dealing with an ogg stream */
/*****************************************************************************
* rawdv.c : raw DV input module for vlc
*****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- byte_t *p_peek, *p_peek_backup;
+ const byte_t *p_peek, *p_peek_backup;
uint32_t i_dword;
dv_header_t dv_header;
char *psz_aspect_ratio;
unsigned int i_aspect = 0;
struct preset_t *p_preset = NULL;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
vlc_bool_t b_valid = VLC_FALSE;
vlc_bool_t b_y4m = VLC_FALSE;
/*****************************************************************************
* real.c: Real demuxer.
*****************************************************************************
- * Copyright (C) 2004, 2006 the VideoLAN team
+ * Copyright (C) 2004, 2006-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 10 ) < 10 ) return VLC_EGENERIC;
- if( strncmp( (char *)p_peek, ".RMF", 4 ) ) return VLC_EGENERIC;
+ if( memcmp( p_peek, ".RMF", 4 ) ) return VLC_EGENERIC;
/* Fill p_demux field */
p_demux->pf_demux = Demux;
demux_sys_t *p_sys = p_demux->p_sys;
es_format_t fmt;
real_track_t *tk;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
msg_Dbg( p_demux, " - specific data len=%d", i_len );
if( stream_Peek(p_demux->s, &p_peek, i_len) < i_len ) return VLC_EGENERIC;
- if( !strncmp( (char *)&p_peek[4], "VIDO", 4 ) )
+ if( ( i_len >= 8 ) && !memcmp( &p_peek[4], "VIDO", 4 ) )
{
es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( p_peek[8], p_peek[9],
p_peek[10], p_peek[11] ) );
/*****************************************************************************
* wav.c : wav file input module for vlc
*****************************************************************************
- * Copyright (C) 2001-2003 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
unsigned int i_size, i_extended;
const char *psz_name;
*****************************************************************************/
static int ChunkFind( demux_t *p_demux, const char *fcc, unsigned int *pi_size )
{
- uint8_t *p_peek;
+ const uint8_t *p_peek;
for( ;; )
{