Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

FileMPEG Class Reference

#include <filempeg.h>

Inheritance diagram for FileMPEG:

FileBase List of all members.

Public Member Functions

 FileMPEG (Asset *asset, File *file)
 ~FileMPEG ()
int open_file (int rd, int wr)
int close_file ()
int create_index ()
int get_index (char *index_path)
int set_video_position (int64_t x)
int set_audio_position (int64_t x)
int write_samples (double **buffer, int64_t len)
int write_frames (VFrame ***frames, int len)
int read_frame (VFrame *frame)
int read_samples (double *buffer, int64_t len)
int read_samples_float (float *buffer, int64_t len)
int prefer_samples_float ()
int colormodel_supported (int colormodel)
int can_copy_from (Edit *edit, int64_t position)

Static Public Member Functions

static void get_parameters (BC_WindowBase *parent_window, Asset *asset, BC_WindowBase *&format_window, int audio_options, int video_options)
static int check_sig (Asset *asset)
static int get_best_colormodel (Asset *asset, int driver)
static char * strtocompression (char *string)
static char * compressiontostr (char *string)

Private Member Functions

void to_streamchannel (int channel, int &stream_out, int &channel_out)
int reset_parameters_derived ()
void append_vcommand_line (const char *string)
void append_acommand_line (const char *string)

Private Attributes

mpeg3_t * fd
FileMPEGVideovideo_out
ArrayList< char * > vcommand_line
FILE * mjpeg_out
int mjpeg_error
Condition * next_frame_lock
Condition * next_frame_done
int mjpeg_eof
int wrote_header
unsigned char * mjpeg_y
unsigned char * mjpeg_u
unsigned char * mjpeg_v
char mjpeg_command [BCTEXTLEN]
FileMPEGAudioaudio_out
ArrayList< char * > acommand_line
VFrame * temp_frame
unsigned char * toolame_temp
int toolame_allocation
int toolame_result
float * lame_temp [2]
int lame_allocation
char * lame_output
int lame_output_allocation
FILE * lame_fd
int lame_started
lame_global_flags * lame_global

Friends

class FileMPEGVideo
class FileMPEGAudio

Detailed Description

Definition at line 38 of file filempeg.h.


Constructor & Destructor Documentation

FileMPEG::FileMPEG Asset asset,
File file
 

Definition at line 67 of file filempeg.C.

References Asset::byte_order, Asset::format, next_frame_done, next_frame_lock, and FileBase::reset_parameters().

FileMPEG::~FileMPEG  ) 
 

Definition at line 78 of file filempeg.C.

References close_file(), next_frame_done, and next_frame_lock.


Member Function Documentation

void FileMPEG::append_acommand_line const char *  string  )  [private]
 

Definition at line 560 of file filempeg.C.

References acommand_line.

Referenced by open_file().

void FileMPEG::append_vcommand_line const char *  string  )  [private]
 

Definition at line 551 of file filempeg.C.

References vcommand_line.

Referenced by open_file().

int FileMPEG::can_copy_from Edit edit,
int64_t  position
[virtual]
 

Reimplemented from FileBase.

Definition at line 717 of file filempeg.C.

References fd.

int FileMPEG::check_sig Asset asset  )  [static]
 

Definition at line 110 of file filempeg.C.

References Asset::path.

Referenced by File::open_file().

int FileMPEG::close_file  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 570 of file filempeg.C.

References acommand_line, File::asset, audio_out, FileBase::close_file(), fclose(), fd, FileBase::file, lame_fd, lame_global, lame_output, lame_temp, mjpeg_eof, mjpeg_out, mpeg2enc_set_input_buffers(), MPEG_YUV422, next_frame_lock, FileBase::reset_parameters(), temp_frame, toolame_send_buffer(), toolame_temp, vcommand_line, video_out, and Asset::vmpeg_cmodel.

Referenced by ~FileMPEG().

int FileMPEG::colormodel_supported int  colormodel  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 658 of file filempeg.C.

char * FileMPEG::compressiontostr char *  string  )  [static]
 

Definition at line 1189 of file filempeg.C.

int FileMPEG::create_index  ) 
 

Definition at line 445 of file filempeg.C.

References FileBase::asset, fclose(), fd, FileBase::file, fopen(), IndexFile::get_index_filename(), Preferences::index_directory, Asset::path, File::preferences, and remove().

Referenced by open_file().

int FileMPEG::get_best_colormodel Asset asset,
int  driver
[static]
 

Definition at line 619 of file filempeg.C.

References MPEG_YUV420, MPEG_YUV422, and Asset::vmpeg_cmodel.

Referenced by File::get_best_colormodel().

int FileMPEG::get_index char *  index_path  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 663 of file filempeg.C.

References FileBase::asset, Asset::channels, fd, Asset::index_buffer, Asset::index_bytes, Asset::index_offsets, Asset::index_sizes, Asset::index_zoom, Asset::path, and Asset::write_index().

