libgpac
Documentation of the core library of GPAC
avilib.h File Reference
#include <gpac/tools.h>
+ Include dependency graph for avilib.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  video_index_entry
 
struct  audio_index_entry
 
struct  avisuperindex_entry
 
struct  avistdindex_entry
 
struct  avistdindex_chunk
 
struct  avisuperindex_chunk
 
struct  track_t
 
struct  alBITMAPINFOHEADER
 
struct  alWAVEFORMATEX
 
struct  alAVISTREAMHEADER
 
struct  avi_t
 
struct  riff_struct
 
struct  chunk_struct
 
struct  common_struct
 
struct  wave_header
 
struct  AVIStreamHeader
 

Macros

#define AVI_MAX_TRACKS   8
 
#define AVI_INDEX_OF_INDEXES   0x00
 
#define AVI_INDEX_OF_CHUNKS   0x01
 
#define AVI_INDEX_IS_DATA   0x80
 
#define AVI_INDEX_2FIELD   0x01
 
#define AVI_MODE_WRITE   0
 
#define AVI_MODE_READ   1
 
#define AVI_ERR_SIZELIM
 
#define AVI_ERR_OPEN
 
#define AVI_ERR_READ   3 /* Error reading from AVI File */
 
#define AVI_ERR_WRITE
 
#define AVI_ERR_WRITE_INDEX
 
#define AVI_ERR_CLOSE
 
#define AVI_ERR_NOT_PERM
 
#define AVI_ERR_NO_MEM   8 /* malloc failed */
 
#define AVI_ERR_NO_AVI   9 /* Not an AVI file */
 
#define AVI_ERR_NO_HDRL
 
#define AVI_ERR_NO_MOVI
 
#define AVI_ERR_NO_VIDS   12 /* AVI file contains no video data */
 
#define AVI_ERR_NO_IDX
 
#define WAVE_FORMAT_UNKNOWN   (0x0000)
 
#define WAVE_FORMAT_PCM   (0x0001)
 
#define WAVE_FORMAT_ADPCM   (0x0002)
 
#define WAVE_FORMAT_IBM_CVSD   (0x0005)
 
#define WAVE_FORMAT_ALAW   (0x0006)
 
#define WAVE_FORMAT_MULAW   (0x0007)
 
#define WAVE_FORMAT_OKI_ADPCM   (0x0010)
 
#define WAVE_FORMAT_DVI_ADPCM   (0x0011)
 
#define WAVE_FORMAT_DIGISTD   (0x0015)
 
#define WAVE_FORMAT_DIGIFIX   (0x0016)
 
#define WAVE_FORMAT_YAMAHA_ADPCM   (0x0020)
 
#define WAVE_FORMAT_DSP_TRUESPEECH   (0x0022)
 
#define WAVE_FORMAT_GSM610   (0x0031)
 
#define IBM_FORMAT_MULAW   (0x0101)
 
#define IBM_FORMAT_ALAW   (0x0102)
 
#define IBM_FORMAT_ADPCM   (0x0103)
 
#define WAVE_FORMAT_MP3   (0x0055)
 
#define WAVE_FORMAT_AAC_ADTS   (0x706d)
 
#define WAVE_FORMAT_AAC   (0x00FF)
 
#define WAVE_FORMAT_AC3   (0x2000)
 

Functions

avi_tAVI_open_output_file (char *filename, u64 opendml_threshold)
 
void AVI_set_video (avi_t *AVI, int width, int height, double fps, char *compressor)
 
void AVI_set_audio (avi_t *AVI, int channels, int rate, int bits, int format, int mp3rate)
 
int AVI_write_frame (avi_t *AVI, u8 *data, int bytes, int keyframe)
 
int AVI_write_audio (avi_t *AVI, u8 *data, int bytes)
 
int AVI_close (avi_t *AVI)
 
avi_tAVI_open_input_file (char *filename, int getIndex)
 
avi_tAVI_open_input_indexfile (char *filename, int getIndex, char *indexfile)
 
avi_tAVI_open_indexfd (FILE *fd, int getIndex, char *indexfile)
 
int avi_parse_input_file (avi_t *AVI, int getIndex)
 
int avi_parse_index_from_file (avi_t *AVI, char *filename)
 
