Add a comment that explains why this header has no multiple inclusion guards.
[mplayer/greg.git] / libmpdemux / stheader.h
blobd560322e0417d4be2d0f48c2801ee6b93b907b3a
1 #ifndef STHEADER_H
2 #define STHEADER_H
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 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
16 // output format:
17 int sample_format;
18 int samplerate;
19 int samplesize;
20 int channels;
21 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
22 int i_bps; // == bitrate (compressed bytes/sec)
23 // in buffers:
24 int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
25 char* a_in_buffer;
26 int a_in_buffer_len;
27 int a_in_buffer_size;
28 // decoder buffers:
29 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
30 char* a_buffer;
31 int a_buffer_len;
32 int a_buffer_size;
33 // output buffers:
34 char* a_out_buffer;
35 int a_out_buffer_len;
36 int a_out_buffer_size;
37 // void* audio_out; // the audio_out handle, used for this audio stream
38 struct af_stream_s *afilter; // the audio filter stream
39 struct ad_functions_s* ad_driver;
40 #ifdef DYNAMIC_PLUGINS
41 void *dec_handle;
42 #endif
43 // win32-compatible codec parameters:
44 AVIStreamHeader audio;
45 WAVEFORMATEX* wf;
46 // codec-specific:
47 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
48 unsigned char* codecdata; // extra header data passed from demuxer to codec
49 int codecdata_len;
50 double pts; // last known pts value in output from decoder
51 int pts_bytes; // bytes output by decoder after last known pts
52 } sh_audio_t;
54 typedef struct {
55 int vid;
56 demux_stream_t *ds;
57 struct codecs_st *codec;
58 unsigned int format;
59 int inited;
60 float timer; // absolute time in video stream, since last start/seek
61 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
62 // frame counters:
63 float num_frames; // number of frames played
64 int num_frames_decoded; // number of frames decoded
65 // timing (mostly for mpeg):
66 double pts; // predicted/interpolated PTS of the current frame
67 double i_pts; // PTS for the _next_ I/P frame
68 float next_frame_time;
69 double last_pts;
70 double buffered_pts[20];
71 int num_buffered_pts;
72 // output format: (set by demuxer)
73 float fps; // frames per second (set only if constant fps)
74 float frametime; // 1/fps
75 float aspect; // aspect ratio stored in the file (for prescaling)
76 float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
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 struct vf_instance_s *vfilter; // the video filter chain, used for this video stream
82 int vf_inited;
83 #ifdef DYNAMIC_PLUGINS
84 void *dec_handle;
85 #endif
86 // win32-compatible codec parameters:
87 AVIStreamHeader video;
88 BITMAPINFOHEADER* bih;
89 void* ImageDesc; // for quicktime codecs
90 // codec-specific:
91 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
92 } sh_video_t;
94 typedef struct {
95 int sid;
96 char type; // t = text, v = VobSub, a = SSA/ASS
97 int has_palette; // If we have a valid palette
98 unsigned int palette[16]; // for VobSubs
99 int width, height; // for VobSubs
100 int custom_colors;
101 unsigned int colors[4];
102 int forced_subs_only;
103 #ifdef USE_ASS
104 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
105 #endif
106 } sh_sub_t;
108 // demuxer.c:
109 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
110 sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid);
111 #define new_sh_video(d, i) new_sh_video_vid(d, i, i)
112 sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid);
113 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
114 sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid);
115 void free_sh_audio(demuxer_t *demuxer, int id);
116 void free_sh_video(sh_video_t *sh);
118 // video.c:
119 int video_read_properties(sh_video_t *sh_video);
120 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);
122 #endif /* STHEADER_H */