2002-03-03 18:47:29 +00:00
|
|
|
#ifndef __ST_HEADER_H
|
|
|
|
#define __ST_HEADER_H 1
|
|
|
|
|
2001-04-06 01:18:59 +00:00
|
|
|
// Stream headers:
|
|
|
|
|
2001-10-21 15:47:31 +00:00
|
|
|
#include "wine/mmreg.h"
|
|
|
|
#include "wine/avifmt.h"
|
|
|
|
#include "wine/vfw.h"
|
2001-04-06 01:18:59 +00:00
|
|
|
|
2002-04-13 19:14:34 +00:00
|
|
|
#include "../libmpcodecs/mp_image.h"
|
2002-01-16 12:24:36 +00:00
|
|
|
|
2001-04-06 01:18:59 +00:00
|
|
|
typedef struct {
|
|
|
|
demux_stream_t *ds;
|
2001-04-07 21:27:57 +00:00
|
|
|
unsigned int format;
|
2001-10-20 18:49:08 +00:00
|
|
|
struct codecs_st *codec;
|
2001-08-23 12:46:44 +00:00
|
|
|
int inited;
|
2001-04-06 01:18:59 +00:00
|
|
|
// output format:
|
2001-07-21 01:17:00 +00:00
|
|
|
float timer; // value of old a_frame
|
2001-04-06 01:18:59 +00:00
|
|
|
int samplerate;
|
|
|
|
int samplesize;
|
|
|
|
int channels;
|
2001-05-10 03:39:54 +00:00
|
|
|
int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
|
|
|
|
int i_bps; // == bitrate (compressed bytes/sec)
|
2001-04-06 16:31:18 +00:00
|
|
|
// in buffers:
|
2001-04-06 01:18:59 +00:00
|
|
|
char* a_in_buffer;
|
|
|
|
int a_in_buffer_len;
|
|
|
|
int a_in_buffer_size;
|
2001-04-06 16:31:18 +00:00
|
|
|
// out buffers:
|
|
|
|
char* a_buffer;
|
|
|
|
int a_buffer_len;
|
|
|
|
int a_buffer_size;
|
2001-05-11 01:22:35 +00:00
|
|
|
int sample_format;
|
2001-04-06 01:18:59 +00:00
|
|
|
// win32 codec stuff:
|
|
|
|
AVIStreamHeader audio;
|
2001-04-15 14:33:49 +00:00
|
|
|
WAVEFORMATEX *wf;
|
2001-04-06 01:18:59 +00:00
|
|
|
int audio_in_minsize;
|
|
|
|
int audio_out_minsize;
|
|
|
|
// other codecs:
|
2001-12-21 16:17:24 +00:00
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2002-03-24 02:25:41 +00:00
|
|
|
unsigned char *codecdata;
|
|
|
|
int codecdata_len;
|
2001-04-06 01:18:59 +00:00
|
|
|
} sh_audio_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
demux_stream_t *ds;
|
2001-04-07 21:27:57 +00:00
|
|
|
unsigned int format;
|
2001-10-20 18:49:08 +00:00
|
|
|
struct codecs_st *codec;
|
2001-08-23 12:46:44 +00:00
|
|
|
int inited;
|
2001-04-06 01:18:59 +00:00
|
|
|
// output format:
|
2001-07-21 01:17:00 +00:00
|
|
|
float timer; // value of old v_frame
|
2001-04-06 01:18:59 +00:00
|
|
|
float fps;
|
|
|
|
float frametime; // 1/fps
|
2001-07-28 20:33:51 +00:00
|
|
|
int i_bps; // == bitrate (compressed bytes/sec)
|
2001-04-14 03:12:48 +00:00
|
|
|
int disp_w,disp_h; // display size (filled by fileformat parser)
|
|
|
|
// int coded_w,coded_h; // coded size (filled by video codec)
|
2001-10-01 15:58:31 +00:00
|
|
|
float aspect;
|
2001-04-07 21:27:57 +00:00
|
|
|
unsigned int outfmtidx;
|
2001-04-06 01:18:59 +00:00
|
|
|
// unsigned int bitrate;
|
|
|
|
// buffers:
|
2001-07-28 20:33:51 +00:00
|
|
|
float num_frames; // number of frames played
|
2001-08-16 01:03:51 +00:00
|
|
|
int num_frames_decoded; // number of frames decoded
|
2002-01-16 12:24:36 +00:00
|
|
|
mp_image_t *image;
|
2001-04-06 01:18:59 +00:00
|
|
|
// win32 codec stuff:
|
|
|
|
AVIStreamHeader video;
|
2001-04-15 14:33:49 +00:00
|
|
|
BITMAPINFOHEADER *bih; // in format
|
2001-12-21 16:17:24 +00:00
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2002-03-07 02:49:46 +00:00
|
|
|
void* video_out;
|
2002-04-06 22:00:50 +00:00
|
|
|
void* vfilter;
|
2002-05-01 17:30:23 +00:00
|
|
|
int vf_inited;
|
2001-04-06 01:18:59 +00:00
|
|
|
} sh_video_t;
|
|
|
|
|
2002-03-15 15:53:11 +00:00
|
|
|
sh_audio_t* get_sh_audio(demuxer_t *demuxer,int id);
|
|
|
|
sh_video_t* get_sh_video(demuxer_t *demuxer,int id);
|
2001-07-07 18:46:15 +00:00
|
|
|
sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id);
|
|
|
|
sh_video_t* new_sh_video(demuxer_t *demuxer,int id);
|
2002-03-15 15:53:11 +00:00
|
|
|
void free_sh_audio(sh_audio_t *sh);
|
|
|
|
void free_sh_video(sh_video_t *sh);
|
2001-04-15 03:40:37 +00:00
|
|
|
|
2001-10-30 20:36:20 +00:00
|
|
|
int video_read_properties(sh_video_t *sh_video);
|
|
|
|
int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);
|
2002-03-03 18:47:29 +00:00
|
|
|
|
|
|
|
#endif
|