void FileMPEG::get_parameters BC_WindowBase *  parent_window,
Asset asset,
BC_WindowBase *&  format_window,
int  audio_options,
int  video_options
[static]
 

Definition at line 85 of file filempeg.C.

References MPEGConfigVideo::create_objects(), MPEGConfigAudio::create_objects(), and Asset::format.

Referenced by File::get_options().

int FileMPEG::open_file int  rd,
int  wr
[virtual]
 

Reimplemented from FileBase.

Definition at line 145 of file filempeg.C.

References _, Asset::ampeg_bitrate, Asset::ampeg_derivative, append_acommand_line(), append_vcommand_line(), Asset::aspect_ratio, aspect_ratio_codes, FileBase::asset, Asset::audio_data, Asset::audio_length, audio_out, Asset::channels, CLAMP, File::cpus, create_index(), fd, FileBase::file, FileMPEGAudio, FileMPEGVideo, fopen(), Asset::format, Asset::frame_rate, frame_rate_codes, Asset::height, Asset::interlace_mode, lame_fd, lame_global, Asset::layers, mjpeg_command, MJPEG_EXE, mjpeg_out, MPEG_YUV420, MPEG_YUV422, Asset::path, Asset::sample_rate, Asset::video_data, Asset::video_length, video_out, Asset::vmpeg_bitrate, Asset::vmpeg_cmodel, Asset::vmpeg_denoise, Asset::vmpeg_derivative, Asset::vmpeg_field_order, Asset::vmpeg_fix_bitrate, Asset::vmpeg_iframe_distance, Asset::vmpeg_pframe_distance, Asset::vmpeg_preset, Asset::vmpeg_progressive, Asset::vmpeg_quantization, Asset::vmpeg_seq_codes, and Asset::width.

int FileMPEG::prefer_samples_float  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1149 of file filempeg.C.

int FileMPEG::read_frame VFrame *  frame  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1017 of file filempeg.C.

References FileBase::asset, File::current_layer, fd, FileBase::file, Asset::height, and Asset::width.

int FileMPEG::read_samples double *  buffer,
int64_t  len
[virtual]
 

Reimplemented from FileBase.

Definition at line 1117 of file filempeg.C.

References File::current_channel, File::current_sample, fd, FileBase::file, and to_streamchannel().

int FileMPEG::read_samples_float float *  buffer,
int64_t  len
[virtual]
 

Reimplemented from FileBase.

Definition at line 1154 of file filempeg.C.

References File::current_channel, File::current_sample, fd, FileBase::file, and to_streamchannel().

int FileMPEG::reset_parameters_derived  )  [private, virtual]
 

Reimplemented from FileBase.

Definition at line 115 of file filempeg.C.

References audio_out, fd, lame_allocation, lame_fd, lame_global, lame_output, lame_output_allocation, lame_started, lame_temp, mjpeg_eof, mjpeg_error, mjpeg_out, FileBase::prev_track, temp_frame, toolame_allocation, toolame_result, toolame_temp, video_out, and wrote_header.

int FileMPEG::set_audio_position int64_t  x  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 723 of file filempeg.C.

References FileBase::asset, Asset::audio_length, File::current_channel, fd, FileBase::file, and to_streamchannel().

int FileMPEG::set_video_position int64_t  x  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 747 of file filempeg.C.

References FileBase::asset, File::current_layer, fd, FileBase::file, and Asset::video_length.

char * FileMPEG::strtocompression char *  string  )  [static]
 

Definition at line 1184 of file filempeg.C.

void FileMPEG::to_streamchannel int  channel,
int &  stream_out,
int &  channel_out
[private]
 

Definition at line 1108 of file filempeg.C.

References File::current_channel, fd, and FileBase::file.

Referenced by read_samples(), read_samples_float(), and set_audio_position().

int FileMPEG::write_frames VFrame ***  frames,
int  len
[virtual]
 

Reimplemented from FileBase.

Definition at line 860 of file filempeg.C.

References FileBase::asset, Asset::height, mjpeg_error, mjpeg_u, mjpeg_v, mjpeg_y, mpeg2enc_set_input_buffers(), MPEG_YUV420, MPEG_YUV422, next_frame_done, next_frame_lock, temp_frame, video_out, Asset::vmpeg_cmodel, Asset::vmpeg_derivative, Asset::vmpeg_progressive, and Asset::width.

int FileMPEG::write_samples double **  buffer,
int64_t  len
[virtual]
 

Reimplemented from FileBase.

Definition at line 759 of file filempeg.C.

References Asset::ampeg_derivative, FileBase::asset, Asset::channels, fwrite(), lame_allocation, lame_fd, lame_global, lame_output, lame_output_allocation, lame_started, lame_temp, MIN, toolame_allocation, toolame_send_buffer(), and toolame_temp.


Friends And Related Function Documentation

friend class FileMPEGAudio [friend]
 

Definition at line 45 of file filempeg.h.

Referenced by open_file().

friend class FileMPEGVideo [friend]
 

Definition at line 44 of file filempeg.h.

Referenced by open_file().


