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
/
file.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-11-29
|
2KB
|
95 lines
#ifndef FILE_H
#define FILE_H
#include <stdio.h>
#include "asset.inc"
#include "file.inc"
#include "filebase.inc"
#include "mainwindow.inc"
#include "sema.h"
// ======================================= include file types here
// generic file opened by user
class File
{
public:
File(MainWindow *mwindow);
~File();
// ===================================== start here
int set_processors(int cpus);
int set_mmx(int use_mmx);
int set_prebuffer(long size);
// return 0 if success/found format
// return 1 if failure/file not found
// return 2 if need format
// return 3 if project
// format may be preset by set_format
int open_file(Asset *asset);
// close file
int close_file();
// get length of file
long get_audio_length();
long get_video_length();
// get positions
int get_position(double &percentage, double &seconds);
long get_audio_position();
long get_video_position();
int end_of_audio();
int end_of_video();
// set positions
int set_audio_position(long x);
int set_video_position(long x);
// set position in percentage
int set_position(double percentage);
// Skip a certain number of frames forward.
int drop_frames(int frames);
// Step back a frame
int frame_back();
// Set layer
int set_audio_stream(int stream);
int set_video_stream(int stream);
// read the number of samples of raw data for all audio channels
// advances file pointer
// return 1 if failed
int read_audio(char *buffer, long len);
// Rendering strategies
// Can read directly into the frame buffer.
int frame_buffer_copy_possible(int color_model);
// Can read YUV directly into frame buffer.
int yuv_copy_possible();
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);
int read_frame_buffer(unsigned char **frame_buffer, int w, int h, int bitmap_color_model);
// read the frame at the current video position into a raw buffer of rows and columns
int read_frame(unsigned char *frame);
int lock_read();
int unlock_read();
Asset *asset;
FileBase *file; // virtual class for file type
MainWindow *mwindow;
Sema read_lock, write_lock;
int cpus;
int use_mmx;
long prebuffer_size;
long total_frames;
long total_samples;
};
#endif