FFmpeg
Data Structures | Macros | Functions | Variables
af_asetrate.c File Reference
#include "libavutil/opt.h"
#include "avfilter.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 []
 
AVFilter ff_af_asetrate
 

Macro Definition Documentation

◆ CONTEXT

#define CONTEXT   ASetRateContext

Definition at line 31 of file af_asetrate.c.

◆ FLAGS

Definition at line 32 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 34 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 38 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 49 of file af_asetrate.c.

◆ config_props()

static av_cold int config_props ( AVFilterLink outlink)
static

Definition at line 58 of file af_asetrate.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 78 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 41 of file af_asetrate.c.

◆ asetrate_inputs

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

Definition at line 91 of file af_asetrate.c.

◆ asetrate_outputs

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

Definition at line 100 of file af_asetrate.c.

◆ ff_af_asetrate

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

Definition at line 109 of file af_asetrate.c.

FLAGS
#define FLAGS
Definition: af_asetrate.c:32
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_asetrate.c:78
config_props
static av_cold int config_props(AVFilterLink *outlink)
Definition: af_asetrate.c:58
asetrate_outputs
static const AVFilterPad asetrate_outputs[]
Definition: af_asetrate.c:100
name
const char * name
Definition: avisynth_c.h:867
max
#define max(a, b)
Definition: cuda_runtime.h:33
sample_rate
sample_rate
Definition: ffmpeg_filter.c:191
query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: af_asetrate.c:49
ASetRateContext
Definition: af_asetrate.c:25
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:91
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
NULL
#define NULL
Definition: coverity.c:32
inputs
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: filter_design.txt:243
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:188
CONTEXT
#define CONTEXT
Definition: af_asetrate.c:31
OPT_INT
#define OPT_INT(name, field, def, min, max, descr,...)
Definition: af_asetrate.c:38
min
float min
Definition: vorbis_enc_data.h:456