FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
asrc_anoisesrc.c File Reference
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"

Go to the source code of this file.

Data Structures

struct  ANoiseSrcContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (anoisesrc)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static double white_filter (double white, double *buf)
 
static double pink_filter (double white, double *buf)
 
static double brown_filter (double white, double *buf)
 
static av_cold int config_props (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption anoisesrc_options []
 
static const AVFilterPad anoisesrc_outputs []
 
AVFilter ff_asrc_anoisesrc
 

Macro Definition Documentation

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

Definition at line 44 of file asrc_anoisesrc.c.

Definition at line 45 of file asrc_anoisesrc.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( anoisesrc  )
static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 69 of file asrc_anoisesrc.c.

static double white_filter ( double  white,
double *  buf 
)
static

Definition at line 103 of file asrc_anoisesrc.c.

Referenced by config_props().

static double pink_filter ( double  white,
double *  buf 
)
static

Definition at line 108 of file asrc_anoisesrc.c.

Referenced by config_props().

static double brown_filter ( double  white,
double *  buf 
)
static

Definition at line 124 of file asrc_anoisesrc.c.

Referenced by config_props().

static av_cold int config_props ( AVFilterLink outlink)
static

Definition at line 133 of file asrc_anoisesrc.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 155 of file asrc_anoisesrc.c.

Variable Documentation

const AVOption anoisesrc_options[]
static
Initial value:
= {
{ "sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 15, INT_MAX, FLAGS },
{ "r", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 15, INT_MAX, FLAGS },
{ "amplitude", "set amplitude", OFFSET(amplitude), AV_OPT_TYPE_DOUBLE, {.dbl = 1.}, 0., 1., FLAGS },
{ "a", "set amplitude", OFFSET(amplitude), AV_OPT_TYPE_DOUBLE, {.dbl = 1.}, 0., 1., FLAGS },
{ "duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS },
{ "d", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS },
{ "color", "set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 2, FLAGS, "color" },
{ "colour", "set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 2, FLAGS, "color" },
{ "c", "set noise color", OFFSET(color), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, FLAGS, "color" },
{ "white", 0, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, FLAGS, "color" },
{ "pink", 0, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, FLAGS, "color" },
{ "brown", 0, 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, FLAGS, "color" },
{ "seed", "set random seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT_MAX, FLAGS },
{ "s", "set random seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT_MAX, FLAGS },
{ "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, INT_MAX, FLAGS },
{ "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, INT_MAX, FLAGS },
{NULL}
}
#define NULL
Definition: coverity.c:32
int64_t duration
Definition: movenc.c:63
#define OFFSET(x)
#define FLAGS
sample_rate
static unsigned int seed
Definition: videogen.c:78

Definition at line 47 of file asrc_anoisesrc.c.

const AVFilterPad anoisesrc_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
static av_cold int config_props(AVFilterLink *outlink)

Definition at line 189 of file asrc_anoisesrc.c.

AVFilter ff_asrc_anoisesrc
Initial value:
= {
.name = "anoisesrc",
.description = NULL_IF_CONFIG_SMALL("Generate a noise audio signal."),
.query_formats = query_formats,
.priv_size = sizeof(ANoiseSrcContext),
.priv_class = &anoisesrc_class,
}
#define NULL
Definition: coverity.c:32
static av_cold int query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad anoisesrc_outputs[]

Definition at line 199 of file asrc_anoisesrc.c.