int AVI_audio_mp3rate (avi_t *AVI)
 
int AVI_video_frames (avi_t *AVI)
 
int AVI_video_width (avi_t *AVI)
 
int AVI_video_height (avi_t *AVI)
 
double AVI_frame_rate (avi_t *AVI)
 
char * AVI_video_compressor (avi_t *AVI)
 
int AVI_audio_channels (avi_t *AVI)
 
int AVI_audio_bits (avi_t *AVI)
 
int AVI_audio_format (avi_t *AVI)
 
int AVI_audio_rate (avi_t *AVI)
 
u64 AVI_audio_bytes (avi_t *AVI)
 
int AVI_audio_chunks (avi_t *AVI)
 
int AVI_frame_size (avi_t *AVI, int frame)
 
int AVI_audio_size (avi_t *AVI, int frame)
 
u64 AVI_get_video_position (avi_t *AVI, int frame)
 
int AVI_read_frame (avi_t *AVI, u8 *vidbuf, int *keyframe)
 
int AVI_read_audio (avi_t *AVI, u8 *audbuf, int bytes, int *continuous)
 
int AVI_seek_start (avi_t *AVI)
 
int AVI_set_video_position (avi_t *AVI, int frame)
 
int AVI_set_audio_position (avi_t *AVI, int byte)
 
int AVI_scan (char *name)
 
int AVI_dump (char *name, int mode)
 
char * AVI_codec2str (short cc)
 
int AVI_file_check (char *import_file)
 
void AVI_info (avi_t *avifile)
 
int avi_update_header (avi_t *AVI)
 
int AVI_set_audio_track (avi_t *AVI, u32 track)
 
int AVI_get_audio_track (avi_t *AVI)
 
int AVI_audio_tracks (avi_t *AVI)
 
void AVI_set_comment_fd (avi_t *AVI, int fd)
 
int AVI_get_comment_fd (avi_t *AVI)
 
int AVI_read_wave_header (int fd, struct wave_header *wave)
 
int AVI_write_wave_header (int fd, const struct wave_header *wave)
 
size_t AVI_read_wave_pcm_data (int fd, void *buffer, size_t buflen)
 
size_t AVI_write_wave_pcm_data (int fd, const void *buffer, size_t buflen)
 

Data Structure Documentation

◆ video_index_entry

struct video_index_entry
Data Fields
u64 key
u64 pos
u64 len

◆ audio_index_entry

struct audio_index_entry
Data Fields
u64 pos
u64 len
u64 tot

◆ avisuperindex_entry

struct avisuperindex_entry
Data Fields
u64 qwOffset
u32 dwSize
u32 dwDuration

◆ avistdindex_entry

struct avistdindex_entry
Data Fields
u32 dwOffset
u32 dwSize

◆ avistdindex_chunk

struct avistdindex_chunk
+ Collaboration diagram for avistdindex_chunk:
Data Fields
char fcc[4]
u32 dwSize
u16 wLongsPerEntry
u8 bIndexSubType
u8 bIndexType
u32 nEntriesInUse
char dwChunkId[4]
u64 qwBaseOffset
u32 dwReserved3
avistdindex_entry * aIndex

◆ avisuperindex_chunk

struct avisuperindex_chunk
+ Collaboration diagram for avisuperindex_chunk:
Data Fields
char fcc[4]
u32 dwSize
u16 wLongsPerEntry
u8 bIndexSubType
u8 bIndexType
u32 nEntriesInUse
char dwChunkId[4]
u32 dwReserved[3]
avisuperindex_entry * aIndex
avistdindex_chunk ** stdindex

◆ track_t

struct track_t
+ Collaboration diagram for track_t:
Data Fields
int a_fmt
int a_chans
int a_rate
int a_bits
int mp3rate
int a_vbr
int padrate
int audio_strn
u64 audio_bytes
int audio_chunks
char audio_tag[4]
int audio_posc
int audio_posb
u64 a_codech_off
u64 a_codecf_off
audio_index_entry * audio_index
avisuperindex_chunk * audio_superindex

◆ alBITMAPINFOHEADER

