Blender  V2.93
AVI_avi.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
42 #pragma once
43 
44 #include "BLI_sys_types.h"
45 #include <stdio.h> /* for FILE */
46 
47 typedef struct _AviChunk {
48  int fcc;
49  int size;
51 
52 typedef struct _AviList {
53  int fcc;
54  int size;
55  int ids;
57 
58 typedef struct _AviMainHeader {
59  int fcc;
60  int size;
61  int MicroSecPerFrame; /* MicroSecPerFrame - timing between frames */
62  int MaxBytesPerSec; /* MaxBytesPerSec - approx bps system must handle */
64  int Flags;
65 
67 #define AVIF_HASINDEX 0x00000010
69 #define AVIF_MUSTUSEINDEX 0x00000020
71 #define AVIF_ISINTERLEAVED 0x00000100
72 #define AVIF_TRUSTCKTYPE 0x00000800
74 #define AVIF_WASCAPTUREFILE 0x00010000
76 #define AVIF_COPYRIGHTED 0x00020000
77 
79  int InitialFrames; /* InitialFrames - initial frame before interleaving */
80  int Streams;
82  int Width;
83  int Height;
84  int Reserved[4];
86 
87 typedef struct _AviStreamHeader {
88  int fcc;
89  int size;
90  int Type;
91 #define AVIST_VIDEO FCC("vids")
92 #define AVIST_AUDIO FCC("auds")
93 #define AVIST_MIDI FCC("mids")
94 #define AVIST_TEXT FCC("txts")
95 
96  int Handler;
97  int Flags;
98 #define AVISF_DISABLED 0x00000001
99 #define AVISF_VIDEO_PALCHANGES 0x00010000
100 
101  short Priority;
102  short Language;
104  int Scale;
105  int Rate;
106  int Start;
107  int Length;
109  int Quality;
111  short left;
112  short top;
113  short right;
114  short bottom;
116 
117 typedef struct _AviBitmapInfoHeader {
118  int fcc;
119  int size;
120  int Size;
121  int Width;
122  int Height;
123  short Planes;
124  short BitCount;
129  int ClrUsed;
132 
133 typedef struct _AviMJPEGUnknown {
134  int a;
135  int b;
136  int c;
137  int d;
138  int e;
139  int f;
140  int g;
142 
143 typedef struct _AviIndexEntry {
144  int ChunkId;
145  int Flags;
146 #define AVIIF_LIST 0x00000001
147 #define AVIIF_KEYFRAME 0x00000010
148 #define AVIIF_NO_TIME 0x00000100
149 #define AVIIF_COMPRESSOR 0x0FFF0000
150  int Offset;
151  int Size;
153 
154 typedef struct _AviIndex {
155  int fcc;
156  int size;
159 
160 typedef enum {
169 } AviFormat;
170 
171 typedef struct _AviStreamRec {
173  void *sf;
174  int sf_size;
177 
178 typedef struct _AviMovie {
179  FILE *fp;
180 
181  int type;
182 #define AVI_MOVIE_READ 0
183 #define AVI_MOVIE_WRITE 1
184 
186 
191 
195 
196  /* Local data goes here */
200 
201 typedef enum {
211 } AviError;
212 
213 /* belongs to the option-setting function. */
214 typedef enum {
219 } AviOption;
220 
221 /* The offsets that will always stay the same in AVI files we
222  * write... used to seek around to the places where we need to write
223  * the sizes */
224 
225 #define AVI_RIFF_SOFF 4L
226 #define AVI_HDRL_SOFF 16L
227 
231 #define FCC(ch4) (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)
232 
236 bool AVI_is_avi(const char *name);
237 
241 AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...);
242 
247 
253  AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data);
254 /* Hmmm... there should be some explanation about what these mean */
258 #define AVI_OPTION_TYPE_MAIN 0
262 #define AVI_OPTION_TYPE_STRH 1
266 #define AVI_OPTION_TYPE_STRF 2
267 
272 int AVI_get_stream(AviMovie *movie, int avist_type, int stream_num);
273 
277 AviError AVI_open_movie(const char *name, AviMovie *movie);
278 
282 void *AVI_read_frame(AviMovie *movie, AviFormat format, int frame, int stream);
286 AviError AVI_close(AviMovie *movie);
287 
291 AviError AVI_write_frame(AviMovie *movie, int frame_num, ...);
292 
struct _AviBitmapInfoHeader AviBitmapInfoHeader
struct _AviStreamRec AviStreamRec
AviError
Definition: AVI_avi.h:201
@ AVI_ERROR_ALLOC
Definition: AVI_avi.h:208
@ AVI_ERROR_FOUND
Definition: AVI_avi.h:209
@ AVI_ERROR_READING
Definition: AVI_avi.h:205
@ AVI_ERROR_OPTION
Definition: AVI_avi.h:210
@ AVI_ERROR_FORMAT
Definition: AVI_avi.h:207
@ AVI_ERROR_OPEN
Definition: AVI_avi.h:204
@ AVI_ERROR_NONE
Definition: AVI_avi.h:202
@ AVI_ERROR_COMPRESSION
Definition: AVI_avi.h:203
@ AVI_ERROR_WRITING
Definition: AVI_avi.h:206
struct _AviStreamHeader AviStreamHeader
struct _AviList AviList
AviError AVI_close(AviMovie *movie)
Definition: avi.c:686
AviError AVI_open_compress(char *name, AviMovie *movie, int streams,...)
Definition: avi.c:711
AviOption
Definition: AVI_avi.h:214
@ AVI_OPTION_HEIGHT
Definition: AVI_avi.h:216
@ AVI_OPTION_FRAMERATE
Definition: AVI_avi.h:218
@ AVI_OPTION_WIDTH
Definition: AVI_avi.h:215
@ AVI_OPTION_QUALITY
Definition: AVI_avi.h:217
AviError AVI_close_compress(AviMovie *movie)
Definition: avi.c:1005
struct _AviIndex AviIndex
struct _AviMainHeader AviMainHeader
bool AVI_is_avi(const char *name)
Definition: avi.c:203
void * AVI_read_frame(AviMovie *movie, AviFormat format, int frame, int stream)
Definition: avi.c:639
AviFormat
Definition: AVI_avi.h:160
@ AVI_FORMAT_RGB24
Definition: AVI_avi.h:162
@ AVI_FORMAT_RGB32
Definition: AVI_avi.h:164
@ AVI_FORMAT_AVI_RGB
Definition: AVI_avi.h:166
@ AVI_FORMAT_MJPEG
Definition: AVI_avi.h:168
AviError AVI_print_error(AviError error)
Definition: avi.c:158
AviError AVI_write_frame(AviMovie *movie, int frame_num,...)
Definition: avi.c:897
struct _AviIndexEntry AviIndexEntry
int AVI_get_stream(AviMovie *movie, int avist_type, int stream_num)
Definition: avi.c:106
struct _AviMJPEGUnknown AviMJPEGUnknown
AviError AVI_open_movie(const char *name, AviMovie *movie)
Definition: avi.c:394
AviError AVI_set_compress_option(AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data)
Definition: avi_options.c:38
struct _AviMovie AviMovie
struct _AviChunk AviChunk
format
Definition: logImageCore.h:47
static void error(const char *str)
Definition: meshlaplacian.c:65
__int64 int64_t
Definition: stdint.h:92
int size
Definition: AVI_avi.h:49
int fcc
Definition: AVI_avi.h:48
int size
Definition: AVI_avi.h:156
int fcc
Definition: AVI_avi.h:155
AviIndexEntry * entrys
Definition: AVI_avi.h:157
int ids
Definition: AVI_avi.h:55
int size
Definition: AVI_avi.h:54
int fcc
Definition: AVI_avi.h:53
int Reserved[4]
Definition: AVI_avi.h:84
int MicroSecPerFrame
Definition: AVI_avi.h:61
int MaxBytesPerSec
Definition: AVI_avi.h:62
int InitialFrames
Definition: AVI_avi.h:79
int SuggestedBufferSize
Definition: AVI_avi.h:81
int TotalFrames
Definition: AVI_avi.h:78
int PaddingGranularity
Definition: AVI_avi.h:63
int64_t read_offset
Definition: AVI_avi.h:193
int64_t * offset_table
Definition: AVI_avi.h:194
int type
Definition: AVI_avi.h:181
int odd_fields
Definition: AVI_avi.h:198
int64_t size
Definition: AVI_avi.h:185
int interlace
Definition: AVI_avi.h:197
int64_t movi_offset
Definition: AVI_avi.h:192
FILE * fp
Definition: AVI_avi.h:179
int index_entries
Definition: AVI_avi.h:190
AviMainHeader * header
Definition: AVI_avi.h:187
AviStreamRec * streams
Definition: AVI_avi.h:188
AviIndexEntry * entries
Definition: AVI_avi.h:189
int SuggestedBufferSize
Definition: AVI_avi.h:108
short Priority
Definition: AVI_avi.h:101
short Language
Definition: AVI_avi.h:102
AviFormat format
Definition: AVI_avi.h:175
AviStreamHeader sh
Definition: AVI_avi.h:172
void * sf
Definition: AVI_avi.h:173