[MPlayer-G2-dev] New libao2

Anders Johansson ajh at watri.org.au
Thu Jul 17 02:24:16 CEST 2003


Hi,

> Arpi said:
> >
> > we should define the metrics of in/out parameters, ie. byte vs. sample,
> > and that stereo sample-pair does count one or two samples.
> > and that bps is bits-per-second, bits-per-sample, bytes-per-second or
> > what. it made the most confusion around mplayer-g1 audio layer causing
> > various bugs.
> >
> Agree:))

I have tried to be consistent:

rate   is sampe rate.
nch    is number of channels.
format is a bitfield describing the sample format.
bps    is the number of bytes per sample.
len    is the current number of bytes in the buffer.
audio  contains the current audio data. 

Looking back len could have been set as number of samples in buffer,
or number of samples per channel. I can still make that change if it
is desirable.

Below definition is not used.

> Without seeing the actual code.
> > /* Audio data chunk */
> > typedef struct aio_data_s
> > {
> >   void* audio;  // data buffer
> >   int size;     // size of bffer
> >   int len;      // bytes in buffer
> > }aio_data_t;
> hmm
> size is the size in samples?
> I have though that if could be good to have something like
> ....
> void * audio;
> int number_of_samples; //(44100 for one second)
> int size_of_sample; //( 4 bytes for 16bit stereo)
> int chanels; //(2 for stereo)
> .... //? mabe format here too?
> 
> this way an compressed data could be hanled the same way as non compressed
> with only limitation that if the compressed data is variable size then it
> it could be only one sample (number_of_samples=1)

Just extend the format bitfield with some new types and we have what you want.

> This structure also makes it easier to add samples to the current buffer
> and/or to extract them.

Agree.

> >
> > Do you have plans to replace libaf, or it's "good as-is" ?
> > For audio in/out it's ok to use packets, but i like fifo-type buffers
> > better for filters (esp. that you cannot give exact in/out rate for some
> > filters, see buffer size over/underflow problems in libaf when using
> > resample). (i don't like its "packetized buffer" design but i have no
> > time in the near future to implement my idea)
> >
> >
> > A'rpi / Astral & ESP-team
> >
> 
> Best Regards
>    Ivan Kalvachev
>   iive

//Anders



More information about the MPlayer-G2-dev mailing list