Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

AVI_avi.h File Reference

#include "MEM_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

Defines

#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

int 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)
void * AVI_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)
void AVI_set_debug (int mode)

Detailed Description

AVI module external interface

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.


Define Documentation

#define AVI_HDRL_SOFF   16L

Definition at line 228 of file AVI_avi.h.

Referenced by AVI_open_compress().

#define AVI_MOVIE_READ   0

Definition at line 184 of file AVI_avi.h.

Referenced by AVI_is_avi(), and AVI_open_movie().

#define AVI_MOVIE_WRITE   1

Definition at line 185 of file AVI_avi.h.

Referenced by AVI_open_compress().

#define AVI_OPTION_TYPE_MAIN   0

Compression option, for use in avi_set_compress_option

Definition at line 264 of file AVI_avi.h.

Referenced by alloc_proxy_output_avi(), AVI_set_compress_option(), and start_avi().

#define AVI_OPTION_TYPE_STRF   2

Compression option, for use in avi_set_compress_option

Definition at line 272 of file AVI_avi.h.

Referenced by AVI_set_compress_option().

#define AVI_OPTION_TYPE_STRH   1

Compression option, for use in avi_set_compress_option

Definition at line 268 of file AVI_avi.h.

Referenced by AVI_set_compress_option().

#define AVI_RIFF_SOFF   4L

Definition at line 227 of file AVI_avi.h.

Referenced by AVI_close_compress().

#define AVIF_COPYRIGHTED   0x00020000

Definition at line 82 of file AVI_avi.h.

#define AVIF_HASINDEX   0x00000010

Definition at line 77 of file AVI_avi.h.

Referenced by AVI_open_compress(), and AVI_open_movie().

#define AVIF_ISINTERLEAVED   0x00000100

Definition at line 79 of file AVI_avi.h.

#define AVIF_MUSTUSEINDEX   0x00000020

Definition at line 78 of file AVI_avi.h.

Referenced by AVI_open_compress().

#define AVIF_TRUSTCKTYPE   0x00000800

Definition at line 80 of file AVI_avi.h.

#define AVIF_WASCAPTUREFILE   0x00010000

Definition at line 81 of file AVI_avi.h.

#define AVIIF_COMPRESSOR   0x0FFF0000

Definition at line 155 of file AVI_avi.h.

#define AVIIF_KEYFRAME   0x00000010

Definition at line 153 of file AVI_avi.h.

Referenced by AVI_write_frame().

#define AVIIF_LIST   0x00000001

Definition at line 152 of file AVI_avi.h.

Referenced by AVI_write_frame().

#define AVIIF_NO_TIME   0x00000100

Definition at line 154 of file AVI_avi.h.

#define AVISF_DISABLED   0x00000001

Definition at line 104 of file AVI_avi.h.

#define AVISF_VIDEO_PALCHANGES   0x00010000

Definition at line 105 of file AVI_avi.h.

#define AVIST_AUDIO   FCC("auds")

Definition at line 98 of file AVI_avi.h.

#define AVIST_MIDI   FCC("mids")

Definition at line 99 of file AVI_avi.h.

#define AVIST_TEXT   FCC("txts")

Definition at line 100 of file AVI_avi.h.

#define AVIST_VIDEO   FCC("vids")

Definition at line 97 of file AVI_avi.h.

Referenced by avi_fetchibuf().

#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 233 of file AVI_avi.h.

Referenced by avi_get_data_id(), avi_get_format_compression(), avi_get_format_fcc(), avi_get_format_type(), AVI_is_avi(), AVI_open_compress(), AVI_open_movie(), AVI_set_compress_option(), AVI_write_frame(), GET_FCC(), and GET_TCC().


Typedef Documentation

typedef struct _AviChunk AviChunk
typedef struct _AviIndex AviIndex
typedef struct _AviIndexEntry AviIndexEntry
typedef struct _AviList AviList
typedef struct _AviMainHeader AviMainHeader
typedef struct _AviMovie AviMovie
typedef struct _AviStreamRec AviStreamRec

Enumeration Type Documentation

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 203 of file AVI_avi.h.

enum AviFormat
Enumerator:
AVI_FORMAT_RGB24 
AVI_FORMAT_RGB32 
AVI_FORMAT_AVI_RGB 
AVI_FORMAT_MJPEG 

Definition at line 166 of file AVI_avi.h.

enum AviOption
Enumerator:
AVI_OPTION_WIDTH 
AVI_OPTION_HEIGHT 
AVI_OPTION_QUALITY 
AVI_OPTION_FRAMERATE 

Definition at line 216 of file AVI_avi.h.


Function Documentation

AviError AVI_close ( AviMovie movie)
AviError AVI_close_compress ( AviMovie movie)
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 110 of file avi.c.

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

Referenced by avi_fetchibuf().

int AVI_is_avi ( const char *  name)

Test whether this is an avi-format.

Definition at line 229 of file avi.c.

