Replace a mention of MPlayer by MEncoder in the MEncoder section.
[mplayer/glamo.git] / libmpdemux / stheader.h
blob07ecfaedede97b3745aac2ba49998945e68a7ccc
1 #ifndef MPLAYER_STHEADER_H
2 #define MPLAYER_STHEADER_H
4 #include "demuxer.h"
5 #include "aviheader.h"
6 #include "ms_hdr.h"
8 // Stream headers:
10 typedef struct {
11 int aid;
12 demux_stream_t *ds;
13 struct codecs_st *codec;
14 unsigned int format;
15 int initialized;
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 struct af_stream_s *afilter; // the audio filter stream
40 struct ad_functions_s* ad_driver;
41 #ifdef CONFIG_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 char* lang; // track language
54 int default_track;
55 } sh_audio_t;
57 typedef struct {
58 int vid;
59 demux_stream_t *ds;
60 struct codecs_st *codec;
61 unsigned int format;
62 int initialized;
63 float timer; // absolute time in video stream, since last start/seek
64 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
65 // frame counters:
66 float num_frames; // number of frames played
67 int num_frames_decoded; // number of frames decoded
68 // timing (mostly for mpeg):
69 double pts; // predicted/interpolated PTS of the current frame
70 double i_pts; // PTS for the _next_ I/P frame
71 float next_frame_time;
72 double last_pts;
73 double buffered_pts[20];
74 int num_buffered_pts;
75 // output format: (set by demuxer)
76 float fps; // frames per second (set only if constant fps)
77 float frametime; // 1/fps
78 float aspect; // aspect ratio stored in the file (for prescaling)
79 float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
80 int i_bps; // == bitrate (compressed bytes/sec)
81 int disp_w,disp_h; // display size (filled by fileformat parser)
82 // output driver/filters: (set by libmpcodecs core)
83 unsigned int outfmtidx;
84 struct vf_instance_s *vfilter; // the video filter chain, used for this video stream
85 int vf_initialized;
86 #ifdef CONFIG_DYNAMIC_PLUGINS
87 void *dec_handle;
88 #endif
89 // win32-compatible codec parameters:
90 AVIStreamHeader video;
91 BITMAPINFOHEADER* bih;
92 void* ImageDesc; // for quicktime codecs
93 // codec-specific:
94 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
95 } sh_video_t;
97 typedef struct {
98 int sid;
99 char type; // t = text, v = VobSub, a = SSA/ASS
100 unsigned char* extradata; // extra header data passed from demuxer
101 int extradata_len;
102 #ifdef CONFIG_ASS
103 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
104 #endif
105 char* lang; // track language
106 int default_track;
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 /* MPLAYER_STHEADER_H */