Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
AVI_avi.h File Reference
#include "BLI_sys_types.h"
#include <stdio.h>

Go to the source code of this file.

Classes

struct  _AviChunk
 
struct  _AviList
 
struct  _AviMainHeader
 
struct  _AviStreamHeader
 
struct  _AviBitmapInfoHeader
 
struct  _AviMJPEGUnknown
 
struct  _AviIndexEntry
 
struct  _AviIndex
 
struct  _AviStreamRec
 
struct  _AviMovie
 

Macros

#define AVIF_HASINDEX   0x00000010
 
#define AVIF_MUSTUSEINDEX   0x00000020
 
#define AVIF_ISINTERLEAVED   0x00000100
 
#define AVIF_TRUSTCKTYPE   0x00000800
 
#define AVIF_WASCAPTUREFILE   0x00010000
 
#define AVIF_COPYRIGHTED   0x00020000
 
#define AVIST_VIDEO   FCC("vids")
 
#define AVIST_AUDIO   FCC("auds")
 
#define AVIST_MIDI   FCC("mids")
 
#define AVIST_TEXT   FCC("txts")
 
#define AVISF_DISABLED   0x00000001
 
#define AVISF_VIDEO_PALCHANGES   0x00010000
 
#define AVIIF_LIST   0x00000001
 
#define AVIIF_KEYFRAME   0x00000010
 
#define AVIIF_NO_TIME   0x00000100
 
#define AVIIF_COMPRESSOR   0x0FFF0000
 
#define AVI_MOVIE_READ   0
 
#define AVI_MOVIE_WRITE   1
 
#define AVI_RIFF_SOFF   4L
 
#define AVI_HDRL_SOFF   16L
 
#define FCC(ch4)   (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)
 
#define AVI_OPTION_TYPE_MAIN   0
 
#define AVI_OPTION_TYPE_STRH   1
 
#define AVI_OPTION_TYPE_STRF   2
 

Typedefs

typedef struct _AviChunk AviChunk
 
typedef struct _AviList AviList
 
typedef struct _AviMainHeader AviMainHeader
 
typedef struct _AviStreamHeader AviStreamHeader
 
typedef struct _AviBitmapInfoHeader AviBitmapInfoHeader
 
typedef struct _AviMJPEGUnknown AviMJPEGUnknown
 
typedef struct _AviIndexEntry AviIndexEntry
 
typedef struct _AviIndex AviIndex
 
typedef struct _AviStreamRec AviStreamRec
 
typedef struct _AviMovie AviMovie
 

Enumerations

enum  AviFormat { AVI_FORMAT_RGB24 , AVI_FORMAT_RGB32 , AVI_FORMAT_AVI_RGB , AVI_FORMAT_MJPEG }
 
enum  AviError {
  AVI_ERROR_NONE = 0 , AVI_ERROR_COMPRESSION , AVI_ERROR_OPEN , AVI_ERROR_READING ,
  AVI_ERROR_WRITING , AVI_ERROR_FORMAT , AVI_ERROR_ALLOC , AVI_ERROR_FOUND ,
  AVI_ERROR_OPTION
}
 
enum  AviOption { AVI_OPTION_WIDTH = 0 , AVI_OPTION_HEIGHT , AVI_OPTION_QUALITY , AVI_OPTION_FRAMERATE }
 

Functions

bool AVI_is_avi (const char *name)
 
AviError AVI_open_compress (char *name, AviMovie *movie, int streams,...)
 
AviError AVI_close_compress (AviMovie *movie)
 
AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data)
 
int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num)
 
AviError AVI_open_movie (const char *name, AviMovie *movie)
 
voidAVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
 
AviError AVI_close (AviMovie *movie)
 
AviError AVI_write_frame (AviMovie *movie, int frame_num,...)
 
AviError AVI_print_error (AviError error)
 

Detailed Description

About the AVI module

This is external code. It provides avi file import/export and conversions. It has been adapted to make use of Blender memory management functions, and because of this it needs module blenlib. You need to provide this lib when linking with libavi.a .

Known issues with AVI

This header has not been split, since it interleaves type defines and functions. You would need the types to be able to include the function headers anyway. And, after all, it is someone else's code. So we keep it like this.

Definition in file AVI_avi.h.

Macro Definition Documentation

◆ AVI_HDRL_SOFF

#define AVI_HDRL_SOFF   16L

Definition at line 210 of file AVI_avi.h.

◆ AVI_MOVIE_READ

#define AVI_MOVIE_READ   0

Definition at line 166 of file AVI_avi.h.

◆ AVI_MOVIE_WRITE

#define AVI_MOVIE_WRITE   1

