Fix compilation after FFmpeg r23485.
[mplayer/glamo.git] / libmpdemux / stheader.h
blobb39ef8cfac056e2a8cbf6c8f7f4bb1b438acec76
1 /*
2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_STHEADER_H
20 #define MPLAYER_STHEADER_H
22 #include "demuxer.h"
23 #include "aviheader.h"
24 #include "ms_hdr.h"
26 // Stream headers:
28 #define SH_COMMON \
29 demux_stream_t *ds; \
30 struct codecs *codec; \
31 unsigned int format; \
32 int initialized; \
33 float stream_delay; /* number of seconds stream should be delayed (according to dwStart or similar) */ \
34 /* things needed for parsing */ \
35 int needs_parsing; \
36 struct AVCodecContext *avctx; \
37 struct AVCodecParserContext *parser; \
38 /* audio: last known pts value in output from decoder \
39 * video: predicted/interpolated PTS of the current frame */ \
40 double pts; \
41 /* codec-specific: */ \
42 void* context; /* codec-specific stuff (usually HANDLE or struct pointer) */ \
43 char* lang; /* track language */ \
44 int default_track; \
46 typedef struct sh_common {
47 SH_COMMON
48 } sh_common_t;
50 typedef struct sh_audio {
51 SH_COMMON
52 int aid;
53 // output format:
54 int sample_format;
55 int samplerate;
56 int samplesize;
57 int channels;
58 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
59 int i_bps; // == bitrate (compressed bytes/sec)
60 // in buffers:
61 int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
62 char* a_in_buffer;
63 int a_in_buffer_len;
64 int a_in_buffer_size;
65 // decoder buffers:
66 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
67 char* a_buffer;
68 int a_buffer_len;
69 int a_buffer_size;
70 // output buffers:
71 char* a_out_buffer;
72 int a_out_buffer_len;
73 int a_out_buffer_size;
74 // void* audio_out; // the audio_out handle, used for this audio stream
75 struct af_stream *afilter; // the audio filter stream
76 struct ad_functions *ad_driver;
77 #ifdef CONFIG_DYNAMIC_PLUGINS
78 void *dec_handle;
79 #endif
80 // win32-compatible codec parameters:
81 AVIStreamHeader audio;
82 WAVEFORMATEX* wf;
83 // codec-specific:
84 unsigned char* codecdata; // extra header data passed from demuxer to codec
85 int codecdata_len;
86 int pts_bytes; // bytes output by decoder after last known pts
87 } sh_audio_t;
89 typedef struct sh_video {
90 SH_COMMON
91 int vid;
92 float timer; // absolute time in video stream, since last start/seek
93 // frame counters:
94 float num_frames; // number of frames played
95 int num_frames_decoded; // number of frames decoded
96 // timing (mostly for mpeg):
97 double i_pts; // PTS for the _next_ I/P frame
98 float next_frame_time;
99 double last_pts;
100 double buffered_pts[20];
101 int num_buffered_pts;
102 // output format: (set by demuxer)
103 float fps; // frames per second (set only if constant fps)
104 float frametime; // 1/fps
105 float aspect; // aspect ratio stored in the file (for prescaling)
106 float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
107 int i_bps; // == bitrate (compressed bytes/sec)
108 int disp_w,disp_h; // display size (filled by fileformat parser)
109 // output driver/filters: (set by libmpcodecs core)
110 unsigned int outfmtidx;
111 struct vf_instance *vfilter; // the video filter chain, used for this video stream
112 int vf_initialized;
113 #ifdef CONFIG_DYNAMIC_PLUGINS
114 void *dec_handle;
115 #endif
116 // win32-compatible codec parameters:
117 AVIStreamHeader video;
118 BITMAPINFOHEADER* bih;
119 void* ImageDesc; // for quicktime codecs
120 } sh_video_t;
122 typedef struct sh_sub {
123 SH_COMMON
124 int sid;
125 char type; // t = text, v = VobSub, a = SSA/ASS
126 unsigned char* extradata; // extra header data passed from demuxer
127 int extradata_len;
128 #ifdef CONFIG_ASS
129 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
130 #endif
131 } sh_sub_t;
133 // demuxer.c:
134 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
135 sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid);
136 #define new_sh_video(d, i) new_sh_video_vid(d, i, i)
137 sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid);
138 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
139 sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid);
140 void free_sh_audio(demuxer_t *demuxer, int id);
141 void free_sh_video(sh_video_t *sh);
143 // video.c:
144 int video_read_properties(sh_video_t *sh_video);
145 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);
147 #endif /* MPLAYER_STHEADER_H */