annotate stheader.h @ 2155:b961f2f829e1

Similar to 1.9
author jaf
date Wed, 10 Oct 2001 18:04:03 +0000
parents 624df8ea0e0e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
1 // Stream headers:
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
2
303
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
3 /*
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
4 typedef struct {
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
5 int driver;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
6 // codec descriptor from codec.conf
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
7 } codecinfo_t;
303
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
8 */
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
9
1828
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
10 #ifdef HAVE_OGGVORBIS
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
11 #include <math.h>
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
12 #include <vorbis/codec.h>
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
13 typedef struct {
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
14 ogg_sync_state oy; /* sync and verify incoming physical bitstream */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
15 ogg_stream_state os; /* take physical pages, weld into a logical
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
16 stream of packets */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
17 ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
18 ogg_packet op; /* one raw packet of data for decode */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
19
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
20 vorbis_info vi; /* struct that stores all the static vorbis bitstream
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
21 settings */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
22 vorbis_comment vc; /* struct that stores all the bitstream user comments */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
23 vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
24 vorbis_block vb; /* local working space for packet->PCM decode */
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
25 } ov_struct_t;
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
26 #endif
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
27
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
28 typedef struct {
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
29 demux_stream_t *ds;
303
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
30 unsigned int format;
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
31 codecs_t *codec;
1656
cd77b8e28f82 new field: inited
arpi
parents: 1546
diff changeset
32 int inited;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
33 // output format:
1369
7a2f1881b776 a_frame, v_frame killed, using sh_audio/video->timer. has_audio not more used after initialization.
arpi
parents: 1289
diff changeset
34 float timer; // value of old a_frame
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
35 int samplerate;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
36 int samplesize;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
37 int channels;
746
cd1f0d4de0b8 new audio playback and A-V sync code
arpi_esp
parents: 587
diff changeset
38 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
cd1f0d4de0b8 new audio playback and A-V sync code
arpi_esp
parents: 587
diff changeset
39 int i_bps; // == bitrate (compressed bytes/sec)
296
c3d7a28a0d1a audio init moved to dec_audio.c
arpi_esp
parents: 291
diff changeset
40 // in buffers:
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
41 char* a_in_buffer;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
42 int a_in_buffer_len;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
43 int a_in_buffer_size;
296
c3d7a28a0d1a audio init moved to dec_audio.c
arpi_esp
parents: 291
diff changeset
44 // out buffers:
c3d7a28a0d1a audio init moved to dec_audio.c
arpi_esp
parents: 291
diff changeset
45 char* a_buffer;
c3d7a28a0d1a audio init moved to dec_audio.c
arpi_esp
parents: 291
diff changeset
46 int a_buffer_len;
c3d7a28a0d1a audio init moved to dec_audio.c
arpi_esp
parents: 291
diff changeset
47 int a_buffer_size;
758
5a92a5601666 better audio out buffering & sample_format added
arpi_esp
parents: 746
diff changeset
48 int sample_format;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
49 // win32 codec stuff:
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
50 AVIStreamHeader audio;
432
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
51 WAVEFORMATEX *wf;
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
52 // char wf_ext[64]; // in format
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
53 WAVEFORMATEX o_wf; // out format
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
54 HACMSTREAM srcstream; // handle
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
55 int audio_in_minsize;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
56 int audio_out_minsize;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
57 // other codecs:
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
58 // ac3_frame_t *ac3_frame;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
59 void* ac3_frame;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
60 int pcm_bswap;
1828
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
61 #ifdef HAVE_OGGVORBIS
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
62 ov_struct_t *ov; // should be assigned on init
60afe3421c04 OggVorbis support, ALPHA state!
atmos4
parents: 1656
diff changeset
63 #endif
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
64 } sh_audio_t;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
65
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
66 typedef struct {
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
67 demux_stream_t *ds;
303
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
68 unsigned int format;
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
69 codecs_t *codec;
1656
cd77b8e28f82 new field: inited
arpi
parents: 1546
diff changeset
70 int inited;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
71 // output format:
1369
7a2f1881b776 a_frame, v_frame killed, using sh_audio/video->timer. has_audio not more used after initialization.
arpi
parents: 1289
diff changeset
72 float timer; // value of old v_frame
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
73 float fps;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
74 float frametime; // 1/fps
1400
2bf9c561b01d stage2 step 1
arpi
parents: 1369
diff changeset
75 int i_bps; // == bitrate (compressed bytes/sec)
399
33115689181a some more fields in sh_video_t
arpi_esp
parents: 303
diff changeset
76 int disp_w,disp_h; // display size (filled by fileformat parser)
33115689181a some more fields in sh_video_t
arpi_esp
parents: 303
diff changeset
77 // int coded_w,coded_h; // coded size (filled by video codec)
2031
624df8ea0e0e New aspect prescale code, parses aspect value from mpeg sequence header or commandline.
atmos4
parents: 1828
diff changeset
78 float aspect;
303
828ec81e0d64 codecs.conf support
arpi_esp
parents: 296
diff changeset
79 unsigned int outfmtidx;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
80 // unsigned int bitrate;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
81 // buffers:
1400
2bf9c561b01d stage2 step 1
arpi
parents: 1369
diff changeset
82 float num_frames; // number of frames played
1546
d4cd08b06665 display number of decoded frames (for progr. mpeg2)
arpi
parents: 1400
diff changeset
83 int num_frames_decoded; // number of frames decoded
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
84 char *our_out_buffer;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
85 // win32 codec stuff:
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
86 AVIStreamHeader video;
432
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
87 BITMAPINFOHEADER *bih; // in format
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
88 BITMAPINFOHEADER o_bih; // out format
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
89 HIC hic; // handle
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
90 } sh_video_t;
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents:
diff changeset
91
1289
3f490fad9bdf some code clanup (first step to libdemuxer)
arpi
parents: 758
diff changeset
92 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id);
3f490fad9bdf some code clanup (first step to libdemuxer)
arpi
parents: 758
diff changeset
93 sh_video_t* new_sh_video(demuxer_t *demuxer,int id);
426
26e513f392b2 new stream selection code
arpi_esp
parents: 399
diff changeset
94