2 #define __ST_HEADER_H 1
12 struct codecs_st
*codec
;
15 double delay
; // relative (to sh_video->timer) time in audio stream
16 float stream_delay
; // number of seconds stream should be delayed (according to dwStart or similar)
22 int o_bps
; // == samplerate*samplesize*channels (uncompr. bytes/sec)
23 int i_bps
; // == bitrate (compressed bytes/sec)
25 int audio_in_minsize
; // max. compressed packet size (== min. in buffer size)
30 int audio_out_minsize
; // max. uncompressed packet size (==min. out buffsize)
37 int a_out_buffer_size
;
38 // void* audio_out; // the audio_out handle, used for this audio stream
39 void* afilter
; // the audio filter stream
40 struct ad_functions_s
* ad_driver
;
41 #ifdef DYNAMIC_PLUGINS
44 // win32-compatible codec parameters:
45 AVIStreamHeader audio
;
48 void* context
; // codec-specific stuff (usually HANDLE or struct pointer)
49 unsigned char* codecdata
; // extra header data passed from demuxer to codec
51 double pts
; // last known pts value in output from decoder
52 int pts_bytes
; // bytes output by decoder after last known pts
58 struct codecs_st
*codec
;
61 float timer
; // absolute time in video stream, since last start/seek
62 float stream_delay
; // number of seconds stream should be delayed (according to dwStart or similar)
64 float num_frames
; // number of frames played
65 int num_frames_decoded
; // number of frames decoded
66 // timing (mostly for mpeg):
67 double pts
; // predicted/interpolated PTS of the current frame
68 double i_pts
; // PTS for the _next_ I/P frame
69 float next_frame_time
;
71 double buffered_pts
[20];
73 // output format: (set by demuxer)
74 float fps
; // frames per second (set only if constant fps)
75 float frametime
; // 1/fps
76 float aspect
; // aspect ratio stored in the file (for prescaling)
77 int i_bps
; // == bitrate (compressed bytes/sec)
78 int disp_w
,disp_h
; // display size (filled by fileformat parser)
79 // output driver/filters: (set by libmpcodecs core)
80 unsigned int outfmtidx
;
81 void* video_out
; // the video_out handle, used for this video stream
82 void* vfilter
; // the video filter chain, used for this video stream
84 #ifdef DYNAMIC_PLUGINS
87 // win32-compatible codec parameters:
88 AVIStreamHeader video
;
89 BITMAPINFOHEADER
* bih
;
90 void* ImageDesc
; // for quicktime codecs
92 void* context
; // codec-specific stuff (usually HANDLE or struct pointer)
97 char type
; // t = text, v = VobSub, a = SSA/ASS
98 int has_palette
; // If we have a valid palette
99 unsigned int palette
[16]; // for VobSubs
100 int width
, height
; // for VobSubs
102 unsigned int colors
[4];
103 int forced_subs_only
;
105 ass_track_t
* ass_track
; // for SSA/ASS streams (type == 'a')
110 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
111 sh_audio_t
* new_sh_audio_aid(demuxer_t
*demuxer
,int id
,int aid
);
112 #define new_sh_video(d, i) new_sh_video_vid(d, i, i)
113 sh_video_t
* new_sh_video_vid(demuxer_t
*demuxer
,int id
,int vid
);
114 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
115 sh_sub_t
*new_sh_sub_sid(demuxer_t
*demuxer
, int id
, int sid
);
116 void free_sh_audio(demuxer_t
*demuxer
, int id
);
117 void free_sh_video(sh_video_t
*sh
);
120 int video_read_properties(sh_video_t
*sh_video
);
121 int video_read_frame(sh_video_t
* sh_video
,float* frame_time_ptr
,unsigned char** start
,int force_fps
);