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

FileOGG Class Reference

#include <fileogg.h>

Inheritance diagram for FileOGG:

FileBase List of all members.

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 move_history (int from, int to, int len)

Private Attributes

FILE * stream
off_t file_length
theoraframes_info_ttf
VFrame * temp_frame
Mutex * flush_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

Detailed Description

Definition at line 73 of file fileogg.h.


Constructor & Destructor Documentation

FileOGG::FileOGG Asset asset,
File file
 

Definition at line 31 of file fileogg.C.

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

FileOGG::~FileOGG  ) 
 

Definition at line 40 of file fileogg.C.

References FileBase::asset, theoraframes_info_t::audiosync, Asset::channels, close_file(), flush_lock, pcm_history, stream, sync_window_t::sync, theoraframes_info_t::tc, temp_frame, tf, theoraframes_info_t::ti, theoraframes_info_t::vc, theoraframes_info_t::vi, and theoraframes_info_t::videosync.


Member Function Documentation

int FileOGG::check_sig Asset asset  )  [static]
 

Definition at line 1252 of file fileogg.C.

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

Referenced by File::open_file().

int FileOGG::close_file  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1273 of file fileogg.C.

References FileBase::asset, Asset::audio_data, fclose(), flush_ogg(), FileBase::rd, stream, theoraframes_info_t::tc, theoraframes_info_t::td, tf, theoraframes_info_t::ti, theoraframes_info_t::to, theoraframes_info_t::vb, theoraframes_info_t::vc, theoraframes_info_t::vd, theoraframes_info_t::vi, Asset::video_data, theoraframes_info_t::vo, FileBase::wr, write_frames_theora(), and write_samples_vorbis().

Referenced by ~FileOGG().

int FileOGG::close_file_derived  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1327 of file fileogg.C.

References fclose(), and stream.

int FileOGG::colormodel_supported int  colormodel  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1355 of file fileogg.C.

void FileOGG::flush_ogg int  e_o_s  )  [private]
 

Definition at line 1711 of file fileogg.C.

References theoraframes_info_t::apage, theoraframes_info_t::apage_buffer_length, theoraframes_info_t::apage_len, theoraframes_info_t::apage_valid, FileBase::asset, Asset::audio_data, theoraframes_info_t::audiotime, flush_lock, theoraframes_info_t::td, tf, theoraframes_info_t::to, theoraframes_info_t::vd, Asset::video_data, theoraframes_info_t::videotime, theoraframes_info_t::vo, theoraframes_info_t::vpage, theoraframes_info_t::vpage_buffer_length, theoraframes_info_t::vpage_len, theoraframes_info_t::vpage_valid, write_audio_page(), and write_video_page().

Referenced by close_file(), write_frames_theora(), and write_samples_vorbis().

int64_t FileOGG::get_audio_position  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1340 of file fileogg.C.

References next_sample_position, and start_sample.

int FileOGG::get_best_colormodel Asset asset,
int  driver
 

Definition at line 1364 of file fileogg.C.

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

Definition at line 73 of file fileogg.C.

References OGGConfigVideo::create_objects(), and OGGConfigAudio::create_objects().

Referenced by File::get_options().

int64_t FileOGG::get_video_position  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1334 of file fileogg.C.

References next_frame_position, and start_frame.

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

Definition at line 1523 of file fileogg.C.

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

Referenced by read_samples().

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

Definition at line 1491 of file fileogg.C.

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

Referenced by read_samples().

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

Definition at line 911 of file fileogg.C.

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

Referenced by open_file().

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

Definition at line 867 of file fileogg.C.

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

Referenced by open_file().

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

Definition at line 919 of file fileogg.C.

References sync_window_t::file_pagepos, sync_window_t::file_pagepos_found, stream, and take_page_out_autoadvance().

Referenced by ogg_decode_more_samples(), ogg_get_first_page(), ogg_get_page_of_frame(), ogg_get_page_of_sample(), ogg_seek_to_keyframe(), ogg_seek_to_sample(), ogg_sync_and_get_next_page(), open_file(), and read_frame().

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

Definition at line 1089 of file fileogg.C.

References FileBase::asset, file_length, filedata_begin, ogg_get_next_page(), ogg_get_prev_page(), ogg_sync_and_get_next_page(), read_buffer_at(), READ_SIZE, start_frame, stream, theoraframes_info_t::td, tf, and Asset::video_length.

Referenced by ogg_seek_to_keyframe().

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

Definition at line 959 of file fileogg.C.

References FileBase::asset, Asset::audio_length, file_length, filedata_begin, ogg_get_next_page(), ogg_get_prev_page(), ogg_sync_and_get_next_page(), read_buffer_at(), READ_SIZE, start_sample, and stream.

Referenced by ogg_seek_to_sample().

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

Definition at line 792 of file fileogg.C.

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

Referenced by ogg_get_page_of_frame(), ogg_get_page_of_sample(), and ogg_seek_to_keyframe().

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

Definition at line 1175 of file fileogg.C.

References 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().

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

Definition at line 1012 of file fileogg.C.

References 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().

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

Definition at line 932 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().

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

Reimplemented from FileBase.

Definition at line 187 of file fileogg.C.

References _, 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, Asset::channels, file_length, sync_window_t::file_pagepos, filedata_begin, flush_lock, fopen(), Asset::frame_rate, fwrite(), Asset::height, Asset::interlace_mode, last_frame, last_sample, Asset::layers, 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, 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, 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, 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.

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

Reimplemented from FileBase.

Definition at line 1371 of file fileogg.C.

