enable fontconfig support by default. This change takes only in effect,
[mplayer/glamo.git] / libmpdemux / stheader.h
bloba64e65fb7339b2e4fae2624da691942e1647cd65
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 typedef struct {
29 int aid;
30 demux_stream_t *ds;
31 struct codecs_st *codec;
32 unsigned int format;
33 int initialized;
34 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
35 // output format:
36 int sample_format;
37 int samplerate;
38 int samplesize;
39 int channels;
40 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
41 int i_bps; // == bitrate (compressed bytes/sec)
42 // in buffers:
43 int audio_in_minsize; // max. compressed packet size (== min. in buffer size)
44 char* a_in_buffer;
45 int a_in_buffer_len;
46 int a_in_buffer_size;
47 // decoder buffers:
48 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize)
49 char* a_buffer;
50 int a_buffer_len;
51 int a_buffer_size;
52 // output buffers:
53 char* a_out_buffer;
54 int a_out_buffer_len;
55 int a_out_buffer_size;
56 // void* audio_out; // the audio_out handle, used for this audio stream
57 struct af_stream_s *afilter; // the audio filter stream
58 struct ad_functions_s* ad_driver;
59 #ifdef CONFIG_DYNAMIC_PLUGINS
60 void *dec_handle;
61 #endif
62 // win32-compatible codec parameters:
63 AVIStreamHeader audio;
64 WAVEFORMATEX* wf;
65 // codec-specific:
66 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
67 unsigned char* codecdata; // extra header data passed from demuxer to codec
68 int codecdata_len;
69 double pts; // last known pts value in output from decoder
70 int pts_bytes; // bytes output by decoder after last known pts
71 char* lang; // track language
72 int default_track;
73 } sh_audio_t;
75 typedef struct {
76 int vid;
77 demux_stream_t *ds;
78 struct codecs_st *codec;
79 unsigned int format;
80 int initialized;
81 float timer; // absolute time in video stream, since last start/seek
82 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar)
83 // frame counters:
84 float num_frames; // number of frames played
85 int num_frames_decoded; // number of frames decoded
86 // timing (mostly for mpeg):
87 double pts; // predicted/interpolated PTS of the current frame
88 double i_pts; // PTS for the _next_ I/P frame
89 float next_frame_time;
90 double last_pts;
91 double buffered_pts[20];
92 int num_buffered_pts;
93 // output format: (set by demuxer)
94 float fps; // frames per second (set only if constant fps)
95 float frametime; // 1/fps
96 float aspect; // aspect ratio stored in the file (for prescaling)
97 float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files)
98 int i_bps; // == bitrate (compressed bytes/sec)
99 int disp_w,disp_h; // display size (filled by fileformat parser)
100 // output driver/filters: (set by libmpcodecs core)
101 unsigned int outfmtidx;
102 struct vf_instance_s *vfilter; // the video filter chain, used for this video stream
103 int vf_initialized;
104 #ifdef CONFIG_DYNAMIC_PLUGINS
105 void *dec_handle;
106 #endif
107 // win32-compatible codec parameters:
108 AVIStreamHeader video;
109 BITMAPINFOHEADER* bih;
110 void* ImageDesc; // for quicktime codecs
111 // codec-specific:
112 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
113 } sh_video_t;
115 typedef struct {
116 int sid;
117 char type; // t = text, v = VobSub, a = SSA/ASS
118 unsigned char* extradata; // extra header data passed from demuxer
119 int extradata_len;
120 #ifdef CONFIG_ASS
121 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
122 #endif
123 char* lang; // track language
124 int default_track;
125 } sh_sub_t;
127 // demuxer.c:
128 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i)
129 sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid);
130 #define new_sh_video(d, i) new_sh_video_vid(d, i, i)
131 sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid);
132 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i)
133 sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid);
134 void free_sh_audio(demuxer_t *demuxer, int id);
135 void free_sh_video(sh_video_t *sh);
137 // video.c:
138 int video_read_properties(sh_video_t *sh_video);
139 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);
141 #endif /* MPLAYER_STHEADER_H */