10l: comparison of char* ptrs with string literals
[mplayer.git] / libmpdemux / stheader.h
blob4559a154132b60a491f2f0bca439592bef289dd5
1 #ifndef __ST_HEADER_H
2 #define __ST_HEADER_H 1
4 #include "aviheader.h"
5 #include "ms_hdr.h"
7 // Stream headers:
9 typedef struct {
10 int aid;
11 demux_stream_t *ds;
12 struct codecs_st *codec;
13 unsigned int format;
14 int inited;
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)
17 // output format:
18 int sample_format;
19 int samplerate;
20 int samplesize;
21 int channels;
22 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
23 int i_bps; // == bitrate (compressed bytes/sec)
24 // in buffers:
25 int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
26 char* a_in_buffer;
27 int a_in_buffer_len;
28 int a_in_buffer_size;
29 // decoder buffers:
30 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
31 char* a_buffer;
32 int a_buffer_len;
33 int a_buffer_size;
34 // output buffers:
35 char* a_out_buffer;
36 int a_out_buffer_len;
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
42 void *dec_handle;
43 #endif
44 // win32-compatible codec parameters:
45 AVIStreamHeader audio;
46 WAVEFORMATEX* wf;
47 // codec-specific:
48 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
49 unsigned char* codecdata; // extra header data passed from demuxer to codec
50 int codecdata_len;
51 double pts; // last known pts value in output from decoder
52 int pts_bytes; // bytes output by decoder after last known pts
53 } sh_audio_t;
55 typedef struct {
56 int vid;
57 demux_stream_t *ds;
58 struct codecs_st *codec;
59 unsigned int format;
60 int inited;
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)
63 // frame counters:
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;
70 double last_pts;
71 double buffered_pts[20];
72 int num_buffered_pts;
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
83 int vf_inited;
84 #ifdef DYNAMIC_PLUGINS
85 void *dec_handle;
86 #endif
87 // win32-compatible codec parameters:
88 AVIStreamHeader video;
89 BITMAPINFOHEADER* bih;
90 void* ImageDesc; // for quicktime codecs
91 // codec-specific:
92 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
93 } sh_video_t;
95 typedef struct {
96 int sid;
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
101 int custom_colors;
102 unsigned int colors[4];
103 int forced_subs_only;
104 #ifdef USE_ASS
105 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
106 #endif
107 } sh_sub_t;
109 // demuxer.c:
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);
119 // video.c:
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);
123 #endif