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

Bobby Bingham uhmmmm
Thu Apr 8 15:41:37 CEST 2010


On Mon, 5 Apr 2010 13:55:43 +0200
Stefano Sabatini <stefano.sabatini-lala at poste.it> wrote:

> 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):
> 
> typedef struct AVFilterSamples
> {
>     uint8_t *data;
>     int data_size;   /* data size in bytes */
>     enum SampleFormat format;
> 
>     unsigned refcount;
> 
>     /** private data to be used by a custom free function */
>     void *priv;
>     void (*free)(struct AVFilterSamples *samples);
> } AVFilterSamples;
> 
> typedef struct AVFilterSamplesRef
> {
>     AVFilterSamples *samples;
>     uint8_t *data;              ///< samples data
>     unsigned data_size;

I'm sure I've seen threads about this in the past, but I didn't follow
them closely at the time.  How do you define the number of channels and
the channel order?

> 
>     int64_t pts;                ///< presentation timestamp in units of 1/AV_TIME_BASE

I don't know how this is used in the rest of libav*, so maybe this is
obvious to someone who does know, but is this PTS associated with the
first sample?

> 
>     unsigned sample_rate;       ///< number of sampler per second

Will this ever change from one frame to the next?  If not, maybe it
should go in the link structure.  That would allow eg. auto-insertion of
a resample filter if an audio sink didn't support a given sample rate.

> [...]

-- 
Bobby Bingham
??????????????????????



More information about the ffmpeg-devel mailing list