FileOGG Class Reference

#include <fileogg.h>

Inherits FileBase.

Collaboration diagram for FileOGG:

Collaboration graph
[legend]

Public Member Functions

 FileOGG (Asset *asset, File *file)
 ~FileOGG ()
int reset_parameters_derived ()
int open_file (int rd, int wr)
int close_file ()
int close_file_derived ()
int64_t get_video_position ()
int64_t get_audio_position ()
int set_video_position (int64_t x)
int set_audio_position (int64_t x)
int colormodel_supported (int colormodel)
int get_best_colormodel (Asset *asset, int driver)
int write_samples (double **buffer, int64_t len)
int write_frames (VFrame ***frames, int len)
int read_samples (double *buffer, int64_t len)
int read_frame (VFrame *frame)

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)

Private Member Functions

int write_samples_vorbis (double **buffer, int64_t len, int e_o_s)
int write_frames_theora (VFrame ***frames, int len, int e_o_s)
void flush_ogg (int e_o_s)
int write_audio_page ()
int write_video_page ()
int ogg_get_last_page (sync_window_t *sw, long serialno, ogg_page *og)
int ogg_get_prev_page (sync_window_t *sw, long serialno, ogg_page *og)
int ogg_get_first_page (sync_window_t *sw, long serialno, ogg_page *og)
int ogg_get_next_page (sync_window_t *sw, long serialno, ogg_page *og)
int ogg_sync_and_get_next_page (sync_window_t *sw, long serialno, ogg_page *og)
int ogg_get_page_of_sample (sync_window_t *sw, long serialno, ogg_page *og, int64_t sample)
int ogg_seek_to_sample (sync_window_t *sw, long serialno, int64_t sample)
int ogg_decode_more_samples (sync_window_t *sw, long serialno)
int ogg_get_page_of_frame (sync_window_t *sw, long serialno, ogg_page *og, int64_t frame)
int ogg_seek_to_keyframe (sync_window_t *sw, long serialno, int64_t frame, int64_t *keyframe_number)
int ogg_seek_to_databegin (sync_window_t *sw, long serialno)
int move_history (int from, int to, int len)

Private Attributes

FILE * stream
off_t file_length
theoraframes_info_ttf
VFrametemp_frame
Mutexflush_lock
off_t filedata_begin
int64_t start_sample
int64_t last_sample
int64_t start_frame
int64_t last_frame
int64_t ogg_sample_position
int64_t next_sample_position
float ** pcm_history
int64_t history_start
int64_t history_size
int theora_cmodel
int64_t ogg_frame_position
int64_t next_frame_position
char theora_keyframe_granule_shift
int final_write

Friends

class PackagingEngineOGG

Detailed Description

Definition at line 76 of file fileogg.h.


Constructor & Destructor Documentation

FileOGG::FileOGG ( Asset asset,
File file 
)

Definition at line 36 of file fileogg.C.

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

Here is the call graph for this function:

FileOGG::~FileOGG (  ) 


Member Function Documentation

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

Definition at line 83 of file fileogg.C.

References OGGConfigVideo::create_objects(), OGGConfigAudio::create_objects(), BC_WindowBase::run_window(), and window.

Referenced by File::get_options().

Here is the call graph for this function:

int FileOGG::reset_parameters_derived (  )  [virtual]

Reimplemented from FileBase.

Definition at line 108 of file fileogg.C.

References flush_lock, pcm_history, stream, temp_frame, and tf.

int FileOGG::open_file ( int  rd,
int  wr 
) [virtual]

Reimplemented from FileBase.

Definition at line 199 of file fileogg.C.

References theoraframes_info_t::a_pkg, Asset::acodec, theoraframes_info_t::apage, theoraframes_info_t::apage_buffer_length, theoraframes_info_t::apage_valid, Asset::aspect_ratio, FileBase::asset, theoraframes_info_t::audio_bytesout, Asset::audio_data, Asset::audio_length, theoraframes_info_t::audiopage, theoraframes_info_t::audiosync, theoraframes_info_t::audiotime, BC_ILACE_MODE_NOTINTERLACED, BC_YUV420P, Asset::channels, eprintf, EQUIV, fclose(), file_length, sync_window_t::file_pagepos, filedata_begin, flush_lock, fopen(), Asset::frame_rate, fwrite(), header, Asset::height, Asset::interlace_mode, last_frame, last_sample, Asset::layers, memcpy, NULL, theoraframes_info_t::og, ogg_frame_position, ogg_get_first_page(), ogg_get_last_page(), ogg_get_next_page(), ogg_sample_position, theoraframes_info_t::op, Asset::path, pixel_aspect, read_buffer_at(), READ_SIZE, Asset::sample_rate, set_audio_position(), set_video_position(), start_frame, start_sample, stream, sync_window_t::sync, take_page_out_autoadvance(), theoraframes_info_t::tc, theoraframes_info_t::td, tf, Asset::theora_bitrate, theora_cmodel, theora_decode_header(), theora_decode_init(), Asset::theora_fix_bitrate, Asset::theora_keyframe_force_frequency, Asset::theora_keyframe_frequency, theora_keyframe_granule_shift, Asset::theora_quality, theoraframes_info_t::ti, theoraframes_info_t::to, TRACE, theoraframes_info_t::v_pkg, theoraframes_info_t::vb, theoraframes_info_t::vc, Asset::vcodec, theoraframes_info_t::vd, theoraframes_info_t::vi, theoraframes_info_t::video_bytesout, Asset::video_data, Asset::video_length, theoraframes_info_t::videopage, theoraframes_info_t::videosync, theoraframes_info_t::videotime, theoraframes_info_t::vo, Asset::vorbis_bitrate, Asset::vorbis_max_bitrate, Asset::vorbis_min_bitrate, Asset::vorbis_vbr, theoraframes_info_t::vpage, theoraframes_info_t::vpage_buffer_length, theoraframes_info_t::vpage_valid, Asset::width, and sync_window_t::wlen.