References next_frame_position, ogg_frame_position, ogg_get_next_page(), ogg_seek_to_keyframe(), stream, theoraframes_info_t::td, temp_frame, tf, theoraframes_info_t::to, and theoraframes_info_t::videosync.

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

Reimplemented from FileBase.

Definition at line 1531 of file fileogg.C.

References FileBase::asset, Asset::audio_length, theoraframes_info_t::audiosync, Asset::channels, File::current_channel, FileBase::file, HISTORY_MAX, history_size, history_start, move_history(), next_sample_position, ogg_decode_more_samples(), ogg_sample_position, ogg_seek_to_sample(), pcm_history, start_sample, tf, theoraframes_info_t::vd, and theoraframes_info_t::vo.

int FileOGG::reset_parameters_derived  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 98 of file fileogg.C.

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

int FileOGG::set_audio_position int64_t  x  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1517 of file fileogg.C.

References next_sample_position, and start_sample.

Referenced by open_file().

int FileOGG::set_video_position int64_t  x  )  [virtual]
 

Reimplemented from FileBase.

Definition at line 1345 of file fileogg.C.

References next_frame_position, and start_frame.

Referenced by open_file().

int FileOGG::write_audio_page  )  [private]
 

Definition at line 1687 of file fileogg.C.

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

Referenced by flush_ogg().

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

Reimplemented from FileBase.

Definition at line 1930 of file fileogg.C.

References write_frames_theora().

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

Definition at line 1834 of file fileogg.C.

References flush_lock, flush_ogg(), theoraframes_info_t::op, stream, theoraframes_info_t::td, temp_frame, tf, theoraframes_info_t::ti, and theoraframes_info_t::to.

Referenced by close_file(), and write_frames().

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

Reimplemented from FileBase.

Definition at line 1827 of file fileogg.C.

References write_samples_vorbis().

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

Definition at line 1784 of file fileogg.C.

References FileBase::asset, Asset::channels, flush_lock, flush_ogg(), theoraframes_info_t::op, tf, theoraframes_info_t::vb, theoraframes_info_t::vd, and theoraframes_info_t::vo.

Referenced by close_file(), and write_samples().

int FileOGG::write_video_page  )  [private]
 

Definition at line 1699 of file fileogg.C.

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

Referenced by flush_ogg().


Member Data Documentation

off_t FileOGG::file_length [private]
 

Definition at line 109 of file fileogg.h.

Referenced by ogg_get_last_page(), ogg_get_page_of_frame(), ogg_get_page_of_sample(), and open_file().

off_t FileOGG::filedata_begin [private]
 

Definition at line 115 of file fileogg.h.

Referenced by ogg_get_page_of_frame(), ogg_get_page_of_sample(), and open_file().

Mutex* FileOGG::flush_lock [private]
 

Definition at line 113 of file fileogg.h.

Referenced by flush_ogg(), open_file(), reset_parameters_derived(), write_frames_theora(), write_samples_vorbis(), and ~FileOGG().

int64_t FileOGG::history_size [private]
 

Definition at line 147 of file fileogg.h.

Referenced by read_samples().

int64_t FileOGG::history_start [private]
 

Definition at line 146 of file fileogg.h.

Referenced by move_history(), and read_samples().

int64_t FileOGG::last_frame [private]
 

Definition at line 134 of file fileogg.h.

Referenced by open_file().

int64_t FileOGG::last_sample [private]
 

Definition at line 132 of file fileogg.h.

Referenced by open_file().

int64_t FileOGG::next_frame_position [private]
 

Definition at line 151 of file fileogg.h.

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

int64_t FileOGG::next_sample_position [private]
 

Definition at line 138 of file fileogg.h.

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

int64_t FileOGG::ogg_frame_position [private]
 

Definition at line 150 of file fileogg.h.

Referenced by open_file(), and read_frame().

int64_t FileOGG::ogg_sample_position [private]
 

Definition at line 137 of file fileogg.h.

Referenced by open_file(), and read_samples().

float** FileOGG::pcm_history [private]
 

Definition at line 142 of file fileogg.h.

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

int64_t FileOGG::start_frame [private]
 

Definition at line 133 of file fileogg.h.

Referenced by get_video_position(), ogg_get_page_of_frame(), open_file(), and set_video_position().

int64_t FileOGG::start_sample [private]
 

Definition at line 131 of file fileogg.h.

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

FILE* FileOGG::stream [private]
 

Definition at line 108 of file fileogg.h.

Referenced by close_file(), close_file_derived(), ogg_get_first_page(), ogg_get_last_page(), ogg_get_next_page(), ogg_get_page_of_frame(), ogg_get_page_of_sample(), ogg_get_prev_page(), open_file(), read_frame(), reset_parameters_derived(), write_audio_page(), write_frames_theora(), write_video_page(), and ~FileOGG().

VFrame* FileOGG::temp_frame [private]
 

Definition at line 112 of file fileogg.h.

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

theoraframes_info_t* FileOGG::tf [private]
 

Definition at line 111 of file fileogg.h.

Referenced by close_file(), flush_ogg(), ogg_decode_more_samples(), ogg_get_page_of_frame(), ogg_seek_to_keyframe(), ogg_seek_to_sample(), open_file(), read_frame(), read_samples(), reset_parameters_derived(), write_audio_page(), write_frames_theora(), write_samples_vorbis(), write_video_page(), and ~FileOGG().

int FileOGG::theora_cmodel [private]
 

Definition at line 149 of file fileogg.h.

Referenced by open_file().

char FileOGG::theora_keyframe_granule_shift [private]
 

Definition at line 152 of file fileogg.h.

Referenced by ogg_seek_to_keyframe(), and open_file().


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