libavfilter/asrc_abuffer.c File Reference

memory buffer source for audio More...

#include "libavutil/audioconvert.h"
#include "libavutil/avstring.h"
#include "libavutil/fifo.h"
#include "asrc_abuffer.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ABufferSourceContext

Defines

#define FIFO_SIZE   8
#define ADD_FORMAT(fmt_name)

Functions

static void buf_free (AVFilterBuffer *ptr)
static void set_link_source (AVFilterContext *src, AVFilterLink *link)
static int reconfigure_filter (ABufferSourceContext *abuffer, AVFilterContext *filt_ctx)
static int insert_filter (ABufferSourceContext *abuffer, AVFilterLink *link, AVFilterContext **filt_ctx, const char *filt_name)
static void remove_filter (AVFilterContext **filt_ctx)
static void log_input_change (void *ctx, AVFilterLink *link, AVFilterBufferRef *ref)
int av_asrc_buffer_add_audio_buffer_ref (AVFilterContext *ctx, AVFilterBufferRef *samplesref, int av_unused flags)
 Queue an audio buffer to the audio buffer source.
int av_asrc_buffer_add_samples (AVFilterContext *ctx, uint8_t *data[8], int linesize[8], int nb_samples, int sample_rate, int sample_fmt, int64_t channel_layout, int planar, int64_t pts, int av_unused flags)
 Queue an audio buffer to the audio buffer source.
int av_asrc_buffer_add_buffer (AVFilterContext *ctx, uint8_t *buf, int buf_size, int sample_rate, int sample_fmt, int64_t channel_layout, int planar, int64_t pts, int av_unused flags)
 Queue an audio buffer to the audio buffer source.
static av_cold int init (AVFilterContext *ctx, const char *args0, void *opaque)
static av_cold void uninit (AVFilterContext *ctx)
static int query_formats (AVFilterContext *ctx)
static int config_output (AVFilterLink *outlink)
static int request_frame (AVFilterLink *outlink)
static int poll_frame (AVFilterLink *outlink)

Variables

AVFilter avfilter_asrc_abuffer


Detailed Description

memory buffer source for audio

Definition in file asrc_abuffer.c.


Define Documentation

#define ADD_FORMAT ( fmt_name   ) 

Value:

if (!arg)                                                           \
        goto arg_fail;                                                  \
    if ((ret = ff_parse_##fmt_name(&abuffer->fmt_name, arg, ctx)) < 0) { \
        av_freep(&args);                                                \
        return ret;                                                     \
    }                                                                   \
    if (*args)                                                          \
        arg = av_strtok(NULL, ":", &ptr)

Referenced by init().

#define FIFO_SIZE   8

Definition at line 48 of file asrc_abuffer.c.

Referenced by init().


Function Documentation

int av_asrc_buffer_add_audio_buffer_ref ( AVFilterContext abuffersrc,
AVFilterBufferRef samplesref,
int av_unused  flags 
)

Queue an audio buffer to the audio buffer source.

Parameters:
abuffersrc audio source buffer context
samplesref buffer ref to queue
flags unused

Definition at line 136 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_samples().

int av_asrc_buffer_add_buffer ( AVFilterContext abuffersrc,
uint8_t *  buf,
int  buf_size,
int  sample_rate,
int  sample_fmt,
int64_t  ch_layout,
int  planar,
int64_t  pts,
int av_unused  flags 
)

Queue an audio buffer to the audio buffer source.

This is similar to av_asrc_buffer_add_samples(), but the samples are stored in a buffer with known size.

Parameters:
abuffersrc audio source buffer context
buf pointer to the samples data, packed is assumed
size the size in bytes of the buffer, it must contain an integer number of samples
sample_fmt sample format of the audio data
ch_layout channel layout of the audio data
pts presentation timestamp of the audio buffer
flags unused

Definition at line 232 of file asrc_abuffer.c.

int av_asrc_buffer_add_samples ( AVFilterContext abuffersrc,
uint8_t *  data[8],
int  linesize[8],
int  nb_samples,
int  sample_rate,
int  sample_fmt,
int64_t  ch_layout,
int  planar,
int64_t  pts,
int av_unused  flags 
)

Queue an audio buffer to the audio buffer source.

Parameters:
abuffersrc audio source buffer context
data pointers to the samples planes
linesize linesizes of each audio buffer plane
nb_samples number of samples per channel
sample_fmt sample format of the audio data
ch_layout channel layout of the audio data
planar flag to indicate if audio data is planar or packed
pts presentation timestamp of the audio buffer
flags unused

Definition at line 210 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_buffer().

static void buf_free ( AVFilterBuffer ptr  )  [static]

Definition at line 50 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_samples().

static int config_output ( AVFilterLink outlink  )  [static]

Definition at line 325 of file asrc_abuffer.c.

static av_cold int init ( AVFilterContext ctx,
const char *  args0,
void *  opaque 
) [static]

Definition at line 253 of file asrc_abuffer.c.

static int insert_filter ( ABufferSourceContext abuffer,
AVFilterLink link,
AVFilterContext **  filt_ctx,
const char *  filt_name 
) [static]

Definition at line 83 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_audio_buffer_ref().

static void log_input_change ( void *  ctx,
AVFilterLink link,
AVFilterBufferRef ref 
) [inline, static]

Definition at line 120 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_audio_buffer_ref().

static int poll_frame ( AVFilterLink outlink  )  [static]

Definition at line 350 of file asrc_abuffer.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 305 of file asrc_abuffer.c.

static int reconfigure_filter ( ABufferSourceContext abuffer,
AVFilterContext filt_ctx 
) [static]

Definition at line 63 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_audio_buffer_ref(), and insert_filter().

static void remove_filter ( AVFilterContext **  filt_ctx  )  [static]

Definition at line 108 of file asrc_abuffer.c.

Referenced by av_asrc_buffer_add_audio_buffer_ref().

static int request_frame ( AVFilterLink outlink  )  [static]

Definition at line 332 of file asrc_abuffer.c.

static void set_link_source ( AVFilterContext src,
AVFilterLink link 
) [static]

Definition at line 56 of file asrc_abuffer.c.

Referenced by insert_filter(), and remove_filter().

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 299 of file asrc_abuffer.c.


Variable Documentation

Initial value:

 {
    .name        = "abuffer",
    .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."),
    .priv_size   = sizeof(ABufferSourceContext),
    .query_formats = query_formats,

    .init        = init,
    .uninit      = uninit,

    .inputs      = (const AVFilterPad[]) {{ .name = NULL }},
    .outputs     = (const AVFilterPad[]) {{ .name      = "default",
                                      .type            = AVMEDIA_TYPE_AUDIO,
                                      .request_frame   = request_frame,
                                      .poll_frame      = poll_frame,
                                      .config_props    = config_output, },
                                    { .name = NULL}},
}

Definition at line 356 of file asrc_abuffer.c.


Generated on Fri Oct 26 02:46:11 2012 for FFmpeg by  doxygen 1.5.8