Here is the call graph for this function:

int FileOGG::check_sig ( Asset asset  )  [static]

Definition at line 1296 of file fileogg.C.

References fclose(), fopen(), fread(), fseek(), and Asset::path.

Referenced by File::open_file().

Here is the call graph for this function:

int FileOGG::close_file (  )  [virtual]

int FileOGG::close_file_derived (  )  [virtual]

Reimplemented from FileBase.

Definition at line 1381 of file fileogg.C.

References fclose(), and stream.

Here is the call graph for this function:

int64_t FileOGG::get_video_position (  )  [virtual]

Reimplemented from FileBase.

Definition at line 1388 of file fileogg.C.

References next_frame_position, and start_frame.

int64_t FileOGG::get_audio_position (  )  [virtual]

Reimplemented from FileBase.

Definition at line 1394 of file fileogg.C.

References next_sample_position, and start_sample.

int FileOGG::set_video_position ( int64_t  x  )  [virtual]

Reimplemented from FileBase.

Definition at line 1399 of file fileogg.C.

References next_frame_position, and start_frame.

Referenced by open_file().

int FileOGG::set_audio_position ( int64_t  x  )  [virtual]

Reimplemented from FileBase.

Definition at line 1571 of file fileogg.C.

References next_sample_position, and start_sample.

Referenced by open_file().

int FileOGG::colormodel_supported ( int  colormodel  )  [virtual]

Reimplemented from FileBase.

Definition at line 1409 of file fileogg.C.

References BC_YUV420P.

int FileOGG::get_best_colormodel ( Asset asset,
int  driver 
)

Definition at line 1418 of file fileogg.C.

References BC_YUV420P.

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

Reimplemented from FileBase.

Definition at line 1901 of file fileogg.C.

References write_samples_vorbis().

Here is the call graph for this function:

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

Reimplemented from FileBase.

Definition at line 2006 of file fileogg.C.

References write_frames_theora().

Here is the call graph for this function:

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

int FileOGG::read_frame ( VFrame frame  )  [virtual]

int FileOGG::write_samples_vorbis ( double **  buffer,
int64_t  len,
int  e_o_s 
) [private]

int FileOGG::write_frames_theora ( VFrame ***  frames,
int  len,
int  e_o_s 
) [private]

void FileOGG::flush_ogg ( int  e_o_s  )  [private]

int FileOGG::write_audio_page (  )  [private]

Definition at line 1738 of file fileogg.C.

References theoraframes_info_t::a_pkg, theoraframes_info_t::apage, theoraframes_info_t::apage_len, theoraframes_info_t::apage_valid, eprintf, fwrite(), stream, and tf.

Referenced by flush_ogg().

Here is the call graph for this function:

int FileOGG::write_video_page (  )  [private]

Definition at line 1752 of file fileogg.C.

References eprintf, fwrite(), stream, tf, theoraframes_info_t::v_pkg, theoraframes_info_t::vpage, theoraframes_info_t::vpage_len, and theoraframes_info_t::vpage_valid.

Referenced by flush_ogg().

Here is the call graph for this function:

int FileOGG::ogg_get_last_page ( sync_window_t sw,
long  serialno,
ogg_page *  og 
) [private]

Definition at line 894 of file fileogg.C.

References file_length, sync_window_t::file_pagepos, sync_window_t::file_pagepos_found, memcpy, read_buffer_at(), READ_SIZE, stream, and sync_and_take_page_out().

Referenced by open_file().

Here is the call graph for this function:

int FileOGG::ogg_get_prev_page ( sync_window_t sw,
long  serialno,
ogg_page *  og 
) [private]

int FileOGG::ogg_get_first_page ( sync_window_t sw,
long  serialno,
ogg_page *  og 
) [private]

Definition at line 938 of file fileogg.C.

References ogg_get_next_page(), read_buffer_at(), READ_SIZE, and stream.

