home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek 6
/
Geek-006.iso
/
linux
/
video
/
xmovie-1.5.3.tar.gz
/
xmovie-1.5.3.tar
/
xmovie-1.5.3
/
xmovie
/
filebase.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-11-29
|
2KB
|
73 lines
#ifndef FILEBASE_H
#define FILEBASE_H
#include "asset.inc"
#include "file.inc"
#include "mainwindow.inc"
#include "sizes.h"
// inherited by every file interpreter
class FileBase
{
public:
FileBase(Asset *asset, File *file);
virtual ~FileBase();
int close_file();
int reset_parameters();
virtual int reset_parameters_derived() { return 0; };
virtual int read_header() { return 0; };
virtual int open_file() { return 0; };
virtual int close_file_derived() { return 0; };
virtual long get_audio_length() { return 0; };
virtual long get_video_length() { return 0; };
virtual int get_position(double &percentage, double &seconds) { return 0; };
virtual int set_position(double percentage) { return 1; };
virtual long get_video_position() { return 0; };
virtual long get_audio_position() { return 0; };
virtual int end_of_audio() { return 0; };
virtual int end_of_video() { return 0; };
virtual int set_video_position(long x) { return 0; };
virtual int set_audio_position(long x) { return 0; };
virtual int set_video_stream(int stream) { return 0; };
virtual int set_audio_stream(int stream) { return 0; };
virtual int set_cpus(int cpus) { return 0; };
virtual int set_mmx(int use_mmx) { return 0; };
// Skip a certain number of frames forward.
virtual int drop_frames(int frames) { return 1; };
// Step back a frame
virtual int frame_back() { return 1; };
// Get optimization strategy
virtual int yuv_copy_possible() { return 0; };
virtual int frame_buffer_copy_possible(int color_model) { return 0; };
// Read video
virtual int read_yuv_buffer(char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h) { return 1; };
virtual int read_frame_buffer(unsigned char **frame_buffer, int w, int h, int bitmap_color_model) { return 1; };
virtual int read_frame(unsigned char *frame) { return 0; };
// Read audio
virtual int read_audio(char *buffer, long len) { return 0; };
virtual int load_into_ram() { return 0; };
File *file;
MainWindow *mwindow;
protected:
int get_read_buffer(long len);
int internal_byte_order;
int match4(char *in, char *out);
int delete_cache();
Asset *asset;
// for loading into RAM
char **ram_cache;
BCBASE_INT16 *read_buffer; // Temporary storage for audio output
long read_size; // Sample size of temporary storage
long cached_frames;
};
#endif