Definition at line 167 of file AVI_avi.h.

◆ AVI_OPTION_TYPE_MAIN

#define AVI_OPTION_TYPE_MAIN   0

Compression option, for use in avi_set_compress_option

Definition at line 243 of file AVI_avi.h.

◆ AVI_OPTION_TYPE_STRF

#define AVI_OPTION_TYPE_STRF   2

Compression option, for use in avi_set_compress_option

Definition at line 251 of file AVI_avi.h.

◆ AVI_OPTION_TYPE_STRH

#define AVI_OPTION_TYPE_STRH   1

Compression option, for use in avi_set_compress_option

Definition at line 247 of file AVI_avi.h.

◆ AVI_RIFF_SOFF

#define AVI_RIFF_SOFF   4L

Definition at line 209 of file AVI_avi.h.

◆ AVIF_COPYRIGHTED

#define AVIF_COPYRIGHTED   0x00020000

contains copyrighted data

Definition at line 60 of file AVI_avi.h.

◆ AVIF_HASINDEX

#define AVIF_HASINDEX   0x00000010

had idx1 chunk

Definition at line 51 of file AVI_avi.h.

◆ AVIF_ISINTERLEAVED

#define AVIF_ISINTERLEAVED   0x00000100

AVI file is interleaved

Definition at line 55 of file AVI_avi.h.

◆ AVIF_MUSTUSEINDEX

#define AVIF_MUSTUSEINDEX   0x00000020

must use idx1 chunk to determine order

Definition at line 53 of file AVI_avi.h.

◆ AVIF_TRUSTCKTYPE

#define AVIF_TRUSTCKTYPE   0x00000800

Definition at line 56 of file AVI_avi.h.

◆ AVIF_WASCAPTUREFILE

#define AVIF_WASCAPTUREFILE   0x00010000

specially allocated used for capturing real time video

Definition at line 58 of file AVI_avi.h.

◆ AVIIF_COMPRESSOR

#define AVIIF_COMPRESSOR   0x0FFF0000

Definition at line 133 of file AVI_avi.h.

◆ AVIIF_KEYFRAME

#define AVIIF_KEYFRAME   0x00000010

Definition at line 131 of file AVI_avi.h.

◆ AVIIF_LIST

#define AVIIF_LIST   0x00000001

Definition at line 130 of file AVI_avi.h.

◆ AVIIF_NO_TIME

#define AVIIF_NO_TIME   0x00000100

Definition at line 132 of file AVI_avi.h.

◆ AVISF_DISABLED

#define AVISF_DISABLED   0x00000001

Definition at line 82 of file AVI_avi.h.

◆ AVISF_VIDEO_PALCHANGES

#define AVISF_VIDEO_PALCHANGES   0x00010000

Definition at line 83 of file AVI_avi.h.

◆ AVIST_AUDIO

#define AVIST_AUDIO   FCC("auds")

Definition at line 76 of file AVI_avi.h.

◆ AVIST_MIDI

#define AVIST_MIDI   FCC("mids")

Definition at line 77 of file AVI_avi.h.

◆ AVIST_TEXT

#define AVIST_TEXT   FCC("txts")

Definition at line 78 of file AVI_avi.h.

◆ AVIST_VIDEO

#define AVIST_VIDEO   FCC("vids")

Definition at line 75 of file AVI_avi.h.

◆ FCC

#define FCC (   ch4)    (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)

