FFmpeg
Data Structures | Macros | Functions | Variables
af_asetrate.c File Reference
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ASetRateContext
 

Macros

#define CONTEXT   ASetRateContext
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define OPT_GENERIC(name, field, def, min, max, descr, type, deffield, ...)
 
#define OPT_INT(name, field, def, min, max, descr, ...)   OPT_GENERIC(name, field, def, min, max, descr, INT, i64, __VA_ARGS__)
 

Functions

 AVFILTER_DEFINE_CLASS (asetrate)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static av_cold int config_props (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 

Variables

static const AVOption asetrate_options []
 
static const AVFilterPad asetrate_inputs []
 
static const AVFilterPad asetrate_outputs []
 
const AVFilter ff_af_asetrate
 

Macro Definition Documentation

◆ CONTEXT

#define CONTEXT   ASetRateContext

Definition at line 32 of file af_asetrate.c.

◆ FLAGS

Definition at line 33 of file af_asetrate.c.

◆ OPT_GENERIC

#define OPT_GENERIC (   name,
  field,
  def,
  min,
  max,
  descr,
  type,
  deffield,
  ... 
)
Value:
{ name, descr, offsetof(CONTEXT, field), AV_OPT_TYPE_ ## type, \
{ .deffield = def }, min, max, FLAGS, __VA_ARGS__ }

Definition at line 35 of file af_asetrate.c.

◆ OPT_INT

#define OPT_INT (   name,
  field,
  def,
  min,
  max,
  descr,
  ... 
)    OPT_GENERIC(name, field, def, min, max, descr, INT, i64, __VA_ARGS__)

Definition at line 39 of file af_asetrate.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( asetrate  )

◆ query_formats()

static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 50 of file af_asetrate.c.

◆ config_props()

static av_cold int config_props ( AVFilterLink outlink)
static

Definition at line 69 of file af_asetrate.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 89 of file af_asetrate.c.

Variable Documentation

◆ asetrate_options

const AVOption asetrate_options[]
static
Initial value:
= {
OPT_INT("sample_rate", sample_rate, 44100, 1, INT_MAX, "set the sample rate",),
OPT_INT("r", sample_rate, 44100, 1, INT_MAX, "set the sample rate",),
{NULL},
}

Definition at line 42 of file af_asetrate.c.

◆ asetrate_inputs

const AVFilterPad asetrate_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}

Definition at line 102 of file af_asetrate.c.

◆ asetrate_outputs

const AVFilterPad asetrate_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
},
}

Definition at line 110 of file af_asetrate.c.

◆ ff_af_asetrate

const AVFilter ff_af_asetrate
Initial value:
= {
.name = "asetrate",
.description = NULL_IF_CONFIG_SMALL("Change the sample rate without "
"altering the data."),
.priv_size = sizeof(ASetRateContext),
.priv_class = &asetrate_class,
}

Definition at line 118 of file af_asetrate.c.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
FLAGS
#define FLAGS
Definition: af_asetrate.c:33
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_asetrate.c:89
config_props
static av_cold int config_props(AVFilterLink *outlink)
Definition: af_asetrate.c:69
asetrate_outputs
static const AVFilterPad asetrate_outputs[]
Definition: af_asetrate.c:110
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:169
max
#define max(a, b)
Definition: cuda_runtime.h:33
sample_rate
sample_rate
Definition: ffmpeg_filter.c:368
query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: af_asetrate.c:50
ASetRateContext
Definition: af_asetrate.c:26
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
asetrate_inputs
static const AVFilterPad asetrate_inputs[]
Definition: af_asetrate.c:102
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
field
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
Definition: writing_filters.txt:78
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
NULL
#define NULL
Definition: coverity.c:32
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
CONTEXT
#define CONTEXT
Definition: af_asetrate.c:32
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:133
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
OPT_INT
#define OPT_INT(name, field, def, min, max, descr,...)
Definition: af_asetrate.c:39
min
float min
Definition: vorbis_enc_data.h:429