Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include "MEM_guardedalloc.h"
#include "MEM_sys_types.h"
#include "BLI_winstuff.h"
#include "AVI_avi.h"
#include "avi_intern.h"
#include "endian.h"
Go to the source code of this file.
Defines | |
#define | DEBUG_PRINT(x) if(AVI_DEBUG) printf("AVI DEBUG: " x); |
Functions | |
char * | fcc_to_char (unsigned int fcc) |
char * | tcc_to_char (unsigned int tcc) |
unsigned int | GET_FCC (FILE *fp) |
unsigned int | GET_TCC (FILE *fp) |
int | AVI_get_stream (AviMovie *movie, int avist_type, int stream_num) |
static int | fcc_get_stream (int fcc) |
static int | fcc_is_data (int fcc) |
AviError | AVI_print_error (AviError in_error) |
int | AVI_is_avi (const char *name) |
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_open_compress (char *name, AviMovie *movie, int streams,...) |
AviError | AVI_write_frame (AviMovie *movie, int frame_num,...) |
AviError | AVI_close_compress (AviMovie *movie) |
Variables | |
static int | AVI_DEBUG = 0 |
static char | DEBUG_FCC [4] |
Definition in file avi.c.
#define DEBUG_PRINT | ( | x | ) | if(AVI_DEBUG) printf("AVI DEBUG: " x); |
Definition at line 56 of file avi.c.
Referenced by AVI_is_avi(), and AVI_open_movie().
Close an open movie stream.
Definition at line 701 of file avi.c.
References AVI_ERROR_NONE, _AviMovie::entries, _AviMovie::fp, _AviMovie::header, i, MEM_freeN(), NULL, _AviMovie::offset_table, _AviStreamRec::sf, _AviMovie::streams, and _AviMainHeader::Streams.
Referenced by free_anim_avi().
Finalize a compressed output stream.
Definition at line 1022 of file avi.c.
References AVI_ERROR_NONE, AVI_INDEXE, AVI_RIFF_SOFF, awrite(), _AviMovie::entries, _AviMovie::fp, _AviMovie::header, i, _AviMovie::index_entries, L, MEM_freeN(), _AviMovie::movi_offset, NULL, _AviMovie::offset_table, PUT_FCC, PUT_FCCN, _AviStreamRec::sf, _AviMovie::streams, and _AviMainHeader::Streams.
Referenced by end_avi(), and index_rebuild_fallback().
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().
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().
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().
Unused but still external
Definition at line 158 of file avi.c.
References AVI_ERROR_ALLOC, AVI_ERROR_COMPRESSION, AVI_ERROR_FORMAT, AVI_ERROR_FOUND, AVI_ERROR_NONE, AVI_ERROR_OPEN, AVI_ERROR_OPTION, AVI_ERROR_READING, AVI_ERROR_WRITING, and error().
Referenced by startavi().
Read a frame from a movie stream.
Definition at line 656 of file avi.c.
References avi_format_convert(), _AviIndexEntry::ChunkId, _AviMovie::entries, fcc_get_stream(), fcc_is_data(), _AviStreamRec::format, _AviMovie::fp, GET_FCC(), i, MEM_freeN(), MEM_mallocN(), NULL, _AviIndexEntry::Offset, _AviMovie::read_offset, _AviIndexEntry::Size, and _AviMovie::streams.
Referenced by avi_fetchibuf().
Write frames to a movie stream.
Definition at line 914 of file avi.c.
References AVI_CHUNK, AVI_ERROR_NONE, AVI_ERROR_OPTION, avi_format_convert(), avi_get_data_id(), AVI_LIST, AVI_MAINH, AVI_RAW, AVI_STREAMH, AVIIF_KEYFRAME, AVIIF_LIST, awrite(), _AviMovie::entries, _AviChunk::fcc, _AviList::fcc, FCC, _AviIndexEntry::Flags, _AviStreamRec::format, _AviMovie::fp, _AviMovie::header, _AviList::ids, _AviMovie::index_entries, L, _AviStreamHeader::Length, MEM_freeN(), MEM_mallocN(), _AviMovie::movi_offset, NULL, _AviMovie::offset_table, PUT_FCCN, _AviStreamRec::sh, _AviChunk::size, _AviIndexEntry::Size, size(), _AviList::size, _AviMovie::streams, _AviMainHeader::Streams, and _AviMainHeader::TotalFrames.
Referenced by append_avi(), and index_rebuild_fallback().
static int fcc_get_stream | ( | int | fcc | ) | [static] |
Definition at line 129 of file avi.c.
Referenced by AVI_read_frame().
static int fcc_is_data | ( | int | fcc | ) | [static] |
Definition at line 141 of file avi.c.
Referenced by AVI_read_frame().
char * fcc_to_char | ( | unsigned int | fcc | ) |
unsigned int GET_FCC | ( | FILE * | fp | ) |
Definition at line 66 of file avi.c.
References FCC.
Referenced by AVI_is_avi(), AVI_open_movie(), and AVI_read_frame().
unsigned int GET_TCC | ( | FILE * | fp | ) |
Definition at line 78 of file avi.c.
References FCC.
Referenced by AVI_is_avi(), and AVI_open_movie().
int AVI_DEBUG = 0 [static] |
Definition at line 53 of file avi.c.
Referenced by AVI_open_movie().
char DEBUG_FCC[4] [static] |
Definition at line 54 of file avi.c.
Referenced by fcc_to_char(), and tcc_to_char().