References AVI_FORMAT_AVI_RGB, AVI_FORMAT_MJPEG, AVI_MOVIE_READ, _AviBitmapInfoHeader::BitCount, _AviStreamHeader::bottom, _AviBitmapInfoHeader::ClrImportant, _AviBitmapInfoHeader::ClrUsed, _AviBitmapInfoHeader::Compression, DEBUG_PRINT, _AviStreamHeader::fcc, _AviMainHeader::fcc, FCC, _AviBitmapInfoHeader::fcc, _AviStreamHeader::Flags, _AviMainHeader::Flags, _AviStreamRec::format, _AviMovie::fp, GET_FCC(), GET_TCC(), _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, _AviBitmapInfoHeader::Height, _AviStreamHeader::InitialFrames, _AviMainHeader::InitialFrames, L, _AviStreamHeader::Language, _AviStreamHeader::left, _AviStreamHeader::Length, _AviMainHeader::MaxBytesPerSec, MEM_callocN(), 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, _AviStreamHeader::size, _AviBitmapInfoHeader::Size, _AviMovie::size, _AviMainHeader::size, _AviBitmapInfoHeader::size, _AviBitmapInfoHeader::SizeImage, _AviStreamHeader::Start, _AviMovie::streams, _AviMainHeader::Streams, _AviStreamHeader::SuggestedBufferSize, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviMovie::type, _AviStreamHeader::Type, _AviMainHeader::Width, _AviBitmapInfoHeader::Width, _AviBitmapInfoHeader::XPelsPerMeter, and _AviBitmapInfoHeader::YPelsPerMeter.

Referenced by isavi().

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

Open a compressed file, decompress it into memory.

Definition at line 724 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(), _AviStreamHeader::bottom, _AviMovie::entries, _AviStreamHeader::fcc, _AviChunk::fcc, _AviMainHeader::fcc, FCC, _AviList::fcc, _AviStreamHeader::Flags, _AviMainHeader::Flags, _AviStreamRec::format, _AviMovie::fp, _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, i, _AviList::ids, _AviMovie::index_entries, _AviStreamHeader::InitialFrames, _AviMainHeader::InitialFrames, L, _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, _AviStreamHeader::size, _AviChunk::size, _AviMainHeader::size, _AviList::size, _AviStreamHeader::Start, _AviMovie::streams, _AviMainHeader::Streams, _AviStreamHeader::SuggestedBufferSize, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviMovie::type, _AviStreamHeader::Type, and _AviMainHeader::Width.

Referenced by alloc_proxy_output_avi(), and start_avi().

AviError AVI_open_movie ( const char *  name,
AviMovie movie 
)

Open a movie stream from file.

Definition at line 421 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, _AviStreamHeader::bottom, _AviIndexEntry::ChunkId, _AviBitmapInfoHeader::ClrImportant, _AviBitmapInfoHeader::ClrUsed, _AviBitmapInfoHeader::Compression, DEBUG_PRINT, _AviMovie::entries, _AviStreamHeader::fcc, _AviMainHeader::fcc, FCC, _AviBitmapInfoHeader::fcc, fcc_to_char(), _AviStreamHeader::Flags, _AviMainHeader::Flags, _AviIndexEntry::Flags, _AviStreamRec::format, _AviMovie::fp, GET_FCC(), GET_TCC(), _AviStreamHeader::Handler, _AviMovie::header, _AviMainHeader::Height, _AviBitmapInfoHeader::Height, _AviMovie::index_entries, _AviStreamHeader::InitialFrames, _AviMainHeader::InitialFrames, L, _AviStreamHeader::Language, _AviStreamHeader::left, _AviStreamHeader::Length, _AviMainHeader::MaxBytesPerSec, MEM_callocN(), 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, _AviStreamHeader::size, _AviBitmapInfoHeader::Size, _AviMovie::size, _AviIndexEntry::Size, _AviMainHeader::size, size(), _AviBitmapInfoHeader::size, _AviBitmapInfoHeader::SizeImage, _AviStreamHeader::Start, _AviMovie::streams, _AviMainHeader::Streams, _AviStreamHeader::SuggestedBufferSize, _AviMainHeader::SuggestedBufferSize, _AviStreamHeader::top, _AviMainHeader::TotalFrames, _AviMovie::type, _AviStreamHeader::Type, _AviMainHeader::Width, _AviBitmapInfoHeader::Width, _AviBitmapInfoHeader::XPelsPerMeter, and _AviBitmapInfoHeader::YPelsPerMeter.

Referenced by startavi().

AviError AVI_print_error ( AviError  error)
void* AVI_read_frame ( AviMovie movie,
AviFormat  format,
int  frame,
int  stream 
)
AviError AVI_set_compress_option ( AviMovie movie,
int  option_type,
int  stream,
AviOption  option,
void *  opt_data 
)
void AVI_set_debug ( int  mode)
AviError AVI_write_frame ( AviMovie movie,
int  frame_num,
  ... 
)