Mercurial > mplayer.hg
annotate libmpdemux/stheader.h @ 19096:30084f256717
print frame type and keep track of last encountered keyframe
author | ivo |
---|---|
date | Sat, 15 Jul 2006 10:35:22 +0000 |
parents | d9a75b26da6c |
children | 70a5e89ea4cd |
rev | line source |
---|---|
4933 | 1 #ifndef __ST_HEADER_H |
2 #define __ST_HEADER_H 1 | |
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 { |
10 demux_stream_t *ds; | |
7467 | 11 struct codecs_st *codec; |
303 | 12 unsigned int format; |
1656 | 13 int inited; |
18309
87161f96fa66
Change common pts variables from floats to doubles. Individual demuxers
uau
parents:
18242
diff
changeset
|
14 double delay; // relative (to sh_video->timer) time in audio stream |
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 |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
38 void* 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 { | |
55 demux_stream_t *ds; | |
7467 | 56 struct codecs_st *codec; |
303 | 57 unsigned int format; |
1656 | 58 int inited; |
8057 | 59 float timer; // absolute time in video stream, since last start/seek |
17643 | 60 float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) |
7467 | 61 // frame counters: |
62 float num_frames; // number of frames played | |
63 int num_frames_decoded; // number of frames decoded | |
8965 | 64 // timing (mostly for mpeg): |
18309
87161f96fa66
Change common pts variables from floats to doubles. Individual demuxers
uau
parents:
18242
diff
changeset
|
65 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
|
66 double i_pts; // PTS for the _next_ I/P frame |
18917
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
18708
diff
changeset
|
67 double buffered_pts[20]; |
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
18708
diff
changeset
|
68 int num_buffered_pts; |
7467 | 69 // output format: (set by demuxer) |
70 float fps; // frames per second (set only if constant fps) | |
71 float frametime; // 1/fps | |
72 float aspect; // aspect ratio stored in the file (for prescaling) | |
73 int i_bps; // == bitrate (compressed bytes/sec) | |
74 int disp_w,disp_h; // display size (filled by fileformat parser) | |
75 // output driver/filters: (set by libmpcodecs core) | |
303 | 76 unsigned int outfmtidx; |
7467 | 77 void* video_out; // the video_out handle, used for this video stream |
78 void* vfilter; // the video filter chain, used for this video stream | |
79 int vf_inited; | |
8152 | 80 #ifdef DYNAMIC_PLUGINS |
81 void *dec_handle; | |
82 #endif | |
7467 | 83 // win32-compatible codec parameters: |
291 | 84 AVIStreamHeader video; |
7467 | 85 BITMAPINFOHEADER* bih; |
8158 | 86 void* ImageDesc; // for quicktime codecs |
7467 | 87 // codec-specific: |
88 void* context; // codec-specific stuff (usually HANDLE or struct pointer) | |
291 | 89 } sh_video_t; |
90 | |
7467 | 91 // demuxer.c: |
1289 | 92 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); |
93 sh_video_t* new_sh_video(demuxer_t *demuxer,int id); | |
18708
9e2b300db17b
Change free_sh_audio() to take demuxer and stream id as parameters
uau
parents:
18309
diff
changeset
|
94 void free_sh_audio(demuxer_t *demuxer, int id); |
5084 | 95 void free_sh_video(sh_video_t *sh); |
426 | 96 |
7467 | 97 // video.c: |
2567 | 98 int video_read_properties(sh_video_t *sh_video); |
99 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); | |
4933 | 100 |
101 #endif |