struct alBITMAPINFOHEADER
Data Fields
u32 bi_size
u32 bi_width
u32 bi_height
u16 bi_planes
u16 bi_bit_count
u32 bi_compression
u32 bi_size_image
u32 bi_x_pels_per_meter
u32 bi_y_pels_per_meter
u32 bi_clr_used
u32 bi_clr_important

◆ alWAVEFORMATEX

struct alWAVEFORMATEX
Data Fields
u16 w_format_tag
u16 n_channels
u32 n_samples_per_sec
u32 n_avg_bytes_per_sec
u16 n_block_align
u16 w_bits_per_sample
u16 cb_size

◆ alAVISTREAMHEADER

struct alAVISTREAMHEADER
Data Fields
u32 fcc_type
u32 fcc_handler
u32 dw_flags
u32 dw_caps
u16 w_priority
u16 w_language
u32 dw_scale
u32 dw_rate
u32 dw_start
u32 dw_length
u32 dw_initial_frames
u32 dw_suggested_buffer_size
u32 dw_quality
u32 dw_sample_size
u16 dw_left
u16 dw_top
u16 dw_right
u16 dw_bottom

◆ avi_t

struct avi_t
+ Collaboration diagram for avi_t:
Data Fields
FILE * fdes
int mode
int width
int height
double fps
char compressor[8]
char compressor2[8]
u32 video_strn
int video_frames
char video_tag[4]
int video_pos
alAVISTREAMHEADER video_stream_header
u32 max_len
track_t track[AVI_MAX_TRACKS]
s64 pos
int n_idx
int max_idx
s64 v_codech_off
s64 v_codecf_off
u8(* idx)[16]
video_index_entry * video_index
avisuperindex_chunk * video_superindex
int is_opendml
s64 last_pos
u32 last_len
int must_use_index
s64 movi_start
int total_frames
u32 anum
u32 aptr
char * index_file
alBITMAPINFOHEADER * bitmap_info_header
alWAVEFORMATEX * wave_format_ex[AVI_MAX_TRACKS]
alAVISTREAMHEADER stream_headers[AVI_MAX_TRACKS]
void * extradata
unsigned int extradata_size
u64 new_riff_threshold

◆ riff_struct

struct riff_struct
Data Fields
u8 id[4]
u32 len
u8 wave_id[4]

◆ chunk_struct

struct chunk_struct
Data Fields
u8 id[4]
u32 len

◆ common_struct

struct common_struct
Data Fields
u16 wFormatTag
u16 wChannels
u32 dwSamplesPerSec
u32 dwAvgBytesPerSec
u16 wBlockAlign
u16 wBitsPerSample

◆ wave_header

struct wave_header
+ Collaboration diagram for wave_header:
Data Fields
struct riff_struct riff
struct chunk_struct format
struct common_struct common
struct chunk_struct data

◆ AVIStreamHeader

struct AVIStreamHeader
Data Fields
int fccType
int fccHandler
int dwFlags
int dwPriority
int dwInitialFrames
int dwScale
int dwRate
int dwStart
int dwLength
int dwSuggestedBufferSize
int dwQuality
int dwSampleSize

Macro Definition Documentation

◆ AVI_MAX_TRACKS

#define AVI_MAX_TRACKS   8

◆ AVI_INDEX_OF_INDEXES

#define AVI_INDEX_OF_INDEXES   0x00

◆ AVI_INDEX_OF_CHUNKS

#define AVI_INDEX_OF_CHUNKS   0x01

◆ AVI_INDEX_IS_DATA

#define AVI_INDEX_IS_DATA   0x80

◆ AVI_INDEX_2FIELD

#define AVI_INDEX_2FIELD   0x01

◆ AVI_MODE_WRITE

#define AVI_MODE_WRITE   0

◆ AVI_MODE_READ

#define AVI_MODE_READ   1

◆ AVI_ERR_SIZELIM

#define AVI_ERR_SIZELIM
Value:
1 /* The write of the data would exceed
the maximum size of the AVI file.
This is more a warning than an error
since the file may be closed safely */

◆ AVI_ERR_OPEN

#define AVI_ERR_OPEN
Value:
2 /* Error opening the AVI file - wrong path
name or file nor readable/writable */

◆ AVI_ERR_READ

#define AVI_ERR_READ   3 /* Error reading from AVI File */

◆ AVI_ERR_WRITE

#define AVI_ERR_WRITE
Value:
4 /* Error writing to AVI File,
disk full ??? */

◆ AVI_ERR_WRITE_INDEX

#define AVI_ERR_WRITE_INDEX
Value:
5 /* Could not write index to AVI file
during close, file may still be
usable */

◆ AVI_ERR_CLOSE

#define AVI_ERR_CLOSE
Value:
6 /* Could not write header to AVI file
or not truncate the file during close,
file is most probably corrupted */

◆ AVI_ERR_NOT_PERM

#define AVI_ERR_NOT_PERM
Value:
7 /* Operation not permitted:
trying to read from a file open
for writing or vice versa */

◆ AVI_ERR_NO_MEM

#define AVI_ERR_NO_MEM   8 /* malloc failed */

◆ AVI_ERR_NO_AVI

#define AVI_ERR_NO_AVI   9 /* Not an AVI file */

◆ AVI_ERR_NO_HDRL

#define AVI_ERR_NO_HDRL
Value:
10 /* AVI file has no has no header list,
corrupted ??? */

◆ AVI_ERR_NO_MOVI

#define AVI_ERR_NO_MOVI
Value:
11 /* AVI file has no has no MOVI list,
corrupted ??? */

◆ AVI_ERR_NO_VIDS

#define AVI_ERR_NO_VIDS   12 /* AVI file contains no video data */

◆ AVI_ERR_NO_IDX

#define AVI_ERR_NO_IDX
Value:
13 /* The file has been opened with
getIndex==0, but an operation has been
performed that needs an index */

◆ WAVE_FORMAT_UNKNOWN

#define WAVE_FORMAT_UNKNOWN   (0x0000)

◆ WAVE_FORMAT_PCM

#define WAVE_FORMAT_PCM   (0x0001)

◆ WAVE_FORMAT_ADPCM

#define WAVE_FORMAT_ADPCM   (0x0002)

◆ WAVE_FORMAT_IBM_CVSD

#define WAVE_FORMAT_IBM_CVSD   (0x0005)

◆ WAVE_FORMAT_ALAW

#define WAVE_FORMAT_ALAW   (0x0006)

◆ WAVE_FORMAT_MULAW

#define WAVE_FORMAT_MULAW   (0x0007)

◆ WAVE_FORMAT_OKI_ADPCM

#define WAVE_FORMAT_OKI_ADPCM   (0x0010)

◆ WAVE_FORMAT_DVI_ADPCM

#define WAVE_FORMAT_DVI_ADPCM   (0x0011)

◆ WAVE_FORMAT_DIGISTD

#define WAVE_FORMAT_DIGISTD   (0x0015)

◆ WAVE_FORMAT_DIGIFIX

#define WAVE_FORMAT_DIGIFIX   (0x0016)

◆ WAVE_FORMAT_YAMAHA_ADPCM

#define WAVE_FORMAT_YAMAHA_ADPCM   (0x0020)

◆ WAVE_FORMAT_DSP_TRUESPEECH

#define WAVE_FORMAT_DSP_TRUESPEECH   (0x0022)

◆ WAVE_FORMAT_GSM610

#define WAVE_FORMAT_GSM610   (0x0031)

◆ IBM_FORMAT_MULAW

#define IBM_FORMAT_MULAW   (0x0101)

◆ IBM_FORMAT_ALAW

#define IBM_FORMAT_ALAW   (0x0102)

◆ IBM_FORMAT_ADPCM

#define IBM_FORMAT_ADPCM   (0x0103)

◆ WAVE_FORMAT_MP3

#define WAVE_FORMAT_MP3   (0x0055)

◆ WAVE_FORMAT_AAC_ADTS

#define WAVE_FORMAT_AAC_ADTS   (0x706d)

◆ WAVE_FORMAT_AAC

#define WAVE_FORMAT_AAC   (0x00FF)

◆ WAVE_FORMAT_AC3

#define WAVE_FORMAT_AC3   (0x2000)

Function Documentation

◆ AVI_open_output_file()

