1 #ifndef MPLAYER_STHEADER_H
2 #define MPLAYER_STHEADER_H
10 typedef struct sh_audio
{
13 struct demux_stream
*ds
;
17 float stream_delay
; // number of seconds stream should be delayed (according to dwStart or similar)
23 int o_bps
; // == samplerate*samplesize*channels (uncompr. bytes/sec)
24 int i_bps
; // == bitrate (compressed bytes/sec)
26 int audio_in_minsize
; // max. compressed packet size (== min. in buffer size)
31 int audio_out_minsize
; // max. uncompressed packet size (==min. out buffsize)
38 int a_out_buffer_size
;
39 // void* audio_out; // the audio_out handle, used for this audio stream
40 struct af_stream
*afilter
; // the audio filter stream
41 struct ad_functions
*ad_driver
;
42 #ifdef CONFIG_DYNAMIC_PLUGINS
45 // win32-compatible codec parameters:
46 AVIStreamHeader audio
;
49 void* context
; // codec-specific stuff (usually HANDLE or struct pointer)
50 unsigned char* codecdata
; // extra header data passed from demuxer to codec
52 double pts
; // last known pts value in output from decoder
53 int pts_bytes
; // bytes output by decoder after last known pts
54 char* lang
; // track language
58 typedef struct sh_video
{
61 struct demux_stream
*ds
;
65 float timer
; // absolute time in video stream, since last start/seek
66 float stream_delay
; // number of seconds stream should be delayed (according to dwStart or similar)
68 float num_frames
; // number of frames played
69 int num_frames_decoded
; // number of frames decoded
70 // timing (mostly for mpeg):
71 double pts
; // predicted/interpolated PTS of the current frame
72 double i_pts
; // PTS for the _next_ I/P frame
73 float next_frame_time
;
75 double buffered_pts
[20];
77 // output format: (set by demuxer)
78 float fps
; // frames per second (set only if constant fps)
79 float frametime
; // 1/fps
80 float aspect
; // aspect ratio stored in the file (for prescaling)
81 float stream_aspect
; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
82 int i_bps
; // == bitrate (compressed bytes/sec)
83 int disp_w
,disp_h
; // display size (filled by fileformat parser)
84 // output driver/filters: (set by libmpcodecs core)
85 unsigned int outfmtidx
;
86 struct vf_instance
*vfilter
; // the video filter chain, used for this video stream
87 int output_flags
; // query_format() results for output filters+vo
88 const struct vd_functions
*vd_driver
;
90 #ifdef CONFIG_DYNAMIC_PLUGINS
93 // win32-compatible codec parameters:
94 AVIStreamHeader video
;
95 BITMAPINFOHEADER
* bih
;
96 void* ImageDesc
; // for quicktime codecs
98 void* context
; // codec-specific stuff (usually HANDLE or struct pointer)
101 typedef struct sh_sub
{
104 char type
; // t = text, v = VobSub, a = SSA/ASS
105 int has_palette
; // If we have a valid palette
106 unsigned int palette
[16]; // for VobSubs
107 int width
, height
; // for VobSubs
109 unsigned int colors
[4];
110 int forced_subs_only
;
111 unsigned char* extradata
; // extra header data passed from demuxer
113 struct ass_track_s
*ass_track
; // for SSA/ASS streams (type == 'a')
114 char* lang
; // track language
119 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
120 sh_audio_t
* new_sh_audio_aid(demuxer_t
*demuxer
,int id
,int aid
);
121 #define new_sh_video(d, i) new_sh_video_vid(d, i, i)
122 sh_video_t
* new_sh_video_vid(demuxer_t
*demuxer
,int id
,int vid
);
123 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
124 sh_sub_t
*new_sh_sub_sid(demuxer_t
*demuxer
, int id
, int sid
);
125 void free_sh_audio(demuxer_t
*demuxer
, int id
);
126 void free_sh_video(sh_video_t
*sh
);
129 int video_read_properties(sh_video_t
*sh_video
);
130 int video_read_frame(sh_video_t
* sh_video
,float* frame_time_ptr
,unsigned char** start
,int force_fps
);
132 #endif /* MPLAYER_STHEADER_H */