Blender  V3.3
AVI_avi.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
26 #pragma once
27 
28 #include "BLI_sys_types.h"
29 #include <stdio.h> /* for FILE */
30 
31 typedef struct _AviChunk {
32  int fcc;
33  int size;
35 
36 typedef struct _AviList {
37  int fcc;
38  int size;
39  int ids;
41 
42 typedef struct _AviMainHeader {
43  int fcc;
44  int size;
45  int MicroSecPerFrame; /* MicroSecPerFrame - timing between frames */
46  int MaxBytesPerSec; /* MaxBytesPerSec - approx bps system must handle */
48  int Flags;
49 
51 #define AVIF_HASINDEX 0x00000010
53 #define AVIF_MUSTUSEINDEX 0x00000020
55 #define AVIF_ISINTERLEAVED 0x00000100
56 #define AVIF_TRUSTCKTYPE 0x00000800
58 #define AVIF_WASCAPTUREFILE 0x00010000
60 #define AVIF_COPYRIGHTED 0x00020000
61 
63  int InitialFrames; /* InitialFrames - initial frame before interleaving */
64  int Streams;
66  int Width;
67  int Height;
68  int Reserved[4];
70 
71 typedef struct _AviStreamHeader {
72  int fcc;
73  int size;
74  int Type;
75 #define AVIST_VIDEO FCC("vids")
76 #define AVIST_AUDIO FCC("auds")
77 #define AVIST_MIDI FCC("mids")
78 #define AVIST_TEXT FCC("txts")
79 
80  int Handler;
81  int Flags;
82 #define AVISF_DISABLED 0x00000001
83 #define AVISF_VIDEO_PALCHANGES 0x00010000
84 
85  short Priority;
86  short Language;
88  int Scale;
89  int Rate;
90  int Start;
91  int Length;
93  int Quality;
95  short left;
96  short top;
97  short right;
98  short bottom;
100 
101 typedef struct _AviBitmapInfoHeader {
102  int fcc;
103  int size;
104  int Size;
105  int Width;
106  int Height;
107  short Planes;
108  short BitCount;
113  int ClrUsed;
116 
117 typedef struct _AviMJPEGUnknown {
118  int a;
119  int b;
120  int c;
121  int d;
122  int e;
123  int f;
124  int g;
126 
127 typedef struct _AviIndexEntry {
128  int ChunkId;
129  int Flags;
130 #define AVIIF_LIST 0x00000001
131 #define AVIIF_KEYFRAME 0x00000010
132 #define AVIIF_NO_TIME 0x00000100
133 #define AVIIF_COMPRESSOR 0x0FFF0000
134  int Offset;
135  int Size;
137 
138 typedef struct _AviIndex {
139  int fcc;
140  int size;
143 
144 typedef enum {
153 } AviFormat;
154 
155 typedef struct _AviStreamRec {
157  void *sf;
158  int sf_size;
161 
162 typedef struct _AviMovie {
163  FILE *fp;
164 
165  int type;
166 #define AVI_MOVIE_READ 0
167 #define AVI_MOVIE_WRITE 1
168 
170 
175 
179 
180  /* Local data goes here */
184 
185 typedef enum {
195 } AviError;
196 
197 /* belongs to the option-setting function. */
198 typedef enum {
203 } AviOption;
204 
205 /* The offsets that will always stay the same in AVI files we
206  * write... used to seek around to the places where we need to write
207  * the sizes */
208 
209 #define AVI_RIFF_SOFF 4L
210 #define AVI_HDRL_SOFF 16L
211 
215 #define FCC(ch4) (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)
216 
220 bool AVI_is_avi(const char *name);
221 
225 AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...);
226 
231 
237  AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data);
238 
239 /* TODO: there should be some explanation about what these mean. */
243 #define AVI_OPTION_TYPE_MAIN 0
247 #define AVI_OPTION_TYPE_STRH 1
251 #define AVI_OPTION_TYPE_STRF 2
252 
257 int AVI_get_stream(AviMovie *movie, int avist_type, int stream_num);
258 
262 AviError AVI_open_movie(const char *name, AviMovie *movie);
263 
267 void *AVI_read_frame(AviMovie *movie, AviFormat format, int frame, int stream);
271 AviError AVI_close(AviMovie *movie);
272 
276 AviError AVI_write_frame(AviMovie *movie, int frame_num, ...);
277 
struct _AviBitmapInfoHeader AviBitmapInfoHeader
struct _AviStreamRec AviStreamRec
AviError
Definition: AVI_avi.h:185
@ AVI_ERROR_ALLOC
Definition: AVI_avi.h:192
@ AVI_ERROR_FOUND
Definition: AVI_avi.h:193
@ AVI_ERROR_READING
Definition: AVI_avi.h:189
@ AVI_ERROR_OPTION
Definition: AVI_avi.h:194
@ AVI_ERROR_FORMAT
Definition: AVI_avi.h:191
@ AVI_ERROR_OPEN
Definition: AVI_avi.h:188
@ AVI_ERROR_NONE
Definition: AVI_avi.h:186
@ AVI_ERROR_COMPRESSION
Definition: AVI_avi.h:187
@ AVI_ERROR_WRITING
Definition: AVI_avi.h:190
struct _AviStreamHeader AviStreamHeader
struct _AviList AviList
AviError AVI_close(AviMovie *movie)
Definition: avi.c:670
AviError AVI_open_compress(char *name, AviMovie *movie, int streams,...)
Definition: avi.c:695
AviOption
Definition: AVI_avi.h:198
@ AVI_OPTION_HEIGHT
Definition: AVI_avi.h:200
@ AVI_OPTION_FRAMERATE
Definition: AVI_avi.h:202
@ AVI_OPTION_WIDTH
Definition: AVI_avi.h:199
@ AVI_OPTION_QUALITY
Definition: AVI_avi.h:201
AviError AVI_close_compress(AviMovie *movie)
Definition: avi.c:989
struct _AviIndex AviIndex
struct _AviMainHeader AviMainHeader
bool AVI_is_avi(const char *name)
Definition: avi.c:187
void * AVI_read_frame(AviMovie *movie, AviFormat format, int frame, int stream)
Definition: avi.c:623
AviFormat
Definition: AVI_avi.h:144
@ AVI_FORMAT_RGB24
Definition: AVI_avi.h:146
@ AVI_FORMAT_RGB32
Definition: AVI_avi.h:148
@ AVI_FORMAT_AVI_RGB
Definition: AVI_avi.h:150
@ AVI_FORMAT_MJPEG
Definition: AVI_avi.h:152
AviError AVI_print_error(AviError error)
Definition: avi.c:142
AviError AVI_write_frame(AviMovie *movie, int frame_num,...)
Definition: avi.c:881
struct _AviIndexEntry AviIndexEntry
int AVI_get_stream(AviMovie *movie, int avist_type, int stream_num)
Definition: avi.c:90
struct _AviMJPEGUnknown AviMJPEGUnknown
AviError AVI_open_movie(const char *name, AviMovie *movie)
Definition: avi.c:378
AviError AVI_set_compress_option(AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data)
Definition: avi_options.c:22
struct _AviMovie AviMovie
struct _AviChunk AviChunk
format
Definition: logImageCore.h:38
static void error(const char *str)
Definition: meshlaplacian.c:51
__int64 int64_t
Definition: stdint.h:89
int size
Definition: AVI_avi.h:33
int fcc
Definition: AVI_avi.h:32
int size
Definition: AVI_avi.h:140
int fcc
Definition: AVI_avi.h:139
AviIndexEntry * entrys
Definition: AVI_avi.h:141
int ids
Definition: AVI_avi.h:39
int size
Definition: AVI_avi.h:38
int fcc
Definition: AVI_avi.h:37
int Reserved[4]
Definition: AVI_avi.h:68
int MicroSecPerFrame
Definition: AVI_avi.h:45
int MaxBytesPerSec
Definition: AVI_avi.h:46
int InitialFrames
Definition: AVI_avi.h:63
int SuggestedBufferSize
Definition: AVI_avi.h:65
int TotalFrames
Definition: AVI_avi.h:62
int PaddingGranularity
Definition: AVI_avi.h:47
int64_t read_offset
Definition: AVI_avi.h:177
int64_t * offset_table
Definition: AVI_avi.h:178
int type
Definition: AVI_avi.h:165
int odd_fields
Definition: AVI_avi.h:182
int64_t size
Definition: AVI_avi.h:169
int interlace
Definition: AVI_avi.h:181
int64_t movi_offset
Definition: AVI_avi.h:176
FILE * fp
Definition: AVI_avi.h:163
int index_entries
Definition: AVI_avi.h:174
AviMainHeader * header
Definition: AVI_avi.h:171
AviStreamRec * streams
Definition: AVI_avi.h:172
AviIndexEntry * entries
Definition: AVI_avi.h:173
int SuggestedBufferSize
Definition: AVI_avi.h:92
int InitialFrames
Definition: AVI_avi.h:87
short Priority
Definition: AVI_avi.h:85
short Language
Definition: AVI_avi.h:86
short bottom
Definition: AVI_avi.h:98
AviFormat format
Definition: AVI_avi.h:159
AviStreamHeader sh
Definition: AVI_avi.h:156
void * sf
Definition: AVI_avi.h:157