[FFmpeg-devel] [RFC] libavfilter audio API and related issues
S.N. Hemanth Meenakshisundaram
smeenaks
Mon Jun 14 04:20:55 CEST 2010
On 06/05/2010 01:24 PM, 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.
>>>>>>>> [...]
>>>>>>>>
> Hi All,
>
> Attached is a rough draft of the audio API. [...]
>
Hi All,
I now have a working audio filter framework. Made some changes to the
audio API from last week and the earlier ffplay changes based on
comments and some problems encountered along the way. Now when playing a
video/audio file, the input and output filters are created and the audio
data passes through these two filters and plays out. The video filters
work without any breakages.
Here are the changes and comments incorporated:
1. AVFilterSamplesRef now has a pts field as suggested. I can't find a
pos field for audio in existing code so I haven't added that yet.
2. avfilter_get_audio_buffer now takes buffer size as an input parameter
instead of samples_nb (number of samples) since buffer size is readily
available from audio_decode_frame. samples_nb is calculated based on
buffer size and sample format+channel layout.
3. Moved around some code in ffplay to initialize audio filters only
after audio decoder is initialized.
4. Minor additions to avfiltergraph.c to support audio filters.
5. Made macros for some repeated code in formats.c and using memset to
set the values of the 'data[8]' array in defaults.c as Stefano
suggested. Also, in case of packed formats, all data pointers of valid
channels now point to the single monolithic buffer. Some more macros may
be possible in formats.c
6. Some other nits and alignments pointed out earlier.
Some questions:
1. Audio decode frame uses parameters like num_channels, sample_fmt etc
from 'is->audio_st->codec' (the audio codec context). That is also where
I read these parameters and put them in the audio buffers given to the
filter chain. So if these parameters change between audio frames, will
the new values reflect in the codec context?
2. I can't find a variable indicating whether audio data is planar or
packed. Is there one? I am assuming it is always packed right now. How
can I find out whether a frame returned by audio_decode_frame is planar
or packed?
3. The audio decoder's codec context has two variables num_channels and
channel_layout. num_channels is the one currently used by
audio_decode_frame when calculating number of samples in a frame etc.
Will the decoders all populate channel_layout as well correctly?
4. Currently, audio_decode_frame always outputs frames with a 16-bit
sample size. If the codec output is in a different format, it calls a
conversion function. I guess the plan is to eventually remove this and
replace it with an output filter that can output in any required sample
format?
Please review and comment.
Regards,
Hemanth
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: audiofilt.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100613/174b37be/attachment.asc>
More information about the ffmpeg-devel
mailing list