FileBase Class Reference

#include <filebase.h>

Inherited by FileAC3, FileAVI, FileCR2, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, FileSndFile, FileVorbis, and FileYUV.

Collaboration diagram for FileBase:

Collaboration graph
[legend]

Public Member Functions

 FileBase (Asset *asset, File *file)
virtual ~FileBase ()
int get_mode (char *mode, int rd, int wr)
int reset_parameters ()
virtual void get_parameters (BC_WindowBase *parent_window, Asset *asset, BC_WindowBase **format_window, int audio_options, int video_options, int lock_compressor)
virtual int get_index (char *index_path)
virtual int check_header ()
virtual int reset_parameters_derived ()
virtual int read_header ()
virtual int open_file (int rd, int wr)
virtual int close_file ()
virtual int close_file_derived ()
int set_dither ()
virtual int seek_end ()
virtual int seek_start ()
virtual int64_t get_video_position ()
virtual int64_t get_audio_position ()
virtual int set_video_position (int64_t x)
virtual int set_audio_position (int64_t x)
virtual int64_t get_memory_usage ()
virtual int write_samples (double **buffer, int64_t len)
virtual int write_frames (VFrame ***frames, int len)
virtual int read_compressed_frame (VFrame *buffer)
virtual int write_compressed_frame (VFrame *buffers)
virtual int64_t compressed_frame_size ()
virtual int read_samples (double *buffer, int64_t len)
virtual int prefer_samples_float ()
virtual int read_samples_float (float *buffer, int64_t len)
virtual int read_frame (VFrame *frame)
virtual int colormodel_supported (int colormodel)
virtual int can_copy_from (Edit *edit, int64_t position)
virtual int get_render_strategy (ArrayList< int > *render_strategies)

Protected Member Functions

int64_t samples_to_raw (char *out_buffer, float **in_buffer, int64_t input_len, int bits, int channels, int byte_order, int signed_)
int raw_to_samples (float *out_buffer, char *in_buffer, int64_t samples, int bits, int channels, int channel, int feather, float lfeather_len, float lfeather_gain, float lfeather_slope)
int overlay_float_buffer (float *out_buffer, float *in_buffer, int64_t samples, float lfeather_len, float lfeather_gain, float lfeather_slope)
int64_t frame_to_raw (unsigned char *out_buffer, VFrame *in_frame, int w, int h, int use_alpha, int use_float, int color_model)
int get_audio_buffer (char **buffer, int64_t len, int64_t bits, int64_t channels)
int get_float_buffer (float **buffer, int64_t len)
int get_video_buffer (unsigned char **buffer, int depth)
int get_row_pointers (unsigned char *buffer, unsigned char ***pointers, int depth)
int64_t ima4_samples_to_bytes (int64_t samples, int channels)
int64_t ima4_bytes_to_samples (int64_t bytes, int channels)

Static Protected Member Functions

static int search_render_strategies (ArrayList< int > *render_strategies, int render_strategy)
static int match4 (char *in, char *out)

Protected Attributes

char * audio_buffer_in
char * audio_buffer_out
float * float_buffer
unsigned char * video_buffer_in
unsigned char * video_buffer_out
unsigned char ** row_pointers_in
unsigned char ** row_pointers_out
int64_t prev_buffer_position
int64_t prev_frame_position
int64_t prev_bytes
int64_t prev_len
int prev_track
int prev_layer
Assetasset
int wr
int rd
int dither
int internal_byte_order
Filefile

Private Member Functions

float ulawtofloat (char ulaw)
char floattoulaw (float value)
int generate_ulaw_tables ()
int delete_ulaw_tables ()
int init_ima4 ()
int delete_ima4 ()
int ima4_decode_block (int16_t *output, unsigned char *input)
int ima4_decode_sample (int *predictor, int nibble, int *index, int *step)
int ima4_encode_block (unsigned char *output, int16_t *input, int step, int channel)
int ima4_encode_sample (int *last_sample, int *last_index, int *nibble, int next_sample)

