summaryrefslogtreecommitdiffstats
path: root/DOCS/tech/general.txt
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/tech/general.txt')
-rw-r--r--DOCS/tech/general.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/DOCS/tech/general.txt b/DOCS/tech/general.txt
index ff32fe7825..90bd695220 100644
--- a/DOCS/tech/general.txt
+++ b/DOCS/tech/general.txt
@@ -232,4 +232,47 @@ Now, go on:
flip_page(): this is called after each frame, this diplays the buffer for
real. This is 'swapbuffers' when double-buffering.
+6. libao2: this control audio playing
+
+ As in libvo (see 5.) also here are some drivers, based on the same API:
+
+statis int control(int cmd, int arg);
+ This is for reading/setting driver-specific and other special parameters.
+ Not really used for now.
+
+static int init(int rate,int channels,int format,int flags);
+ The init of driver, opens device, sets sample rate, channels, sample format
+ parameters.
+ Sample format: usually AFMT_S16_LE or AFMT_U8, for more definitions see
+ dec_audio.c and linux/soundcards.h files!
+
+static void uninit();
+ Guess what.
+ Ok I help: closes the device, not (yet) called when exit.
+
+statis void reset();
+ Resets device. To be exact, it's for deleting buffers' contents,
+ so after reset() the previously received stuff won't be output.
+ (called if pause or seek)
+
+static int get_space();
+ Returns how many bytes can be written into the audio buffer without
+ blocking (making caller process wait). If the buffer is (nearly) full,
+ has to return 0!
+ If it never gives 0, MPlayer won't work!
+
+static int play(void* data,int len,int flags);
+ Plays a bit of audio, which is received throught the "data" memory area, with
+ a size of "len". The "flags" isn't used yet. It has to copy the data, because
+ they can be overwritten after the call is made. Doesn't really have to use
+ all the bytes, it has to give back how many have been used (copied to
+ buffer).
+
+static int get_delay();
+ Has to return how many bytes are in the audio buffer. Be exact, if possible,
+ since the whole timing depends on this! In the worst case, return the size
+ of the buffer.
+
+!!! Because the video is synchronized to the audio (card), it's very important
+!!! that the get_space and get_delay are working!