This is a sort of MAKE_ID thing. Used in imbuf :( It is used through options in the AVI header (AviStreamHeader).

Definition at line 215 of file AVI_avi.h.

Typedef Documentation

◆ AviBitmapInfoHeader

◆ AviChunk

typedef struct _AviChunk AviChunk

◆ AviIndex

typedef struct _AviIndex AviIndex

◆ AviIndexEntry

typedef struct _AviIndexEntry AviIndexEntry

◆ AviList

typedef struct _AviList AviList

◆ AviMainHeader

typedef struct _AviMainHeader AviMainHeader

◆ AviMJPEGUnknown

◆ AviMovie

typedef struct _AviMovie AviMovie

◆ AviStreamHeader

◆ AviStreamRec

typedef struct _AviStreamRec AviStreamRec

Enumeration Type Documentation

◆ AviError

enum AviError
Enumerator
AVI_ERROR_NONE 
AVI_ERROR_COMPRESSION 
AVI_ERROR_OPEN 
AVI_ERROR_READING 
AVI_ERROR_WRITING 
AVI_ERROR_FORMAT 
AVI_ERROR_ALLOC 
AVI_ERROR_FOUND 
AVI_ERROR_OPTION 

Definition at line 185 of file AVI_avi.h.

◆ AviFormat

enum AviFormat
Enumerator
AVI_FORMAT_RGB24 

The most basic of forms, 3 bytes per pixel, 1 per r, g, b.

AVI_FORMAT_RGB32 

The second most basic of forms, 4 bytes per pixel, 1 per r, g, b, alpha.

AVI_FORMAT_AVI_RGB 

Same as above, but is in the weird AVI order (bottom to top, left to right).

AVI_FORMAT_MJPEG 

Motion-JPEG.

Definition at line 144 of file AVI_avi.h.

◆ AviOption

enum AviOption
Enumerator
AVI_OPTION_WIDTH 
AVI_OPTION_HEIGHT 
AVI_OPTION_QUALITY 
AVI_OPTION_FRAMERATE 

Definition at line 198 of file AVI_avi.h.

Function Documentation

◆ AVI_close()

AviError AVI_close ( AviMovie movie)

◆ AVI_close_compress()

AviError AVI_close_compress ( AviMovie movie)

◆ AVI_get_stream()

int AVI_get_stream ( AviMovie movie,
int  avist_type,
int  stream_num 
)

Direct the streams <avist_type> to <movie>. Redirect <stream_num> streams.

Definition at line 90 of file avi.c.

References AVI_ERROR_FOUND, AVI_ERROR_OPTION, _AviMovie::header, NULL, _AviStreamRec::sh, _AviMainHeader::Streams, _AviMovie::streams, and _AviStreamHeader::Type.

◆ AVI_is_avi()

bool AVI_is_avi ( const char *  name)

Test whether this is an avi-format.

Definition at line 187 of file avi.c.

References AVI_FORMAT_AVI_RGB, AVI_FORMAT_MJPEG, AVI_MOVIE_READ, _AviBitmapInfoHeader::BitCount, BLI_fopen(), BLI_fseek(), BLI_ftell(), _AviStreamHeader::bottom, _AviBitmapInfoHeader::ClrImportant, _AviBitmapInfoHeader::ClrUsed, _AviBitmapInfoHeader::Compression, DEBUG_PRINT, _AviMainHeader::fcc, _AviStreamHeader::fcc, _AviBitmapInfoHeader::fcc, FCC, _AviMainHeader::Flags, _AviStreamHeader::Flags, _AviStreamRec::format, _AviMovie::fp, GET_FCC(), GET_TCC(), _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, _AviBitmapInfoHeader::Height, _AviMainHeader::InitialFrames, _AviStreamHeader::InitialFrames, _AviStreamHeader::Language, _AviStreamHeader::left, _AviStreamHeader::Length, _AviMainHeader::MaxBytesPerSec, MEM_calloc_arrayN, MEM_freeN, _AviMainHeader::MicroSecPerFrame, NULL, _AviMovie::offset_table, _AviMainHeader::PaddingGranularity, _AviBitmapInfoHeader::Planes, _AviStreamHeader::Priority, _AviStreamHeader::Quality, _AviStreamHeader::Rate, _AviMainHeader::Reserved, _AviStreamHeader::right, _AviStreamHeader::SampleSize, _AviStreamHeader::Scale, _AviStreamRec::sf, _AviStreamRec::sf_size, _AviStreamRec::sh, _AviMainHeader::size, _AviStreamHeader::size, _AviBitmapInfoHeader::size, _AviBitmapInfoHeader::Size, _AviMovie::size, _AviBitmapInfoHeader::SizeImage, _AviStreamHeader::Start, _AviMainHeader::Streams, _AviMovie::streams, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviStreamHeader::Type, _AviMovie::type, _AviMainHeader::Width, _AviBitmapInfoHeader::Width, _AviBitmapInfoHeader::XPelsPerMeter, and _AviBitmapInfoHeader::YPelsPerMeter.

Referenced by isavi().

◆ AVI_open_compress()

AviError AVI_open_compress ( char *  name,
AviMovie movie,
int  streams,
  ... 
)

Open a compressed file, decompress it into memory.

Definition at line 695 of file avi.c.

References AVI_BITMAPH, AVI_CHUNK, AVI_ERROR_FORMAT, AVI_ERROR_NONE, AVI_ERROR_OPEN, avi_get_format_compression(), avi_get_format_fcc(), avi_get_format_type(), AVI_HDRL_SOFF, AVI_LIST, AVI_MAINH, AVI_MOVIE_WRITE, AVI_STREAMH, AVIF_HASINDEX, AVIF_MUSTUSEINDEX, awrite(), BLI_fopen(), BLI_fseek(), BLI_ftell(), _AviStreamHeader::bottom, DEBUG_PRINT, _AviMovie::entries, _AviChunk::fcc, _AviList::fcc, _AviMainHeader::fcc, _AviStreamHeader::fcc, FCC, _AviMainHeader::Flags, _AviStreamHeader::Flags, _AviStreamRec::format, _AviMovie::fp, _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, _AviList::ids, _AviMovie::index_entries, _AviMainHeader::InitialFrames, _AviStreamHeader::InitialFrames, _AviStreamHeader::Language, _AviStreamHeader::left, _AviStreamHeader::Length, _AviMainHeader::MaxBytesPerSec, MEM_mallocN, _AviMainHeader::MicroSecPerFrame, _AviMovie::movi_offset, NULL, _AviMovie::offset_table, _AviMainHeader::PaddingGranularity, _AviStreamHeader::Priority, PUT_FCCN, _AviStreamHeader::Quality, _AviStreamHeader::Rate, _AviMainHeader::Reserved, _AviStreamHeader::right, _AviStreamHeader::SampleSize, _AviStreamHeader::Scale, _AviStreamRec::sf, _AviStreamRec::sf_size, _AviStreamRec::sh, _AviChunk::size, _AviList::size, _AviMainHeader::size, _AviStreamHeader::size, _AviStreamHeader::Start, _AviMainHeader::Streams, _AviMovie::streams, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviStreamHeader::Type, _AviMovie::type, and _AviMainHeader::Width.

◆ AVI_open_movie()

AviError AVI_open_movie ( const char *  name,
AviMovie movie 
)

Open a movie stream from file.

Definition at line 378 of file avi.c.

References AVI_DEBUG, AVI_ERROR_COMPRESSION, AVI_ERROR_FORMAT, AVI_ERROR_NONE, AVI_ERROR_OPEN, AVI_FORMAT_AVI_RGB, AVI_FORMAT_MJPEG, AVI_MOVIE_READ, AVIF_HASINDEX, _AviBitmapInfoHeader::BitCount, BLI_fopen(), BLI_fseek(), BLI_ftell(), _AviStreamHeader::bottom, _AviIndexEntry::ChunkId, _AviBitmapInfoHeader::ClrImportant, _AviBitmapInfoHeader::ClrUsed, _AviBitmapInfoHeader::Compression, DEBUG_PRINT, _AviMovie::entries, _AviMainHeader::fcc, _AviStreamHeader::fcc, _AviBitmapInfoHeader::fcc, FCC, fcc_to_char(), _AviMainHeader::Flags, _AviStreamHeader::Flags, _AviIndexEntry::Flags, _AviStreamRec::format, _AviMovie::fp, GET_FCC(), GET_TCC(), _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, _AviBitmapInfoHeader::Height, _AviMovie::index_entries, _AviMainHeader::InitialFrames, _AviStreamHeader::InitialFrames, _AviStreamHeader::Language, _AviStreamHeader::left, _AviStreamHeader::Length, _AviMainHeader::MaxBytesPerSec, MEM_calloc_arrayN, MEM_mallocN, _AviMainHeader::MicroSecPerFrame, _AviMovie::movi_offset, NULL, _AviIndexEntry::Offset, _AviMovie::offset_table, _AviMainHeader::PaddingGranularity, _AviBitmapInfoHeader::Planes, _AviStreamHeader::Priority, _AviStreamHeader::Quality, _AviStreamHeader::Rate, _AviMovie::read_offset, _AviMainHeader::Reserved, _AviStreamHeader::right, _AviStreamHeader::SampleSize, _AviStreamHeader::Scale, _AviStreamRec::sf, _AviStreamRec::sf_size, _AviStreamRec::sh, size(), _AviMainHeader::size, _AviStreamHeader::size, _AviBitmapInfoHeader::size, _AviBitmapInfoHeader::Size, _AviIndexEntry::Size, _AviMovie::size, _AviBitmapInfoHeader::SizeImage, _AviStreamHeader::Start, _AviMainHeader::Streams, _AviMovie::streams, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviStreamHeader::Type, _AviMovie::type, _AviMainHeader::Width, _AviBitmapInfoHeader::Width, _AviBitmapInfoHeader::XPelsPerMeter, and _AviBitmapInfoHeader::YPelsPerMeter.

◆ AVI_print_error()

AviError AVI_print_error ( AviError  error)

◆ AVI_read_frame()

void* AVI_read_frame ( AviMovie movie,
AviFormat  format,
int  frame,
int  stream 
)

◆ AVI_set_compress_option()

AviError AVI_set_compress_option ( AviMovie movie,
int  option_type,
int  stream,
AviOption  option,
void opt_data 
)

◆ AVI_write_frame()

AviError AVI_write_frame ( AviMovie movie,
int  frame_num,
  ... 
)