Private Attributes

float * ulawtofloat_table
float * ulawtofloat_ptr
unsigned char * floattoulaw_table
unsigned char * floattoulaw_ptr
int * last_ima4_samples
int * last_ima4_indexes
int ima4_block_size
int ima4_block_samples
OverlayFrameoverlayer

Static Private Attributes

static int ima4_step [89]
static int ima4_index [16]

Friends

class File
class FileList
class FrameWriter

Detailed Description

Definition at line 18 of file filebase.h.


Constructor & Destructor Documentation

FileBase::FileBase ( Asset asset,
File file 
)

Definition at line 12 of file filebase.C.

References get_byte_order(), init_ima4(), internal_byte_order, overlayer, and reset_parameters().

Here is the call graph for this function:

FileBase::~FileBase (  )  [virtual]

Definition at line 22 of file filebase.C.

References audio_buffer_in, audio_buffer_out, delete_ima4(), float_buffer, overlayer, row_pointers_in, row_pointers_out, video_buffer_in, and video_buffer_out.

Here is the call graph for this function:


Member Function Documentation

int FileBase::get_mode ( char *  mode,
int  rd,
int  wr 
)

Definition at line 79 of file filebase.C.

References asset, fclose(), fopen(), and Asset::path.

Here is the call graph for this function:

int FileBase::reset_parameters (  ) 

virtual void FileBase::get_parameters ( BC_WindowBase parent_window,
Asset asset,
BC_WindowBase **  format_window,
int  audio_options,
int  video_options,
int  lock_compressor 
) [inline, virtual]

Definition at line 37 of file filebase.h.

virtual int FileBase::get_index ( char *  index_path  )  [inline, virtual]

Reimplemented in FileMPEG.

Definition at line 46 of file filebase.h.

Referenced by File::get_index().

virtual int FileBase::check_header (  )  [inline, virtual]

Definition at line 47 of file filebase.h.

virtual int FileBase::reset_parameters_derived (  )  [inline, virtual]

Reimplemented in FileAC3, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, and FileVorbis.

Definition at line 48 of file filebase.h.

Referenced by reset_parameters().

virtual int FileBase::read_header (  )  [inline, virtual]

Reimplemented in FileGIF.

Definition at line 49 of file filebase.h.

virtual int FileBase::open_file ( int  rd,
int  wr 
) [inline, virtual]

Reimplemented in FileAC3, FileAVI, FileCR2, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, FileSndFile, FileVorbis, and FileYUV.

Definition at line 50 of file filebase.h.

Referenced by File::open_file().

int FileBase::close_file (  )  [virtual]

virtual int FileBase::close_file_derived (  )  [inline, virtual]

Reimplemented in FileDV, FileGIF, and FileOGG.

Definition at line 52 of file filebase.h.

Referenced by close_file().

int FileBase::set_dither (  ) 

Definition at line 49 of file filebase.C.

References dither.

Referenced by File::open_file().

virtual int FileBase::seek_end (  )  [inline, virtual]

Definition at line 54 of file filebase.h.

virtual int FileBase::seek_start (  )  [inline, virtual]

Definition at line 55 of file filebase.h.

virtual int64_t FileBase::get_video_position (  )  [inline, virtual]

Reimplemented in FileDV, and FileOGG.

Definition at line 56 of file filebase.h.

virtual int64_t FileBase::get_audio_position (  )  [inline, virtual]

Reimplemented in FileDV, and FileOGG.

Definition at line 57 of file filebase.h.