Member Data Documentation

ArrayList<char*> FileMPEG::acommand_line [private]
 

Definition at line 117 of file filempeg.h.

Referenced by append_acommand_line(), close_file(), and FileMPEGAudio::run().

FileMPEGAudio* FileMPEG::audio_out [private]
 

Definition at line 115 of file filempeg.h.

Referenced by close_file(), open_file(), and reset_parameters_derived().

mpeg3_t* FileMPEG::fd [private]
 

Definition at line 84 of file filempeg.h.

Referenced by can_copy_from(), close_file(), create_index(), get_index(), open_file(), read_frame(), read_samples(), read_samples_float(), reset_parameters_derived(), set_audio_position(), set_video_position(), and to_streamchannel().

int FileMPEG::lame_allocation [private]
 

Definition at line 130 of file filempeg.h.

Referenced by reset_parameters_derived(), and write_samples().

FILE* FileMPEG::lame_fd [private]
 

Definition at line 133 of file filempeg.h.

Referenced by close_file(), open_file(), reset_parameters_derived(), and write_samples().

lame_global_flags* FileMPEG::lame_global [private]
 

Definition at line 137 of file filempeg.h.

Referenced by close_file(), open_file(), reset_parameters_derived(), and write_samples().

char* FileMPEG::lame_output [private]
 

Definition at line 131 of file filempeg.h.

Referenced by close_file(), reset_parameters_derived(), and write_samples().

int FileMPEG::lame_output_allocation [private]
 

Definition at line 132 of file filempeg.h.

Referenced by reset_parameters_derived(), and write_samples().

int FileMPEG::lame_started [private]
 

Definition at line 135 of file filempeg.h.

Referenced by reset_parameters_derived(), and write_samples().

float* FileMPEG::lame_temp[2] [private]
 

Definition at line 129 of file filempeg.h.

Referenced by close_file(), reset_parameters_derived(), and write_samples().

char FileMPEG::mjpeg_command[BCTEXTLEN] [private]
 

Definition at line 107 of file filempeg.h.

Referenced by open_file().

int FileMPEG::mjpeg_eof [private]
 

Definition at line 102 of file filempeg.h.

Referenced by close_file(), reset_parameters_derived(), and FileMPEGVideo::run().

int FileMPEG::mjpeg_error [private]
 

Definition at line 99 of file filempeg.h.

Referenced by reset_parameters_derived(), FileMPEGVideo::run(), and write_frames().

FILE* FileMPEG::mjpeg_out [private]
 

Definition at line 98 of file filempeg.h.

Referenced by close_file(), open_file(), reset_parameters_derived(), and FileMPEGVideo::run().

unsigned char* FileMPEG::mjpeg_u [private]
 

Definition at line 105 of file filempeg.h.

Referenced by FileMPEGVideo::run(), and write_frames().

unsigned char* FileMPEG::mjpeg_v [private]
 

Definition at line 106 of file filempeg.h.

Referenced by FileMPEGVideo::run(), and write_frames().

unsigned char* FileMPEG::mjpeg_y [private]
 

Definition at line 104 of file filempeg.h.

Referenced by FileMPEGVideo::run(), and write_frames().

Condition* FileMPEG::next_frame_done [private]
 

Definition at line 101 of file filempeg.h.

Referenced by FileMPEG(), FileMPEGVideo::run(), write_frames(), and ~FileMPEG().

Condition* FileMPEG::next_frame_lock [private]
 

Definition at line 100 of file filempeg.h.

Referenced by close_file(), FileMPEG(), FileMPEGVideo::run(), write_frames(), and ~FileMPEG().

VFrame* FileMPEG::temp_frame [private]
 

Definition at line 122 of file filempeg.h.

Referenced by close_file(), reset_parameters_derived(), and write_frames().

int FileMPEG::toolame_allocation [private]
 

Definition at line 125 of file filempeg.h.

Referenced by reset_parameters_derived(), and write_samples().

int FileMPEG::toolame_result [private]
 

Definition at line 126 of file filempeg.h.

Referenced by reset_parameters_derived(), and FileMPEGAudio::run().

unsigned char* FileMPEG::toolame_temp [private]
 

Definition at line 124 of file filempeg.h.

Referenced by close_file(), reset_parameters_derived(), and write_samples().

ArrayList<char*> FileMPEG::vcommand_line [private]
 

Definition at line 89 of file filempeg.h.

Referenced by append_vcommand_line(), close_file(), and FileMPEGVideo::run().

FileMPEGVideo* FileMPEG::video_out [private]
 

Definition at line 87 of file filempeg.h.

Referenced by close_file(), open_file(), reset_parameters_derived(), and write_frames().

int FileMPEG::wrote_header [private]
 

Definition at line 103 of file filempeg.h.

Referenced by reset_parameters_derived(), and FileMPEGVideo::run().


The documentation for this class was generated from the following files:
Generated on Sun Jan 8 13:39:14 2006 for Cinelerra-svn by  doxygen 1.4.4