2002-03-03 19:47:29 +01:00
|
|
|
#ifndef __ST_HEADER_H
|
|
|
|
#define __ST_HEADER_H 1
|
|
|
|
|
2004-04-28 12:18:33 +02:00
|
|
|
#include "aviheader.h"
|
|
|
|
#include "ms_hdr.h"
|
2002-09-22 02:43:14 +02:00
|
|
|
|
|
|
|
// Stream headers:
|
2002-01-16 13:24:36 +01:00
|
|
|
|
2001-04-06 03:18:59 +02:00
|
|
|
typedef struct {
|
|
|
|
demux_stream_t *ds;
|
2001-10-20 20:49:08 +02:00
|
|
|
struct codecs_st *codec;
|
2002-09-22 01:23:03 +02:00
|
|
|
unsigned int format;
|
2001-08-23 14:46:44 +02:00
|
|
|
int inited;
|
2002-11-02 20:59:40 +01:00
|
|
|
float delay; // relative (to sh_video->timer) time in audio stream
|
2002-09-22 01:23:03 +02:00
|
|
|
// output format:
|
|
|
|
int sample_format;
|
2001-04-06 03:18:59 +02:00
|
|
|
int samplerate;
|
|
|
|
int samplesize;
|
|
|
|
int channels;
|
2001-05-10 05:39:54 +02:00
|
|
|
int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
|
|
|
|
int i_bps; // == bitrate (compressed bytes/sec)
|
2001-04-06 18:31:18 +02:00
|
|
|
// in buffers:
|
2002-10-06 00:55:45 +02:00
|
|
|
int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
|
2001-04-06 03:18:59 +02:00
|
|
|
char* a_in_buffer;
|
|
|
|
int a_in_buffer_len;
|
|
|
|
int a_in_buffer_size;
|
2002-10-06 00:55:45 +02:00
|
|
|
// decoder buffers:
|
|
|
|
int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
|
2001-04-06 18:31:18 +02:00
|
|
|
char* a_buffer;
|
|
|
|
int a_buffer_len;
|
|
|
|
int a_buffer_size;
|
2002-10-06 00:55:45 +02:00
|
|
|
// output buffers:
|
|
|
|
char* a_out_buffer;
|
|
|
|
int a_out_buffer_len;
|
|
|
|
int a_out_buffer_size;
|
|
|
|
// void* audio_out; // the audio_out handle, used for this audio stream
|
|
|
|
void* afilter; // the audio filter stream
|
2002-11-11 18:28:41 +01:00
|
|
|
#ifdef DYNAMIC_PLUGINS
|
|
|
|
void *dec_handle;
|
|
|
|
#endif
|
2002-09-22 01:23:03 +02:00
|
|
|
// win32-compatible codec parameters:
|
2001-04-06 03:18:59 +02:00
|
|
|
AVIStreamHeader audio;
|
2002-09-22 01:23:03 +02:00
|
|
|
WAVEFORMATEX* wf;
|
|
|
|
// codec-specific:
|
2001-12-21 17:17:24 +01:00
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2002-09-22 01:23:03 +02:00
|
|
|
unsigned char* codecdata; // extra header data passed from demuxer to codec
|
2002-03-24 03:25:41 +01:00
|
|
|
int codecdata_len;
|
2001-04-06 03:18:59 +02:00
|
|
|
} sh_audio_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
demux_stream_t *ds;
|
2001-10-20 20:49:08 +02:00
|
|
|
struct codecs_st *codec;
|
2002-09-22 01:23:03 +02:00
|
|
|
unsigned int format;
|
2001-08-23 14:46:44 +02:00
|
|
|
int inited;
|
2002-11-02 20:59:40 +01:00
|
|
|
float timer; // absolute time in video stream, since last start/seek
|
2002-09-22 01:23:03 +02:00
|
|
|
// frame counters:
|
2001-07-28 22:33:51 +02:00
|
|
|
float num_frames; // number of frames played
|
2002-09-22 01:23:03 +02:00
|
|
|
int num_frames_decoded; // number of frames decoded
|
2003-01-16 23:34:46 +01:00
|
|
|
// timing (mostly for mpeg):
|
|
|
|
float pts; // predicted/interpolated PTS of the current frame
|
|
|
|
float i_pts; // PTS for the _next_ I/P frame
|
2002-09-22 01:23:03 +02:00
|
|
|
// output format: (set by demuxer)
|
|
|
|
float fps; // frames per second (set only if constant fps)
|
|
|
|
float frametime; // 1/fps
|
|
|
|
float aspect; // aspect ratio stored in the file (for prescaling)
|
|
|
|
int i_bps; // == bitrate (compressed bytes/sec)
|
|
|
|
int disp_w,disp_h; // display size (filled by fileformat parser)
|
|
|
|
// output driver/filters: (set by libmpcodecs core)
|
|
|
|
unsigned int outfmtidx;
|
|
|
|
void* video_out; // the video_out handle, used for this video stream
|
|
|
|
void* vfilter; // the video filter chain, used for this video stream
|
2002-05-01 19:30:23 +02:00
|
|
|
int vf_inited;
|
2002-11-11 18:28:41 +01:00
|
|
|
#ifdef DYNAMIC_PLUGINS
|
|
|
|
void *dec_handle;
|
|
|
|
#endif
|
2002-09-22 01:23:03 +02:00
|
|
|
// win32-compatible codec parameters:
|
|
|
|
AVIStreamHeader video;
|
|
|
|
BITMAPINFOHEADER* bih;
|
2002-11-12 00:46:27 +01:00
|
|
|
void* ImageDesc; // for quicktime codecs
|
2002-09-22 01:23:03 +02:00
|
|
|
// codec-specific:
|
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2001-04-06 03:18:59 +02:00
|
|
|
} sh_video_t;
|
|
|
|
|
2002-09-22 01:23:03 +02:00
|
|
|
// demuxer.c:
|
2001-07-07 20:46:15 +02: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 16:53:11 +01:00
|
|
|
void free_sh_audio(sh_audio_t *sh);
|
|
|
|
void free_sh_video(sh_video_t *sh);
|
2001-04-15 05:40:37 +02:00
|
|
|
|
2002-09-22 01:23:03 +02:00
|
|
|
// video.c:
|
2001-10-30 21:36:20 +01: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 19:47:29 +01:00
|
|
|
|
|
|
|
#endif
|