annotate DOCS/tech/general.txt @ 26883:a365271c97a5

Revert commit r26897. XviD is the correct spelling of the codec. You can see it written in the codec own documentation and header files. Prefered name capitalization confirmed in conversation with XviD developer (prunedtree).
author iive
date Wed, 28 May 2008 23:04:41 +0000
parents 780caed72ac7
children 0f1b5b68af32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
1 So, I'll describe how this stuff works.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
2
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
3 The main modules:
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
4
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
5 1. stream.c: this is the input layer, this reads the input media (file, stdin,
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
6 vcd, dvd, network etc). what it has to know: appropriate buffering by
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
7 sector, seek, skip functions, reading by bytes, or blocks with any size.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
8 The stream_t (stream.h) structure describes the input stream, file/device.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
9
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
10 There is a stream cache layer (cache2.c), it's a wrapper for the stream
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
11 API. It does fork(), then emulates stream driver in the parent process,
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
12 and stream user in the child process, while proxying between them using
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
13 preallocated big memory chunk for FIFO buffer.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
14
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
15 2. demuxer.c: this does the demultiplexing (separating) of the input to
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
16 audio, video or dvdsub channels, and their reading by buffered packages.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
17 The demuxer.c is basically a framework, which is the same for all the
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
18 input formats, and there are parsers for each of them (mpeg-es,
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
19 mpeg-ps, avi, avi-ni, asf), these are in the demux_*.c files.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
20 The structure is the demuxer_t. There is only one demuxer.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
21
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
22 2.a. demux_packet_t, that is DP.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
23 Contains one chunk (avi) or packet (asf,mpg). They are stored in memory as
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
24 in linked list, cause of their different size.
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
25
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
26 2.b. demuxer stream, that is DS.
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
27 Struct: demux_stream_t
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
28 Every channel (a/v/s) has one. This contains the packets for the stream
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
29 (see 2.a). For now, there can be 3 for each demuxer :
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
30 - audio (d_audio)
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
31 - video (d_video)
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
32 - DVD subtitle (d_dvdsub)
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
33
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
34 2.c. stream header. There are 2 types (for now): sh_audio_t and sh_video_t
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
35 This contains every parameter essential for decoding, such as input/output
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
36 buffers, chosen codec, fps, etc. There are each for every stream in
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
37 the file. At least one for video, if sound is present then another,
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
38 but if there are more, then there'll be one structure for each.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
39 These are filled according to the header (avi/asf), or demux_mpg.c
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
40 does it (mpg) if it founds a new stream. If a new stream is found,
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
41 the ====> Found audio/video stream: <id> messages is displayed.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
42
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
43 The chosen stream header and its demuxer are connected together
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
44 (ds->sh and sh->ds) to simplify the usage. So it's enough to pass the
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
45 ds or the sh, depending on the function.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
46
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
47 For example: we have an asf file, 6 streams inside it, 1 audio, 5
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
48 video. During the reading of the header, 6 sh structs are created, 1
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
49 audio and 5 video. When it starts reading the packet, it chooses the
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
50 stream for the first found audio & video packet, and sets the sh
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
51 pointers of d_audio and d_video according to them. So later it reads
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
52 only these streams. Of course the user can force choosing a specific
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
53 stream with
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
54 -vid and -aid switches.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
55 A good example for this is the DVD, where the english stream is not
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
56 always the first, so every VOB has different language :)
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
57 That's when we have to use for example the -aid 128 switch.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
58
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
59 Now, how this reading works?
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
60 - demuxer.c/demux_read_data() is called, it gets how many bytes,
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
61 and where (memory address), would we like to read, and from which
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
62 DS. The codecs call this.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
63 - this checks if the given DS's buffer contains something, if so, it
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
64 reads from there as much as needed. If there isn't enough, it calls
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
65 ds_fill_buffer(), which:
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
66 - checks if the given DS has buffered packages (DP's), if so, it moves
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
67 the oldest to the buffer, and reads on. If the list is empty, it
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
68 calls demux_fill_buffer() :
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
69 - this calls the parser for the input format, which reads the file
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
70 onward, and moves the found packages to their buffers.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
71 Well it we'd like an audio package, but only a bunch of video
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
72 packages are available, then sooner or later the:
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
73 DEMUXER: Too many (%d in %d bytes) audio packets in the buffer
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
74 error shows up.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
75
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
76 2.d. video.c: this file/function handle the reading and assembling of the
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
77 video frames. each call to video_read_frame() should read and return a
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
78 single video frame, and it's duration in seconds (float).
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
79 The implementation is splitted to 2 big parts - reading from mpeg-like
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
80 streams and reading from one-frame-per-chunk files (avi, asf, mov).
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
81 Then it calculates duration, either from fixed FPS value, or from the
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
82 PTS difference between and after reading the frame.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
83
22289
780caed72ac7 cosmetics: typo fixes, usefuLL --> useful and aswell --> as well
diego
parents: 9644
diff changeset
84 2.e. other utility functions: there are some useful code there, like
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
85 AVI muxer, or mp3 header parser, but leave them for now.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
86
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
87 So everything is ok 'till now. It can be found in libmpdemux/ library.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
88 It should compile outside of mplayer tree, you just have to implement few
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
89 simple functions, like mp_msg() to print messages, etc.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
90 See libmpdemux/test.c for example.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
91
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
92 See also formats.txt, for description of common media file formats and their
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
93 implementation details in libmpdemux.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
94
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
95 Now, go on:
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
96
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
97 3. mplayer.c - ooh, he's the boss :)
1649
5b52297e559c typos, small fixes
arpi
parents: 1500
diff changeset
98 Its main purpose is connecting the other modules, and maintaining A/V
1500
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
99 sync.
877
3e94ca839def *** empty log message ***
gabucino
parents: 876
diff changeset
100
1649
5b52297e559c typos, small fixes
arpi
parents: 1500
diff changeset
101 The given stream's actual position is in the 'timer' field of the
5b52297e559c typos, small fixes
arpi
parents: 1500
diff changeset
102 corresponding stream header (sh_audio / sh_video).
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
103
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
104 The structure of the playing loop :
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
105 while(not EOF) {
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
106 fill audio buffer (read & decode audio) + increase a_frame
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
107 read & decode a single video frame + increase v_frame
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
108 sleep (wait until a_frame>=v_frame)
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
109 display the frame
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
110 apply A-V PTS correction to a_frame
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
111 handle events (keys,lirc etc) -> pause,seek,...
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
112 }
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
113
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
114 When playing (a/v), it increases the variables by the duration of the
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
115 played a/v.
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
116 - with audio this is played bytes / sh_audio->o_bps
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
117 Note: i_bps = number of compressed bytes for one second of audio
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
118 o_bps = number of uncompressed bytes for one second of audio
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
119 (this is = bps*samplerate*channels)
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
120 - with video this is usually == 1.0/fps, but I have to note that
138
5f2805a2d5de even more cosmetics
gabucino
parents: 136
diff changeset
121 fps doesn't really matters at video, for example asf doesn't have that,
5f2805a2d5de even more cosmetics
gabucino
parents: 136
diff changeset
122 instead there is "duration" and it can change per frame.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
123 MPEG2 has "repeat_count" which delays the frame by 1-2.5 ...
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
124 Maybe only AVI and MPEG1 has fixed fps.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
125
138
5f2805a2d5de even more cosmetics
gabucino
parents: 136
diff changeset
126 So everything works right until the audio and video are in perfect
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
127 synchronity, since the audio goes, it gives the timing, and if the
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
128 time of a frame passed, the next frame is displayed.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
129 But what if these two aren't synchronized in the input file?
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
130 PTS correction kicks in. The input demuxers read the PTS (presentation
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
131 timestamp) of the packages, and with it we can see if the streams
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
132 are synchronized. Then MPlayer can correct the a_frame, within
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
133 a given maximal bounder (see -mc option). The summary of the
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
134 corrections can be found in c_total .
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
135
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
136 Of course this is not everything, several things suck.
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
137 For example the soundcards delay, which has to be corrected by
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
138 MPlayer! The audio delay is the sum of all these:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
139 - bytes read since the last timestamp:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
140 t1 = d_audio->pts_bytes/sh_audio->i_bps
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
141 - if Win32/ACM then the bytes stored in audio input buffer
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
142 t2 = a_in_buffer_len/sh_audio->i_bps
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
143 - uncompressed bytes in audio out buffer
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
144 t3 = a_buffer_len/sh_audio->o_bps
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
145 - not yet played bytes stored in the soundcard's (or DMA's) buffer
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
146 t4 = get_audio_delay()/sh_audio->o_bps
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
147
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
148 From this we can calculate what PTS we need for the just played
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
149 audio, then after we compare this with the video's PTS, we have
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
150 the difference!
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
151
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
152 Life didn't get simpler with AVI. There's the "official" timing
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
153 method, the BPS-based, so the header contains how many compressed
1500
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
154 audio bytes or chunks belong to one second of frames.
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
155 In the AVI stream header there are 2 important fields, the
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
156 dwSampleSize, and dwRate/dwScale pairs:
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
157 - If the dwSampleSize is 0, then it's VBR stream, so its bitrate
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
158 isn't constant. It means that 1 chunk stores 1 sample, and
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
159 dwRate/dwScale gives the chunks/sec value.
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
160 - If the dwSampleSize is >0, then it's constant bitrate, and the
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
161 time can be measured this way: time = (bytepos/dwSampleSize) /
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
162 (dwRate/dwScale) (so the sample's number is divided with the
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
163 samplerate). Now the audio can be handled as a stream, which can
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
164 be cut to chunks, but can be one chunk also.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
165
1500
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
166 The other method can be used only for interleaved files: from
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
167 the order of the chunks, a timestamp (PTS) value can be calculated.
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
168 The PTS of the video chunks are simple: chunk number * fps
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
169 The audio is the same as the previous video chunk was.
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
170 We have to pay attention to the so called "audio preload", that is,
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
171 there is a delay between the audio and video streams. This is
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
172 usually 0.5-1.0 sec, but can be totally different.
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
173 The exact value was measured until now, but now the demux_avi.c
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
174 handles it: at the audio chunk after the first video, it calculates
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
175 the A/V difference, and take this as a measure for audio preload.
876
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
176
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
177 3.a. audio playback:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
178 Some words on audio playback:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
179 Not the playing is hard, but:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
180 1. knowing when to write into the buffer, without blocking
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
181 2. knowing how much was played of what we wrote into
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
182 The first is needed for audio decoding, and to keep the buffer
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
183 full (so the audio will never skip). And the second is needed for
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
184 correct timing, because some soundcards delay even 3-7 seconds,
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
185 which can't be forgotten about.
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
186 To solve this, the OSS gives several possibilities:
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
187 - ioctl(SNDCTL_DSP_GETODELAY): tells how many unplayed bytes are in
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
188 the soundcard's buffer -> perfect for timing, but not all drivers
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
189 support it :(
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
190 - ioctl(SNDCTL_DSP_GETOSPACE): tells how much can we write into the
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
191 soundcard's buffer, without blocking. If the driver doesn't
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
192 support GETODELAY, we can use this to know how much the delay is.
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
193 - select(): should tell if we can write into the buffer without
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
194 blocking. Unfortunately it doesn't say how much we could :((
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
195 Also, doesn't/badly works with some drivers.
1f26877717f1 *** empty log message ***
gabucino
parents: 551
diff changeset
196 Only used if none of the above works.
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
197
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
198 4. Codecs. Consists of libmpcodecs/* and separate files or libs,
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
199 for example liba52, libmpeg2, xa/*, alaw.c, opendivx/*, loader, mp3lib.
1500
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
200
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
201 mplayer.c doesn't call them directly, but through the dec_audio.c and
1500
526047bdda07 *** empty log message ***
gabucino
parents: 994
diff changeset
202 dec_video.c files, so the mplayer.c doesn't have to know anything about
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
203 the codecs.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
204
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
205 libmpcodecs contains wrapper for every codecs, some of them include the
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
206 codec function implementation, some calls functions from other files
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
207 included with mplayer, some calls optional external libraries.
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
208 file naming convention in libmpcodecs:
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
209 ad_*.c - audio decoder (called through dec_audio.c)
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
210 vd_*.c - video decoder (called through dec_video.c)
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
211 ve_*.c - video encoder (used by mencoder)
9644
0fe056bdb135 vop -> vf change, small fixes. The Polish documentation should be checked for correctness.
jonas
parents: 7399
diff changeset
212 vf_*.c - video filter (see option -vf)
132
642d64c1cc33 translation by Gabucino
gabucino
parents:
diff changeset
213
6848
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
214 On this topic, see also:
7399
56bb20a00bc9 cross-ref
arpi
parents: 6848
diff changeset
215 libmpcodecs.txt - The structure of the codec-filter path, with explanation
6848
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
216 dr-methods.txt - Direct rendering, MPI buffer management for video codecs
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
217 codecs.conf.txt - How to write/edit codec configuration file (codecs.conf)
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
218 codec-devel.txt - Mike's hints about codec development - a bit OUTDATED
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
219 hwac3.txt - about SP/DIF audio passthrough
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
220
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
221 5. libvo: this displays the frame.
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
222
5586
6ce9c6231bdd updated
arpi
parents: 5244
diff changeset
223 for details on this, read libvo.txt
551
e6263c6d377a kommit, kommit
gabucino
parents: 404
diff changeset
224
986
fadb8eeff7a8 commitus interruptus
gabucino
parents: 878
diff changeset
225 6. libao2: this control audio playing
6848
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
226 6.a audio plugins
986
fadb8eeff7a8 commitus interruptus
gabucino
parents: 878
diff changeset
227
6848
4846c53f548d libao2 stuff move dto libao2.txt
arpi
parents: 5586
diff changeset
228 for details on this, read libao2.txt
4582
9c13e907f284 applied patch from Andres Johansson
gabucino
parents: 4161
diff changeset
229