[FFmpeg-devel] [RFC] libavfilter audio API and related issues

S.N. Hemanth Meenakshisundaram smeenaks
Sat Jun 5 22:24:35 CEST 2010


Michael Niedermayer <michaelni <at> gmx.at> writes:

>
> On Wed, Jun 02, 2010 at 06:29:48AM +0000, S.N. Hemanth Meenakshisundaram
wrote:
> > Michael Niedermayer <michaelni <at> gmx.at> writes:
> >
> > >
> > > On Sat, May 22, 2010 at 10:37:18PM -0700, S.N. Hemanth
Meenakshisundaram wrote:
> > > > On 05/02/2010 12:08 PM, Stefano Sabatini wrote:
> > > >> On date Wednesday 2010-04-28 07:07:54 +0000, S.N. Hemanth
> > > >> Meenakshisundaram encoded:
> > > >>
> > > >>> Stefano Sabatini<stefano.sabatini-lala<at>  poste.it>  writes:
> > > >>>
> > > >>>> Follow some notes about a possible design for the audio support in
> > > >>>> libavfilter.
> > > >>>>
> > > >>>> AVFilterSamples struct
> > > >>>> ======================
> > > >>>>
> > > >>>> (Already defined in afilters, but renamed AVFilterBuffer at some
> > > >>>> point.)
> > > >>>>
> > > >>>> Follows a possible definition (with some differences whit
respect to
> > > >>>> that currently implemented in afilters):
> > > >>>>
> > > >>>>
> > > >>> [...]
> > > [...]
> > >
> >
> > Hi All,
> >
> > I am working on the audio structures and functions. Keeping parameters
like # of
> > channels at the buffer level as Michael recommended above. [...]
>

Hi All,

Attached is a rough draft of the audio API. I am now writing a simple
volume scaling filter using this API. Please review and comment. Some
observations:

1. I am temporarily retaining the AVFilterPic struct as a separate struct
for video and have introduced the AVFilterBuffer struct. The plan is to
merge these two. AVFilterSamplesRef will reference this structure for
audio.

2. AVFilterSamplesRef has a lot of redundancy. E.g. 'size' is same as
samples_nb*bytes_per_sample*num_channels and sampstep is the distance to
next sample of same channel (for both planar and packed cases). This is to
avoid recomputing sizes. Please let me know if its too redundant.

3. data[8] will have the start addresses of the data for that buffer for
up to 8 channels in case of planar. If packed, the entire buffer ptr is at
data[0] and the rest are NULL.

4. AVFilterFormats and formats.c were modified to support audio (sample)
formats as well. At the moment, I am skipping channel layouts here. Need
to handle differences in supported channel layouts of different filters in
some other way.

5. 'filter_samples' does the job of start_frame, draw_slice and end_frame
all at once.

6. Whenever audio variables like aformat were introduced, I plan to change
the corresponding video variables like format to vformat etc. But at the
moment I haven't done this so as not to break video.

I am not sure if this is a right use of this RFC thread. Please let me
know if I need to move this to a separate thread on ffmpeg-soc instead.

Regards,
Hemanth
-------------- next part --------------
A non-text attachment was scrubbed...
Name: audioapi.diff
Type: application/octet-stream
Size: 28360 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100605/9acae846/attachment.obj>



More information about the ffmpeg-devel mailing list