Commit 30c09ef4 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: libmp4: constify counters/walkers

parent 455153a8
...@@ -4155,10 +4155,10 @@ error: ...@@ -4155,10 +4155,10 @@ error:
} }
static void MP4_BoxDumpStructure_Internal( stream_t *s, static void MP4_BoxDumpStructure_Internal( stream_t *s, const MP4_Box_t *p_box,
MP4_Box_t *p_box, unsigned int i_level ) unsigned int i_level )
{ {
MP4_Box_t *p_child; const MP4_Box_t *p_child;
uint32_t i_displayedtype = p_box->i_type; uint32_t i_displayedtype = p_box->i_type;
if( ! MP4_BOX_TYPE_ASCII() ) ((char*)&i_displayedtype)[0] = 'c'; if( ! MP4_BOX_TYPE_ASCII() ) ((char*)&i_displayedtype)[0] = 'c';
...@@ -4194,7 +4194,7 @@ static void MP4_BoxDumpStructure_Internal( stream_t *s, ...@@ -4194,7 +4194,7 @@ static void MP4_BoxDumpStructure_Internal( stream_t *s,
} }
} }
void MP4_BoxDumpStructure( stream_t *s, MP4_Box_t *p_box ) void MP4_BoxDumpStructure( stream_t *s, const MP4_Box_t *p_box )
{ {
MP4_BoxDumpStructure_Internal( s, p_box, 0 ); MP4_BoxDumpStructure_Internal( s, p_box, 0 );
} }
...@@ -4250,8 +4250,8 @@ static void get_token( char **ppsz_path, char **ppsz_token, int *pi_number ) ...@@ -4250,8 +4250,8 @@ static void get_token( char **ppsz_path, char **ppsz_token, int *pi_number )
} }
} }
static void MP4_BoxGet_Internal( MP4_Box_t **pp_result, static void MP4_BoxGet_Internal( const MP4_Box_t **pp_result, const MP4_Box_t *p_box,
MP4_Box_t *p_box, const char *psz_fmt, va_list args) const char *psz_fmt, va_list args)
{ {
char *psz_dup; char *psz_dup;
char *psz_path; char *psz_path;
...@@ -4384,16 +4384,16 @@ error_box: ...@@ -4384,16 +4384,16 @@ error_box:
* ex: /moov/trak[12] * ex: /moov/trak[12]
* ../mdia * ../mdia
*****************************************************************************/ *****************************************************************************/
MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... ) MP4_Box_t *MP4_BoxGet( const MP4_Box_t *p_box, const char *psz_fmt, ... )
{ {
va_list args; va_list args;
MP4_Box_t *p_result; const MP4_Box_t *p_result;
va_start( args, psz_fmt ); va_start( args, psz_fmt );
MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args ); MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args );
va_end( args ); va_end( args );
return( p_result ); return( (MP4_Box_t *) p_result );
} }
/***************************************************************************** /*****************************************************************************
...@@ -4405,11 +4405,11 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... ) ...@@ -4405,11 +4405,11 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... )
* ex: /moov/trak[12] * ex: /moov/trak[12]
* ../mdia * ../mdia
*****************************************************************************/ *****************************************************************************/
unsigned MP4_BoxCount( MP4_Box_t *p_box, const char *psz_fmt, ... ) unsigned MP4_BoxCount( const MP4_Box_t *p_box, const char *psz_fmt, ... )
{ {
va_list args; va_list args;
unsigned i_count; unsigned i_count;
MP4_Box_t *p_result, *p_next; const MP4_Box_t *p_result, *p_next;
va_start( args, psz_fmt ); va_start( args, psz_fmt );
MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args ); MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args );
......
...@@ -1674,7 +1674,7 @@ void MP4_BoxFree( stream_t *, MP4_Box_t *p_box ); ...@@ -1674,7 +1674,7 @@ void MP4_BoxFree( stream_t *, MP4_Box_t *p_box );
***************************************************************************** *****************************************************************************
* Useful while debugging * Useful while debugging
*****************************************************************************/ *****************************************************************************/
void MP4_BoxDumpStructure( stream_t *p_input, MP4_Box_t *p_box ); void MP4_BoxDumpStructure( stream_t *p_input, const MP4_Box_t *p_box );
/***************************************************************************** /*****************************************************************************
* MP4_BoxGet: find a box given a path relative to p_box * MP4_BoxGet: find a box given a path relative to p_box
...@@ -1685,7 +1685,7 @@ void MP4_BoxDumpStructure( stream_t *p_input, MP4_Box_t *p_box ); ...@@ -1685,7 +1685,7 @@ void MP4_BoxDumpStructure( stream_t *p_input, MP4_Box_t *p_box );
* ex: /moov/trak[12] * ex: /moov/trak[12]
* ../mdia * ../mdia
*****************************************************************************/ *****************************************************************************/
MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... ); MP4_Box_t *MP4_BoxGet( const MP4_Box_t *p_box, const char *psz_fmt, ... );
/***************************************************************************** /*****************************************************************************
* MP4_BoxCount: find number of box given a path relative to p_box * MP4_BoxCount: find number of box given a path relative to p_box
...@@ -1696,7 +1696,7 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... ); ...@@ -1696,7 +1696,7 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... );
* ex: /moov/trak * ex: /moov/trak
* ../mdia * ../mdia
*****************************************************************************/ *****************************************************************************/
unsigned MP4_BoxCount( MP4_Box_t *p_box, const char *psz_fmt, ... ); unsigned MP4_BoxCount( const MP4_Box_t *p_box, const char *psz_fmt, ... );
/* Internal functions exposed for MKV demux */ /* Internal functions exposed for MKV demux */
int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box ); int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment