Hauptseite   Klassenhierarchie   Alphabetische Liste   Übersicht   Auflistung der Dateien   Elementübersicht  

avilib.h

00001 #ifndef AVILIB_H
00002 #define AVILIB_H
00003 
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00008 
00009 typedef struct
00010 {
00011    long pos;
00012    long len;
00013 } video_index_entry;
00014 
00015 typedef struct
00016 {
00017    long pos;
00018    long len;
00019    long tot;
00020 } audio_index_entry;
00021 
00022 typedef struct
00023 {
00024    long   fdes;              /* File descriptor of AVI file */
00025    long   mode;              /* 0 for reading, 1 for writing */
00026 
00027    long   width;             /* Width  of a video frame */
00028    long   height;            /* Height of a video frame */
00029    double fps;               /* Frames per second */
00030    char   compressor[8];     /* Type of compressor, 4 bytes + padding for 0 byte */
00031    long   video_strn;        /* Video stream number */
00032    long   video_frames;      /* Number of video frames */
00033    char   video_tag[4];      /* Tag of video data */
00034    long   video_pos;         /* Number of next frame to be read
00035                                 (if index present) */
00036 
00037    long   a_fmt;             /* Audio format, see #defines below */
00038    long   a_chans;           /* Audio channels, 0 for no audio */
00039    long   a_rate;            /* Rate in Hz */
00040    long   a_bits;            /* bits per audio sample */
00041    long   audio_strn;        /* Audio stream number */
00042    long   audio_bytes;       /* Total number of bytes of audio data */
00043    long   audio_chunks;      /* Chunks of audio data in the file */
00044    char   audio_tag[4];      /* Tag of audio data */
00045    long   audio_posc;        /* Audio position: chunk */
00046    long   audio_posb;        /* Audio position: byte within chunk */
00047 
00048    long   pos;               /* position in file */
00049    long   n_idx;             /* number of index entries actually filled */
00050    long   max_idx;           /* number of index entries actually allocated */
00051    unsigned char (*idx)[16]; /* index entries (AVI idx1 tag) */
00052    video_index_entry * video_index;
00053    audio_index_entry * audio_index;
00054    long   last_pos;          /* Position of last frame written */
00055    long   last_len;          /* Length of last frame written */
00056    int    must_use_index;    /* Flag if frames are duplicated */
00057    long   movi_start;
00058 } avi_t;
00059 
00060 #define AVI_MODE_WRITE  0
00061 #define AVI_MODE_READ   1
00062 
00063 /* The error codes delivered by avi_open_input_file */
00064 
00065 #define AVI_ERR_SIZELIM      1     /* The write of the data would exceed
00066                                       the maximum size of the AVI file.
00067                                       This is more a warning than an error
00068                                       since the file may be closed safely */
00069 
00070 #define AVI_ERR_OPEN         2     /* Error opening the AVI file - wrong path
00071                                       name or file nor readable/writable */
00072 
00073 #define AVI_ERR_READ         3     /* Error reading from AVI File */
00074 
00075 #define AVI_ERR_WRITE        4     /* Error writing to AVI File,
00076                                       disk full ??? */
00077 
00078 #define AVI_ERR_WRITE_INDEX  5     /* Could not write index to AVI file
00079                                       during close, file may still be
00080                                       usable */
00081 
00082 #define AVI_ERR_CLOSE        6     /* Could not write header to AVI file
00083                                       or not truncate the file during close,
00084                                       file is most probably corrupted */
00085 
00086 #define AVI_ERR_NOT_PERM     7     /* Operation not permitted:
00087                                       trying to read from a file open
00088                                       for writing or vice versa */
00089 
00090 #define AVI_ERR_NO_MEM       8     /* malloc failed */
00091 
00092 #define AVI_ERR_NO_AVI       9     /* Not an AVI file */
00093 
00094 #define AVI_ERR_NO_HDRL     10     /* AVI file has no has no header list,
00095                                       corrupted ??? */
00096 
00097 #define AVI_ERR_NO_MOVI     11     /* AVI file has no has no MOVI list,
00098                                       corrupted ??? */
00099 
00100 #define AVI_ERR_NO_VIDS     12     /* AVI file contains no video data */
00101 
00102 #define AVI_ERR_NO_IDX      13     /* The file has been opened with
00103                                       getIndex==0, but an operation has been
00104                                       performed that needs an index */
00105 
00106 /* Possible Audio formats */
00107 
00108 #define WAVE_FORMAT_UNKNOWN             (0x0000)
00109 #define WAVE_FORMAT_PCM                 (0x0001)
00110 #define WAVE_FORMAT_ADPCM               (0x0002)
00111 #define WAVE_FORMAT_IBM_CVSD            (0x0005)
00112 #define WAVE_FORMAT_ALAW                (0x0006)
00113 #define WAVE_FORMAT_MULAW               (0x0007)
00114 #define WAVE_FORMAT_OKI_ADPCM           (0x0010)
00115 #define WAVE_FORMAT_DVI_ADPCM           (0x0011)
00116 #define WAVE_FORMAT_DIGISTD             (0x0015)
00117 #define WAVE_FORMAT_DIGIFIX             (0x0016)
00118 #define WAVE_FORMAT_YAMAHA_ADPCM        (0x0020)
00119 #define WAVE_FORMAT_DSP_TRUESPEECH      (0x0022)
00120 #define WAVE_FORMAT_GSM610              (0x0031)
00121 #define IBM_FORMAT_MULAW                (0x0101)
00122 #define IBM_FORMAT_ALAW                 (0x0102)
00123 #define IBM_FORMAT_ADPCM                (0x0103)
00124 
00125 
00126 avi_t* AVI_open_output_file(char * filename);
00127 void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor);
00128 void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format);
00129 int  AVI_write_frame(avi_t *AVI, char *data, long bytes);
00130 int  AVI_dup_frame(avi_t *AVI);
00131 int  AVI_write_audio(avi_t *AVI, char *data, long bytes);
00132 long AVI_bytes_remain(avi_t *AVI);
00133 int  AVI_close(avi_t *AVI);
00134 
00135 avi_t *AVI_open_input_file(char *filename, int getIndex);
00136 
00137 long AVI_video_frames(avi_t *AVI);
00138 int  AVI_video_width(avi_t *AVI);
00139 int  AVI_video_height(avi_t *AVI);
00140 double AVI_frame_rate(avi_t *AVI);
00141 char* AVI_video_compressor(avi_t *AVI);
00142 
00143 int  AVI_audio_channels(avi_t *AVI);
00144 int  AVI_audio_bits(avi_t *AVI);
00145 int  AVI_audio_format(avi_t *AVI);
00146 long AVI_audio_rate(avi_t *AVI);
00147 long AVI_audio_bytes(avi_t *AVI);
00148 
00149 long AVI_frame_size(avi_t *AVI, long frame);
00150 int  AVI_seek_start(avi_t *AVI);
00151 int  AVI_set_video_position(avi_t *AVI, long frame);
00152 long AVI_read_frame(avi_t *AVI, char *vidbuf);
00153 int  AVI_set_audio_position(avi_t *AVI, long byte);
00154 long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes);
00155 
00156 int  AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf,
00157                                char *audbuf, long max_audbuf,
00158                                long *len);
00159 
00160 void AVI_print_error(char *str);
00161 char *AVI_strerror();
00162 char *AVI_syserror();
00163 
00164 #ifdef __cplusplus
00165 }
00166 #endif
00167 
00168 #endif

Erzeugt am Mon Jan 7 19:15:12 2002 für av_convert von doxygen1.2.9.1 geschrieben von Dimitri van Heesch, © 1997-2001