virtual int FileBase::set_video_position ( int64_t  x  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 58 of file filebase.h.

Referenced by File::set_video_position().

virtual int FileBase::set_audio_position ( int64_t  x  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, and FileSndFile.

Definition at line 59 of file filebase.h.

Referenced by File::set_audio_position().

virtual int64_t FileBase::get_memory_usage (  )  [inline, virtual]

Reimplemented in FileEXR, FileGIF, FileList, FileMOV, FileMPEG, and FileTGA.

Definition at line 63 of file filebase.h.

Referenced by File::get_memory_usage().

virtual int FileBase::write_samples ( double **  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileAC3, FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, FileSndFile, and FileVorbis.

Definition at line 65 of file filebase.h.

Referenced by File::write_samples().

virtual int FileBase::write_frames ( VFrame ***  frames,
int  len 
) [inline, virtual]

Reimplemented in FileAVI, FileDV, FileList, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 67 of file filebase.h.

Referenced by File::write_frames().

virtual int FileBase::read_compressed_frame ( VFrame buffer  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 68 of file filebase.h.

Referenced by File::read_compressed_frame().

virtual int FileBase::write_compressed_frame ( VFrame buffers  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 69 of file filebase.h.

Referenced by File::write_compressed_frame().

virtual int64_t FileBase::compressed_frame_size (  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 70 of file filebase.h.

Referenced by File::compressed_frame_size().

virtual int FileBase::read_samples ( double *  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, FileSndFile, and FileVorbis.

Definition at line 72 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::prefer_samples_float (  )  [inline, virtual]

Reimplemented in FileMPEG, and FileVorbis.

Definition at line 75 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::read_samples_float ( float *  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileMPEG, and FileVorbis.

Definition at line 76 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::read_frame ( VFrame frame  )  [inline, virtual]

Reimplemented in FileAVI, FileCR2, FileDV, FileList, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 78 of file filebase.h.

Referenced by File::read_frame().

virtual int FileBase::colormodel_supported ( int  colormodel  )  [inline, virtual]

Reimplemented in FileCR2, FileDV, FileEXR, FileJPEG, FileMOV, FileMPEG, FileOGG, FilePNG, FileTGA, FileTIFF, and FileYUV.

Definition at line 82 of file filebase.h.

References BC_RGB888.

Referenced by File::colormodel_supported().

virtual int FileBase::can_copy_from ( Edit edit,
int64_t  position 
) [inline, virtual]

Reimplemented in FileDV, FileJPEG, FileMOV, FileMPEG, FilePNG, FileTGA, FileTIFF, and FileYUV.

Definition at line 84 of file filebase.h.

Referenced by File::can_copy_from().

virtual int FileBase::get_render_strategy ( ArrayList< int > *  render_strategies  )  [inline, virtual]

Definition at line 85 of file filebase.h.

int FileBase::search_render_strategies ( ArrayList< int > *  render_strategies,
int  render_strategy 
) [static, protected]

Definition at line 155 of file filebase.C.

References ArrayList< TYPE >::total, and ArrayList< TYPE >::values.

int64_t FileBase::samples_to_raw ( char *  out_buffer,
float **  in_buffer,
int64_t  input_len,
int  bits,
int  channels,
int  byte_order,
int  signed_ 
) [protected]

Definition at line 7 of file filebaseaudio.C.

References asset, bytes, File::bytes_per_sample(), Asset::channels, dither, file, floattoulaw(), generate_ulaw_tables(), get_byte_order(), and swap_bytes().

Here is the call graph for this function:

int FileBase::raw_to_samples ( float *  out_buffer,
char *  in_buffer,
int64_t  samples,
int  bits,
int  channels,
int  channel,
int  feather,
float  lfeather_len,
float  lfeather_gain,
float  lfeather_slope 
) [protected]

int FileBase::overlay_float_buffer ( float *  out_buffer,
float *  in_buffer,
int64_t  samples,
float  lfeather_len,
float  lfeather_gain,
float  lfeather_slope 
) [protected]

Definition at line 349 of file filebaseaudio.C.

References CENTER_MACRO1, CENTER_MACRO2, LFEATHER_MACRO1, and LFEATHER_MACRO2.

int64_t FileBase::frame_to_raw ( unsigned char *  out_buffer,
VFrame in_frame,
int  w,
int  h,
int  use_alpha,
int  use_float,
int  color_model 
) [protected]

int FileBase::get_audio_buffer ( char **  buffer,
int64_t  len,
int64_t  bits,
int64_t  channels 
) [protected]

Definition at line 369 of file filebaseaudio.C.

References bytes, File::bytes_per_sample(), file, and prev_bytes.

Here is the call graph for this function:

int FileBase::get_float_buffer ( float **  buffer,
int64_t  len 
) [protected]

Definition at line 382 of file filebaseaudio.C.

References prev_len.

int FileBase::get_video_buffer ( unsigned char **  buffer,
int  depth 
) [protected]

Definition at line 113 of file filebase.C.

References asset, bytes, Asset::height, and Asset::width.

int FileBase::get_row_pointers ( unsigned char *  buffer,
unsigned char ***  pointers,
int  depth 
) [protected]

Definition at line 125 of file filebase.C.

References asset, Asset::height, and Asset::width.

int FileBase::match4 ( char *  in,
char *  out 
) [static, protected]

int64_t FileBase::ima4_samples_to_bytes ( int64_t  samples,
int  channels 
) [protected]

Definition at line 235 of file filebaseima4.C.

References bytes, ima4_block_samples, and ima4_block_size.

int64_t FileBase::ima4_bytes_to_samples ( int64_t  bytes,
int  channels 
) [protected]

Definition at line 241 of file filebaseima4.C.

References ima4_block_samples, ima4_block_size, and samples.

float FileBase::ulawtofloat ( char  ulaw  )  [private]

Definition at line 9 of file filebaseulaw.C.

References ulawtofloat_ptr.

char FileBase::floattoulaw ( float  value  )  [private]

Definition at line 15 of file filebaseulaw.C.

References floattoulaw_ptr.

Referenced by samples_to_raw().

int FileBase::generate_ulaw_tables (  )  [private]

int FileBase::delete_ulaw_tables (  )  [private]

Definition at line 101 of file filebaseulaw.C.

References floattoulaw_table, and ulawtofloat_table.

Referenced by reset_parameters().

int FileBase::init_ima4 (  )  [private]

int FileBase::delete_ima4 (  )  [private]

Definition at line 36 of file filebaseima4.C.

References last_ima4_indexes, and last_ima4_samples.

Referenced by close_file(), and ~FileBase().

int FileBase::ima4_decode_block ( int16_t *  output,
unsigned char *  input 
) [private]

Definition at line 44 of file filebaseima4.C.

int FileBase::ima4_decode_sample ( int *  predictor,
int  nibble,
int *  index,
int *  step 
) [private]

Definition at line 91 of file filebaseima4.C.

References ima4_index, and ima4_step.

int FileBase::ima4_encode_block ( unsigned char *  output,
int16_t *  input,
int  step,
int  channel 
) [private]

Definition at line 129 of file filebaseima4.C.

References asset, Asset::channels, ima4_block_size, ima4_encode_sample(), last_ima4_indexes, and last_ima4_samples.

Here is the call graph for this function:

int FileBase::ima4_encode_sample ( int *  last_sample,
int *  last_index,
int *  nibble,
int  next_sample 
) [private]

Definition at line 186 of file filebaseima4.C.

References ima4_index, ima4_step, and step.

Referenced by ima4_encode_block().


Friends And Related Function Documentation

friend class File [friend]

Definition at line 25 of file filebase.h.

friend class FileList [friend]

Definition at line 26 of file filebase.h.

friend class FrameWriter [friend]

Definition at line 27 of file filebase.h.

Referenced by FileList::open_file().


Field Documentation

char* FileBase::audio_buffer_in [protected]

Definition at line 134 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

char * FileBase::audio_buffer_out [protected]

Definition at line 134 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

float* FileBase::float_buffer [protected]

Definition at line 135 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char* FileBase::video_buffer_in [protected]

Definition at line 136 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char * FileBase::video_buffer_out [protected]

Definition at line