Referenced by open_file().

Here is the call graph for this function:

int FileOGG::ogg_get_next_page ( sync_window_t sw,
long  serialno,
ogg_page *  og 
) [private]

int FileOGG::ogg_sync_and_get_next_page ( sync_window_t sw,
long  serialno,
ogg_page *  og 
) [private]

Definition at line 968 of file fileogg.C.

References sync_window_t::file_pagepos, sync_window_t::file_pagepos_found, ogg_get_next_page(), and sync_and_take_page_out().

Referenced by ogg_get_page_of_frame(), and ogg_get_page_of_sample().

Here is the call graph for this function:

int FileOGG::ogg_get_page_of_sample ( sync_window_t sw,
long  serialno,
ogg_page *  og,
int64_t  sample 
) [private]

int FileOGG::ogg_seek_to_sample ( sync_window_t sw,
long  serialno,
int64_t  sample 
) [private]

Definition at line 1051 of file fileogg.C.

References eprintf, NULL, ogg_get_next_page(), ogg_get_page_of_sample(), tf, theoraframes_info_t::vb, theoraframes_info_t::vd, and theoraframes_info_t::vo.

Referenced by read_samples().

Here is the call graph for this function:

int FileOGG::ogg_decode_more_samples ( sync_window_t sw,
long  serialno 
) [private]

Definition at line 1545 of file fileogg.C.

References eprintf, NULL, ogg_get_next_page(), tf, theoraframes_info_t::vb, theoraframes_info_t::vd, and theoraframes_info_t::vo.

Referenced by read_samples().

Here is the call graph for this function:

int FileOGG::ogg_get_page_of_frame ( sync_window_t sw,
long  serialno,
ogg_page *  og,
int64_t  frame 
) [private]

int FileOGG::ogg_seek_to_keyframe ( sync_window_t sw,
long  serialno,
int64_t  frame,
int64_t *  keyframe_number 
) [private]

Definition at line 1219 of file fileogg.C.

References eprintf, NULL, ogg_get_next_page(), ogg_get_page_of_frame(), ogg_get_prev_page(), theoraframes_info_t::td, tf, theora_keyframe_granule_shift, and theoraframes_info_t::to.

Referenced by read_frame().

Here is the call graph for this function:

int FileOGG::ogg_seek_to_databegin ( sync_window_t sw,
long  serialno 
) [private]

Definition at line 946 of file fileogg.C.

References filedata_begin, read_buffer_at(), READ_SIZE, and stream.

Referenced by PackagingEngineOGG::packages_are_done().

Here is the call graph for this function:

int FileOGG::move_history ( int  from,
int  to,
int  len 
) [private]

Definition at line 1577 of file fileogg.C.

References FileBase::asset, Asset::channels, history_start, and pcm_history.

Referenced by read_samples().


Friends And Related Function Documentation

friend class PackagingEngineOGG [friend]

Definition at line 78 of file fileogg.h.


Field Documentation

FILE* FileOGG::stream [private]

off_t FileOGG::file_length [private]

Definition at line 116 of file fileogg.h.

Referenced by read_frame(), reset_parameters_derived(), write_frames_theora(), and ~FileOGG().

off_t FileOGG::filedata_begin [private]

int64_t FileOGG::start_sample [private]

int64_t FileOGG::last_sample [private]

Definition at line 137 of file fileogg.h.

Referenced by open_file().

int64_t FileOGG::start_frame [private]

int64_t FileOGG::last_frame [private]

Definition at line 139 of file fileogg.h.

Referenced by open_file().

int64_t FileOGG::ogg_sample_position [private]

Definition at line 142 of file fileogg.h.

Referenced by open_file(), and read_samples().

int64_t FileOGG::next_sample_position [private]

Definition at line 143 of file fileogg.h.

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

float** FileOGG::pcm_history [private]

Definition at line 147 of file fileogg.h.

Referenced by move_history(), read_samples(), reset_parameters_derived(), and ~FileOGG().

int64_t FileOGG::history_start [private]

Definition at line 151 of file fileogg.h.

Referenced by move_history(), and read_samples().

int64_t FileOGG::history_size [private]

Definition at line 152 of file fileogg.h.

Referenced by read_samples().

int FileOGG::theora_cmodel [private]

Definition at line 154 of file fileogg.h.

Referenced by open_file().

int64_t FileOGG::ogg_frame_position [private]

Definition at line 155 of file fileogg.h.

Referenced by open_file(), and read_frame().

int64_t FileOGG::next_frame_position [private]

Definition at line 156 of file fileogg.h.

Referenced by get_video_position(), read_frame(), and set_video_position().

int FileOGG::final_write [private]

Definition at line 158 of file fileogg.h.

Referenced by close_file(), FileOGG(), and PackagingEngineOGG::packages_are_done().


The documentation for this class was generated from the following files:

Generated on Mon Apr 28 14:25:34 2008 for Cinelerra by  doxygen 1.5.5