Mercurial > mplayer.hg
annotate libmpdemux/stheader.h @ 26014:6e9c78324790
Fix r26032: wrong sub stream id assigned to dvdsub_id.
author | eugeni |
---|---|
date | Thu, 21 Feb 2008 09:47:03 +0000 |
parents | afa125da85cf |
children | 4129c8cfa742 |
rev | line source |
---|---|
23689
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
23687
diff
changeset
|
1 #ifndef STHEADER_H |
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
23687
diff
changeset
|
2 #define STHEADER_H |
4933 | 3 |
12341
0db4a3a5b01d
removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents:
8965
diff
changeset
|
4 #include "aviheader.h" |
0db4a3a5b01d
removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents:
8965
diff
changeset
|
5 #include "ms_hdr.h" |
7471 | 6 |
7 // Stream headers: | |
4196 | 8 |
291 | 9 typedef struct { |
19540 | 10 int aid; |
291 | 11 demux_stream_t *ds; |
7467 | 12 struct codecs_st *codec; |
303 | 13 unsigned int format; |
25962 | 14 int initialized; |
17643 | 15 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) |
291 | 16 // output format: |
7467 | 17 int sample_format; |
291 | 18 int samplerate; |
19 int samplesize; | |
20 int channels; | |
746 | 21 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) |
22 int i_bps; // == bitrate (compressed bytes/sec) | |
296 | 23 // in buffers: |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
24 int audio_in_minsize; // max. compressed packet size (== min. in buffer size) |
291 | 25 char* a_in_buffer; |
26 int a_in_buffer_len; | |
27 int a_in_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
28 // decoder buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
29 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize) |
296 | 30 char* a_buffer; |
31 int a_buffer_len; | |
32 int a_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
33 // output buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
34 char* a_out_buffer; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
35 int a_out_buffer_len; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
36 int a_out_buffer_size; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
37 // void* audio_out; // the audio_out handle, used for this audio stream |
24891 | 38 struct af_stream_s *afilter; // the audio filter stream |
14819
601e2c8a2922
Remove file-global mpadec, add ad_driver member to sh_audio_t instead.
hzoli
parents:
12341
diff
changeset
|
39 struct ad_functions_s* ad_driver; |
8152 | 40 #ifdef DYNAMIC_PLUGINS |
41 void *dec_handle; | |
42 #endif | |
7467 | 43 // win32-compatible codec parameters: |
291 | 44 AVIStreamHeader audio; |
7467 | 45 WAVEFORMATEX* wf; |
46 // codec-specific: | |
3642
2cef9d562af0
void* context added - it should keep the codec-specific stuff (struct ptr or HANDLE)
arpi
parents:
2567
diff
changeset
|
47 void* context; // codec-specific stuff (usually HANDLE or struct pointer) |
7467 | 48 unsigned char* codecdata; // extra header data passed from demuxer to codec |
5301 | 49 int codecdata_len; |
18242
caac2ca98168
4 - Implement a better way to calculate current audio pts and use it for
rtognimp
parents:
17643
diff
changeset
|
50 double pts; // last known pts value in output from decoder |
caac2ca98168
4 - Implement a better way to calculate current audio pts and use it for
rtognimp
parents:
17643
diff
changeset
|
51 int pts_bytes; // bytes output by decoder after last known pts |
291 | 52 } sh_audio_t; |
53 | |
54 typedef struct { | |
19540 | 55 int vid; |
291 | 56 demux_stream_t *ds; |
7467 | 57 struct codecs_st *codec; |
303 | 58 unsigned int format; |
25962 | 59 int initialized; |
8057 | 60 float timer; // absolute time in video stream, since last start/seek |
17643 | 61 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) |
7467 | 62 // frame counters: |
63 float num_frames; // number of frames played | |
64 int num_frames_decoded; // number of frames decoded | |
8965 | 65 // timing (mostly for mpeg): |
18309
87161f96fa66
Change common pts variables from floats to doubles. Individual demuxers
uau
parents:
18242
diff
changeset
|
66 double pts; // predicted/interpolated PTS of the current frame |
87161f96fa66
Change common pts variables from floats to doubles. Individual demuxers
uau
parents:
18242
diff
changeset
|
67 double i_pts; // PTS for the _next_ I/P frame |
21077 | 68 float next_frame_time; |
69 double last_pts; | |
18917
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
18708
diff
changeset
|
70 double buffered_pts[20]; |
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
18708
diff
changeset
|
71 int num_buffered_pts; |
7467 | 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) | |
24299
725638f690bb
added .stream_aspect to st_video_t: if non-zero and if not specified otherwise
nicodvb
parents:
23689
diff
changeset
|
76 float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files) |
7467 | 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) | |
303 | 80 unsigned int outfmtidx; |
24891 | 81 struct vf_instance_s *vfilter; // the video filter chain, used for this video stream |
25962 | 82 int vf_initialized; |
8152 | 83 #ifdef DYNAMIC_PLUGINS |
84 void *dec_handle; | |
85 #endif | |
7467 | 86 // win32-compatible codec parameters: |
291 | 87 AVIStreamHeader video; |
7467 | 88 BITMAPINFOHEADER* bih; |
8158 | 89 void* ImageDesc; // for quicktime codecs |
7467 | 90 // codec-specific: |
91 void* context; // codec-specific stuff (usually HANDLE or struct pointer) | |
291 | 92 } sh_video_t; |
93 | |
20876
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
94 typedef struct { |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
95 int sid; |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
96 char type; // t = text, v = VobSub, a = SSA/ASS |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
97 int has_palette; // If we have a valid palette |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
98 unsigned int palette[16]; // for VobSubs |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
99 int width, height; // for VobSubs |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
100 int custom_colors; |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
101 unsigned int colors[4]; |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
102 int forced_subs_only; |
25652 | 103 unsigned char* extradata; // extra header data passed from demuxer |
104 int extradata_len; | |
20876
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
105 #ifdef USE_ASS |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
106 ass_track_t* ass_track; // for SSA/ASS streams (type == 'a') |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
107 #endif |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
108 } sh_sub_t; |
0587328d9392
Move sh_sub_t to stheader.h, where all the other sh structs are defined
reimar
parents:
20873
diff
changeset
|
109 |
7467 | 110 // demuxer.c: |
19540 | 111 #define new_sh_audio(d, i) new_sh_audio_aid(d, i, i) |
112 sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid); | |
113 #define new_sh_video(d, i) new_sh_video_vid(d, i, i) | |
114 sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid); | |
20873 | 115 #define new_sh_sub(d, i) new_sh_sub_sid(d, i, i) |
116 sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid); | |
18708
9e2b300db17b
Change free_sh_audio() to take demuxer and stream id as parameters
uau
parents:
18309
diff
changeset
|
117 void free_sh_audio(demuxer_t *demuxer, int id); |
5084 | 118 void free_sh_video(sh_video_t *sh); |
426 | 119 |
7467 | 120 // video.c: |
2567 | 121 int video_read_properties(sh_video_t *sh_video); |
122 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); | |
4933 | 123 |
25535
3baf6a2283da
Add explanatory comments to the #endif part of multiple inclusion guards.
diego
parents:
24891
diff
changeset
|
124 #endif /* STHEADER_H */ |