af_asetnsamples.c File Reference

Filter that changes number of samples on single output operation. More...

#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"
#include "formats.h"
Include dependency graph for af_asetnsamples.c:

Go to the source code of this file.

Data Structures

struct  ASNSContext
 

Macros

#define OFFSET(x)   offsetof(ASNSContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (asetnsamples)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props_output (AVFilterLink *outlink)
 
static int push_samples (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *insamples)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption asetnsamples_options []
 
static const AVFilterPad asetnsamples_inputs []
 
static const AVFilterPad asetnsamples_outputs []
 
AVFilter avfilter_af_asetnsamples
 

Detailed Description

Filter that changes number of samples on single output operation.

Definition in file af_asetnsamples.c.

Macro Definition Documentation

Definition at line 45 of file af_asetnsamples.c.

#define OFFSET (   x)    offsetof(ASNSContext, x)

Definition at line 44 of file af_asetnsamples.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( asetnsamples  )
static int config_props_output ( AVFilterLink outlink)
static

Definition at line 73 of file af_asetnsamples.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 128 of file af_asetnsamples.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 57 of file af_asetnsamples.c.

static int push_samples ( AVFilterLink outlink)
static

Definition at line 86 of file af_asetnsamples.c.

Referenced by filter_frame(), and request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 155 of file af_asetnsamples.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 67 of file af_asetnsamples.c.

Variable Documentation

const AVFilterPad asetnsamples_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.needs_writable = 1,
},
{ NULL }
}
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
NULL
Definition: eval.c:55

Definition at line 169 of file af_asetnsamples.c.

const AVOption asetnsamples_options[]
static
Initial value:
= {
{ "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "n", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
{ "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
{ NULL }
}
#define OFFSET(x)
#define FLAGS
NULL
Definition: eval.c:55

Definition at line 47 of file af_asetnsamples.c.

const AVFilterPad asetnsamples_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_props_output,
},
{ NULL }
}
static int config_props_output(AVFilterLink *outlink)
static int request_frame(AVFilterLink *outlink)
NULL
Definition: eval.c:55

Definition at line 179 of file af_asetnsamples.c.

AVFilter avfilter_af_asetnsamples
Initial value:
= {
.name = "asetnsamples",
.description = NULL_IF_CONFIG_SMALL("Set the number of samples for each output audio frames."),
.priv_size = sizeof(ASNSContext),
.init = init,
.priv_class = &asetnsamples_class,
}
static av_cold int init(AVFilterContext *ctx)
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad asetnsamples_outputs[]
static const AVFilterPad asetnsamples_inputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs

Definition at line 189 of file af_asetnsamples.c.