[MPlayer-dev-eng] New audio filter layer

Anders Johansson ajh at atri.curtin.edu.au
Fri Aug 2 04:41:29 CEST 2002


Hi,

I think the old thread for this topic is a bit dead, so I will start a
new one. I am including the proposal for the new filter layer again.

This time the filter actually works and there are diffs for Makefile
and mplayer.c if you have time to thest it. There is also a sample
filter included (improved version of delay).

My idea for buffering is as follows:

1. af_init is called no buffess are created.

2. Playing starts  playsize=audio_out->get_space();

3. Get size multiplier form af layer mul=af_getmul();

4. Calculate number of bytes requires to fill aodio out buffer
   playsize*= (int)((double)playsize * mul);  mul can be less than 1.

5. Get playsize amount of data from decode_audio()

6. Filter data through filters af_play(pafd); buffers are reallocated
   using helper macro RESIZE_LOCAL_BUFFER() inside the filters (see
   af_delay.c) if they are too small. This way runtime loaded filters
   are compensated for.

7. If filtered data chunk is too large for ao_play() buffer it using a
   dynamic buffer. I need help implementing this.


The diff breaks mplayer.c (a little bit) and is _not_ meant for
inclusion in the main branch.

Edit af.c around line 259 to enable the delay filter.

As you will notice we need functionality to compensate for delay
ceated by the filters. I will implement this once the buffering is
solved.


I have an idea: I would like to take out some or all of the audio
stream manageent from mplayer.c and create a new file called
mp_audio.c where buffering, driver magement, the mixer and hardware
probing (through the drivers) is implemented. I would like to do the
same for mencoder. Do you like ths idea?



I have been working on perfecting the resampling so that it becomes
exact in conversion frequency, it is nearly finished. My changes will
included in the new filter layer. I have also started to write on a
generic signal processing package for audio that can be used for
writing new filters (and visualisation plugins :).



Cheers,
//Anders
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libaf.tar.gz
Type: application/octet-stream
Size: 10276 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020802/fc62a8dc/attachment.obj>


More information about the MPlayer-dev-eng mailing list