2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_STHEADER_H
|
|
|
|
#define MPLAYER_STHEADER_H
|
2002-03-03 18:47:29 +00:00
|
|
|
|
2008-03-05 23:32:01 +00:00
|
|
|
#include "demuxer.h"
|
2004-04-28 10:18:33 +00:00
|
|
|
#include "aviheader.h"
|
|
|
|
#include "ms_hdr.h"
|
2002-09-22 00:43:14 +00:00
|
|
|
|
|
|
|
// Stream headers:
|
2002-01-16 12:24:36 +00:00
|
|
|
|
2001-04-06 01:18:59 +00:00
|
|
|
typedef struct {
|
2006-08-26 19:17:04 +00:00
|
|
|
int aid;
|
2001-04-06 01:18:59 +00:00
|
|
|
demux_stream_t *ds;
|
2001-10-20 18:49:08 +00:00
|
|
|
struct codecs_st *codec;
|
2002-09-21 23:23:03 +00:00
|
|
|
unsigned int format;
|
2008-02-14 14:23:55 +00:00
|
|
|
int initialized;
|
2006-02-18 09:26:39 +00:00
|
|
|
float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
|
2002-09-21 23:23:03 +00:00
|
|
|
// output format:
|
|
|
|
int sample_format;
|
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:
|
2002-10-05 22:55:45 +00:00
|
|
|
int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
|
2001-04-06 01:18:59 +00:00
|
|
|
char* a_in_buffer;
|
|
|
|
int a_in_buffer_len;
|
|
|
|
int a_in_buffer_size;
|
2002-10-05 22:55:45 +00:00
|
|
|
// decoder buffers:
|
|
|
|
int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
|
2001-04-06 16:31:18 +00:00
|
|
|
char* a_buffer;
|
|
|
|
int a_buffer_len;
|
|
|
|
int a_buffer_size;
|
2002-10-05 22:55:45 +00: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
|
2007-11-01 06:52:14 +00:00
|
|
|
struct af_stream_s *afilter; // the audio filter stream
|
2005-02-25 11:17:43 +00:00
|
|
|
struct ad_functions_s* ad_driver;
|
2002-11-11 17:28:41 +00:00
|
|
|
#ifdef DYNAMIC_PLUGINS
|
|
|
|
void *dec_handle;
|
|
|
|
#endif
|
2002-09-21 23:23:03 +00:00
|
|
|
// win32-compatible codec parameters:
|
2001-04-06 01:18:59 +00:00
|
|
|
AVIStreamHeader audio;
|
2002-09-21 23:23:03 +00:00
|
|
|
WAVEFORMATEX* wf;
|
|
|
|
// codec-specific:
|
2001-12-21 16:17:24 +00:00
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2002-09-21 23:23:03 +00:00
|
|
|
unsigned char* codecdata; // extra header data passed from demuxer to codec
|
2002-03-24 02:25:41 +00:00
|
|
|
int codecdata_len;
|
2006-04-24 10:58:40 +00:00
|
|
|
double pts; // last known pts value in output from decoder
|
|
|
|
int pts_bytes; // bytes output by decoder after last known pts
|
2008-02-29 17:25:33 +00:00
|
|
|
char* lang; // track language
|
2008-03-30 16:55:46 +00:00
|
|
|
int default_track;
|
2001-04-06 01:18:59 +00:00
|
|
|
} sh_audio_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2006-08-26 19:17:04 +00:00
|
|
|
int vid;
|
2001-04-06 01:18:59 +00:00
|
|
|
demux_stream_t *ds;
|
2001-10-20 18:49:08 +00:00
|
|
|
struct codecs_st *codec;
|
2002-09-21 23:23:03 +00:00
|
|
|
unsigned int format;
|
2008-02-14 14:23:55 +00:00
|
|
|
int initialized;
|
2002-11-02 19:59:40 +00:00
|
|
|
float timer; // absolute time in video stream, since last start/seek
|
2006-02-18 09:26:39 +00:00
|
|
|
float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
|
2002-09-21 23:23:03 +00:00
|
|
|
// frame counters:
|
2001-07-28 20:33:51 +00:00
|
|
|
float num_frames; // number of frames played
|
2002-09-21 23:23:03 +00:00
|
|
|
int num_frames_decoded; // number of frames decoded
|
2003-01-16 22:34:46 +00:00
|
|
|
// timing (mostly for mpeg):
|
2006-04-27 11:13:21 +00:00
|
|
|
double pts; // predicted/interpolated PTS of the current frame
|
|
|
|
double i_pts; // PTS for the _next_ I/P frame
|
2006-11-20 09:12:07 +00:00
|
|
|
float next_frame_time;
|
|
|
|
double last_pts;
|
2006-07-06 06:58:17 +00:00
|
|
|
double buffered_pts[20];
|
|
|
|
int num_buffered_pts;
|
2002-09-21 23:23:03 +00: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)
|
2007-09-01 15:54:45 +00:00
|
|
|
float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
|
2002-09-21 23:23:03 +00:00
|
|
|
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;
|
2007-11-01 06:52:14 +00:00
|
|
|
struct vf_instance_s *vfilter; // the video filter chain, used for this video stream
|
2008-02-14 14:23:55 +00:00
|
|
|
int vf_initialized;
|
2002-11-11 17:28:41 +00:00
|
|
|
#ifdef DYNAMIC_PLUGINS
|
|
|
|
void *dec_handle;
|
|
|
|
#endif
|
2002-09-21 23:23:03 +00:00
|
|
|
// win32-compatible codec parameters:
|
|
|
|
AVIStreamHeader video;
|
|
|
|
BITMAPINFOHEADER* bih;
|
2002-11-11 23:46:27 +00:00
|
|
|
void* ImageDesc; // for quicktime codecs
|
2002-09-21 23:23:03 +00:00
|
|
|
// codec-specific:
|
|
|
|
void* context; // codec-specific stuff (usually HANDLE or struct pointer)
|
2001-04-06 01:18:59 +00:00
|
|
|
} sh_video_t;
|
|
|
|
|
2006-11-13 18:38:29 +00:00
|
|
|
typedef struct {
|
|
|
|
int sid;
|
|
|
|
char type; // t = text, v = VobSub, a = SSA/ASS
|
|
|
|
int has_palette; // If we have a valid palette
|
|
|
|
unsigned int palette[16]; // for VobSubs
|
|
|
|
int width, height; // for VobSubs
|
|
|
|
int custom_colors;
|
|
|
|
unsigned int colors[4];
|
|
|
|
int forced_subs_only;
|
2008-01-11 21:45:10 +00:00
|
|
|
unsigned char* extradata; // extra header data passed from demuxer
|
|
|
|
int extradata_len;
|
2008-07-30 12:01:30 +00:00
|
|
|
#ifdef CONFIG_ASS
|
2006-11-13 18:38:29 +00:00
|
|
|
ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
|
|
|
|
#endif
|
2008-02-29 17:25:33 +00:00
|
|
|
char* lang; // track language
|
2008-03-30 16:55:46 +00:00
|
|
|
int default_track;
|
2006-11-13 18:38:29 +00:00
|
|
|
} sh_sub_t;
|
|
|
|
|
2002-09-21 23:23:03 +00:00
|
|
|
// demuxer.c:
|
2006-08-26 19:17:04 +00:00
|
|
|
#define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
|
|
|
|
sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid);
|
|
|
|
#define new_sh_video(d, i) new_sh_video_vid(d, i, i)
|
|
|
|
sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid);
|
2006-11-13 16:18:05 +00:00
|
|
|
#define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
|
|
|
|
sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid);
|
2006-06-14 14:05:59 +00:00
|
|
|
void free_sh_audio(demuxer_t *demuxer, int id);
|
2002-03-15 15:53:11 +00:00
|
|
|
void free_sh_video(sh_video_t *sh);
|
2001-04-15 03:40:37 +00:00
|
|
|
|
2002-09-21 23:23:03 +00:00
|
|
|
// video.c:
|
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
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_STHEADER_H */
|