avi_t* AVI_open_output_file ( char *  filename,
u64  opendml_threshold 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_set_video()

void AVI_set_video ( avi_t AVI,
int  width,
int  height,
double  fps,
char *  compressor 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_set_audio()

void AVI_set_audio ( avi_t AVI,
int  channels,
int  rate,
int  bits,
int  format,
int  mp3rate 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_write_frame()

int AVI_write_frame ( avi_t AVI,
u8 data,
int  bytes,
int  keyframe 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_write_audio()

int AVI_write_audio ( avi_t AVI,
u8 data,
int  bytes 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_close()

int AVI_close ( avi_t AVI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_open_input_file()

avi_t* AVI_open_input_file ( char *  filename,
int  getIndex 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_open_input_indexfile()

avi_t* AVI_open_input_indexfile ( char *  filename,
int  getIndex,
char *  indexfile 
)

◆ AVI_open_indexfd()

avi_t* AVI_open_indexfd ( FILE *  fd,
int  getIndex,
char *  indexfile 
)

◆ avi_parse_input_file()

int avi_parse_input_file ( avi_t AVI,
int  getIndex 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ avi_parse_index_from_file()

int avi_parse_index_from_file ( avi_t AVI,
char *  filename 
)

◆ AVI_audio_mp3rate()

int AVI_audio_mp3rate ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_video_frames()

int AVI_video_frames ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_video_width()

int AVI_video_width ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_video_height()

int AVI_video_height ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_frame_rate()

double AVI_frame_rate ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_video_compressor()

char* AVI_video_compressor ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_channels()

int AVI_audio_channels ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_bits()

int AVI_audio_bits ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_format()

int AVI_audio_format ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_rate()

int AVI_audio_rate ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_bytes()

u64 AVI_audio_bytes ( avi_t AVI)

◆ AVI_audio_chunks()

int AVI_audio_chunks ( avi_t AVI)

◆ AVI_frame_size()

int AVI_frame_size ( avi_t AVI,
int  frame 
)
+ Here is the caller graph for this function:

◆ AVI_audio_size()

int AVI_audio_size ( avi_t AVI,
int  frame 
)
+ Here is the caller graph for this function:

◆ AVI_get_video_position()

u64 AVI_get_video_position ( avi_t AVI,
int  frame 
)
+ Here is the caller graph for this function:

◆ AVI_read_frame()

int AVI_read_frame ( avi_t AVI,
u8 vidbuf,
int *  keyframe 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_read_audio()

int AVI_read_audio ( avi_t AVI,
u8 audbuf,
int  bytes,
int *  continuous 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_seek_start()

int AVI_seek_start ( avi_t AVI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_set_video_position()

int AVI_set_video_position ( avi_t AVI,
int  frame 
)
+ Here is the caller graph for this function:

◆ AVI_set_audio_position()

int AVI_set_audio_position ( avi_t AVI,
int  byte 
)
+ Here is the caller graph for this function:

◆ AVI_scan()

int AVI_scan ( char *  name)

◆ AVI_dump()

int AVI_dump ( char *  name,
int  mode 
)

◆ AVI_codec2str()

char* AVI_codec2str ( short  cc)

◆ AVI_file_check()

int AVI_file_check ( char *  import_file)

◆ AVI_info()

void AVI_info ( avi_t avifile)

◆ avi_update_header()

int avi_update_header ( avi_t AVI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AVI_set_audio_track()

int AVI_set_audio_track ( avi_t AVI,
u32  track 
)
+ Here is the caller graph for this function:

◆ AVI_get_audio_track()

int AVI_get_audio_track ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_audio_tracks()

int AVI_audio_tracks ( avi_t AVI)
+ Here is the caller graph for this function:

◆ AVI_set_comment_fd()

void AVI_set_comment_fd ( avi_t AVI,
int  fd 
)

◆ AVI_get_comment_fd()

int AVI_get_comment_fd ( avi_t AVI)

◆ AVI_read_wave_header()

int AVI_read_wave_header ( int  fd,
struct wave_header wave 
)

◆ AVI_write_wave_header()

int AVI_write_wave_header ( int  fd,
const struct wave_header wave 
)

◆ AVI_read_wave_pcm_data()

size_t AVI_read_wave_pcm_data ( int  fd,
void *  buffer,
size_t  buflen 
)

◆ AVI_write_wave_pcm_data()

size_t AVI_write_wave_pcm_data ( int  fd,
const void *  buffer,
size_t  buflen 
)