Commit 93160b29 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/demux/avi/avi.c, ./modules/demux/avi/libavi.c: additional

    endianness fixes, spelling fixes, reworked return values usage, used
    C99 types.
parent 4910755e
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc * avi.h : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.5 2002/10/27 15:37:16 fenrir Exp $ * $Id: avi.h,v 1.6 2002/11/06 14:44:30 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
typedef struct avi_packet_s typedef struct avi_packet_s
{ {
u32 i_fourcc; vlc_fourcc_t i_fourcc;
off_t i_pos; off_t i_pos;
u32 i_size; uint32_t i_size;
u32 i_type; // only for AVIFOURCC_LIST vlc_fourcc_t i_type; // only for AVIFOURCC_LIST
u8 i_peek[8]; //first 8 bytes uint8_t i_peek[8]; //first 8 bytes
int i_stream; int i_stream;
int i_cat; int i_cat;
...@@ -37,17 +37,17 @@ typedef struct avi_packet_s ...@@ -37,17 +37,17 @@ typedef struct avi_packet_s
typedef struct AVIIndexEntry_s typedef struct AVIIndexEntry_s
{ {
u32 i_id; vlc_fourcc_t i_id;
u32 i_flags; uint32_t i_flags;
u32 i_pos; uint32_t i_pos;
u32 i_length; uint32_t i_length;
u32 i_lengthtotal; uint32_t i_lengthtotal;
} AVIIndexEntry_t; } AVIIndexEntry_t;
typedef struct avi_stream_s typedef struct avi_stream_s
{ {
int i_activated; vlc_bool_t b_activated;
int i_cat; /* AUDIO_ES, VIDEO_ES */ int i_cat; /* AUDIO_ES, VIDEO_ES */
vlc_fourcc_t i_fourcc; vlc_fourcc_t i_fourcc;
...@@ -74,13 +74,13 @@ struct demux_sys_t ...@@ -74,13 +74,13 @@ struct demux_sys_t
mtime_t i_length; mtime_t i_length;
mtime_t i_pcr; mtime_t i_pcr;
int b_seekable; vlc_bool_t b_seekable;
avi_chunk_t ck_root; avi_chunk_t ck_root;
off_t i_movi_begin; off_t i_movi_begin;
off_t i_movi_lastchunk_pos; /* XXX position of last valid chunk */ off_t i_movi_lastchunk_pos; /* XXX position of last valid chunk */
/* number of stream and informations*/ /* number of streams and information */
int i_streams; int i_streams;
avi_stream_t **pp_info; avi_stream_t **pp_info;
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libavi.h : LibAVI library * libavi.h : LibAVI library
****************************************************************************** ******************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libavi.h,v 1.3 2002/11/05 23:48:46 gbazin Exp $ * $Id: libavi.h,v 1.4 2002/11/06 14:44:30 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -159,9 +159,9 @@ ...@@ -159,9 +159,9 @@
#define AVI_CHUNK_COMMON \ #define AVI_CHUNK_COMMON \
u32 i_chunk_fourcc; \ vlc_fourcc_t i_chunk_fourcc; \
u64 i_chunk_size; \ uint64_t i_chunk_size; \
u64 i_chunk_pos; \ uint64_t i_chunk_pos; \
union avi_chunk_u *p_next; \ union avi_chunk_u *p_next; \
union avi_chunk_u *p_father; \ union avi_chunk_u *p_father; \
union avi_chunk_u *p_first; \ union avi_chunk_u *p_first; \
...@@ -172,9 +172,9 @@ ...@@ -172,9 +172,9 @@
typedef struct idx1_entry_s typedef struct idx1_entry_s
{ {
vlc_fourcc_t i_fourcc; vlc_fourcc_t i_fourcc;
u32 i_flags; uint32_t i_flags;
u32 i_pos; uint32_t i_pos;
u32 i_length; uint32_t i_length;
} idx1_entry_t; } idx1_entry_t;
typedef struct avi_chunk_common_s typedef struct avi_chunk_common_s
...@@ -185,7 +185,7 @@ typedef struct avi_chunk_common_s ...@@ -185,7 +185,7 @@ typedef struct avi_chunk_common_s
typedef struct avi_chunk_list_s typedef struct avi_chunk_list_s
{ {
AVI_CHUNK_COMMON AVI_CHUNK_COMMON
u32 i_type; vlc_fourcc_t i_type;
} avi_chunk_list_t; } avi_chunk_list_t;
typedef struct avi_chunk_idx1_s typedef struct avi_chunk_idx1_s
...@@ -200,38 +200,38 @@ typedef struct avi_chunk_idx1_s ...@@ -200,38 +200,38 @@ typedef struct avi_chunk_idx1_s
typedef struct avi_chunk_avih_s typedef struct avi_chunk_avih_s
{ {
AVI_CHUNK_COMMON AVI_CHUNK_COMMON
u32 i_microsecperframe; uint32_t i_microsecperframe;
u32 i_maxbytespersec; uint32_t i_maxbytespersec;
u32 i_reserved1; /* dwPaddingGranularity; pad to multiples of this uint32_t i_reserved1; /* dwPaddingGranularity; pad to multiples of this
size; normally 2K */ size; normally 2K */
u32 i_flags; uint32_t i_flags;
u32 i_totalframes; uint32_t i_totalframes;
u32 i_initialframes; uint32_t i_initialframes;
u32 i_streams; uint32_t i_streams;
u32 i_suggestedbuffersize; uint32_t i_suggestedbuffersize;
u32 i_width; uint32_t i_width;
u32 i_height; uint32_t i_height;
u32 i_scale; uint32_t i_scale;
u32 i_rate; uint32_t i_rate;
u32 i_start; uint32_t i_start;
u32 i_length; uint32_t i_length;
} avi_chunk_avih_t; } avi_chunk_avih_t;
typedef struct avi_chunk_strh_s typedef struct avi_chunk_strh_s
{ {
AVI_CHUNK_COMMON AVI_CHUNK_COMMON
u32 i_type; vlc_fourcc_t i_type;
u32 i_handler; uint32_t i_handler;
u32 i_flags; uint32_t i_flags;
u32 i_reserved1; /* wPriority wLanguage */ uint32_t i_reserved1; /* wPriority wLanguage */
u32 i_initialframes; uint32_t i_initialframes;
u32 i_scale; uint32_t i_scale;
u32 i_rate; uint32_t i_rate;
u32 i_start; uint32_t i_start;
u32 i_length; /* In units above... */ uint32_t i_length; /* In units above... */
u32 i_suggestedbuffersize; uint32_t i_suggestedbuffersize;
u32 i_quality; uint32_t i_quality;
u32 i_samplesize; uint32_t i_samplesize;
} avi_chunk_strh_t; } avi_chunk_strh_t;
typedef struct avi_chunk_strf_auds_s typedef struct avi_chunk_strf_auds_s
...@@ -239,14 +239,14 @@ typedef struct avi_chunk_strf_auds_s ...@@ -239,14 +239,14 @@ typedef struct avi_chunk_strf_auds_s
AVI_CHUNK_COMMON AVI_CHUNK_COMMON
void *p_wfx; // waveformatex_t loaded from file void *p_wfx; // waveformatex_t loaded from file
u16 i_formattag; // + 0x00 uint16_t i_formattag; // + 0x00
u16 i_channels; // + 0x02 uint16_t i_channels; // + 0x02
u32 i_samplespersec; // + 0x04 uint32_t i_samplespersec; // + 0x04
u32 i_avgbytespersec; // + 0x08 uint32_t i_avgbytespersec; // + 0x08
u16 i_blockalign; // + 0x0c uint16_t i_blockalign; // + 0x0c
u16 i_bitspersample; // + 0x0e uint16_t i_bitspersample; // + 0x0e
u16 i_size; /* the extra size in bytes */ uint16_t i_size; /* the extra size in bytes */
u8 *p_data; uint8_t *p_data;
} avi_chunk_strf_auds_t; } avi_chunk_strf_auds_t;
typedef struct avi_chunk_strf_vids_s typedef struct avi_chunk_strf_vids_s
...@@ -264,7 +264,7 @@ typedef union avi_chunk_strf_u ...@@ -264,7 +264,7 @@ typedef union avi_chunk_strf_u
typedef struct avi_chunk_strd_s typedef struct avi_chunk_strd_s
{ {
AVI_CHUNK_COMMON AVI_CHUNK_COMMON
u8 *p_data; uint8_t *p_data;
} avi_chunk_strd_t; } avi_chunk_strd_t;
typedef struct avi_chunk_STRING_s typedef struct avi_chunk_STRING_s
...@@ -292,17 +292,17 @@ typedef union avi_chunk_u ...@@ -292,17 +292,17 @@ typedef union avi_chunk_u
int AVI_TestFile( input_thread_t *p_input ); int AVI_TestFile( input_thread_t *p_input );
/**************************************************************************** /****************************************************************************
* Stream(input) acces function * Stream(input) access functions
****************************************************************************/ ****************************************************************************/
off_t AVI_TellAbsolute( input_thread_t *p_input ); off_t AVI_TellAbsolute( input_thread_t *p_input );
int AVI_SeekAbsolute( input_thread_t *p_input, off_t i_pos); int AVI_SeekAbsolute( input_thread_t *p_input, off_t i_pos);
int AVI_ReadData( input_thread_t *p_input, u8 *p_buff, int i_size ); int AVI_ReadData( input_thread_t *p_input, uint8_t *p_buff, int i_size );
int AVI_SkipBytes( input_thread_t *p_input, int i_count ); int AVI_SkipBytes( input_thread_t *p_input, int i_count );
int _AVI_ChunkRead( input_thread_t *p_input, int _AVI_ChunkRead( input_thread_t *p_input,
avi_chunk_t *p_chk, avi_chunk_t *p_chk,
avi_chunk_t *p_father, avi_chunk_t *p_father,
int b_seekable ); vlc_bool_t b_seekable );
void _AVI_ChunkFree( input_thread_t *p_input, void _AVI_ChunkFree( input_thread_t *p_input,
avi_chunk_t *p_chk ); avi_chunk_t *p_chk );
int _AVI_ChunkGoto( input_thread_t *p_input, int _AVI_ChunkGoto( input_thread_t *p_input,
...@@ -310,12 +310,12 @@ int _AVI_ChunkGoto( input_thread_t *p_input, ...@@ -310,12 +310,12 @@ int _AVI_ChunkGoto( input_thread_t *p_input,
void _AVI_ChunkDumpDebug( input_thread_t *p_input, void _AVI_ChunkDumpDebug( input_thread_t *p_input,
avi_chunk_t *p_chk ); avi_chunk_t *p_chk );
int _AVI_ChunkCount( avi_chunk_t *p_chk, u32 i_fourcc ); int _AVI_ChunkCount( avi_chunk_t *, vlc_fourcc_t );
avi_chunk_t *_AVI_ChunkFind( avi_chunk_t *p_chk, u32 i_fourcc, int i_number ); avi_chunk_t *_AVI_ChunkFind( avi_chunk_t *, vlc_fourcc_t, int );
int AVI_ChunkReadRoot( input_thread_t *p_input, int AVI_ChunkReadRoot( input_thread_t *p_input,
avi_chunk_t *p_root, avi_chunk_t *p_root,
int b_seekable ); vlc_bool_t b_seekable );
void AVI_ChunkFreeRoot( input_thread_t *p_input, void AVI_ChunkFreeRoot( input_thread_t *p_input,
avi_chunk_t *p_chk ); avi_chunk_t *p_chk );
#define AVI_ChunkRead( p_input, p_chk, p_father, b_seekable ) \ #define AVI_ChunkRead( p_input, p_chk, p_father, b_seekable ) \
......
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