af_aformat.c File Reference

format audio filter More...

#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
Include dependency graph for af_aformat.c:

Go to the source code of this file.

Data Structures

struct  AFormatContext
 

Macros

#define OFFSET(x)   offsetof(AFormatContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc)
 

Typedefs

typedef struct AFormatContext AFormatContext
 

Functions

 AVFILTER_DEFINE_CLASS (aformat)
 
static int get_sample_rate (const char *samplerate)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 

Variables

static const AVOption aformat_options []
 
static const AVFilterPad avfilter_af_aformat_inputs []
 
static const AVFilterPad avfilter_af_aformat_outputs []
 
AVFilter avfilter_af_aformat
 

Detailed Description

format audio filter

Definition in file af_aformat.c.

Macro Definition Documentation

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 49 of file af_aformat.c.

Definition at line 50 of file af_aformat.c.

Referenced by idct().

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

Definition at line 48 of file af_aformat.c.

#define PARSE_FORMATS (   str,
  type,
  list,
  add_to_list,
  get_fmt,
  none,
  desc 
)
Value:
do { \
char *next, *cur = str, sep; \
if (str && strchr(str, ',')) { \
av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "\
"separate %s.\n", desc); \
sep = ','; \
} else \
sep = '|'; \
while (cur) { \
next = strchr(cur, sep); \
if (next) \
*next++ = 0; \
if ((fmt = get_fmt(cur)) == none) { \
av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
return AVERROR(EINVAL); \
} \
add_to_list(&list, fmt); \
\
cur = next; \
} \
} while (0)
const char * fmt
Definition: avisynth_c.h:669
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:154
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Buffer references ownership and permissions
#define type
Synth Windw Norm while(pin< pend)%Until the end...%---Analysis x_w
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 60 of file af_aformat.c.

Referenced by init().

Typedef Documentation

Function Documentation

AVFILTER_DEFINE_CLASS ( aformat  )
static int get_sample_rate ( const char *  samplerate)
static

Definition at line 87 of file af_aformat.c.

Referenced by init().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 93 of file af_aformat.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 108 of file af_aformat.c.

Variable Documentation

const AVOption aformat_options[]
static
Initial value:
= {
{ "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ NULL },
}
#define F
Definition: af_aformat.c:50
#define A
Definition: af_aformat.c:49
#define OFFSET(x)
Definition: af_aformat.c:48
NULL
Definition: eval.c:55

Definition at line 51 of file af_aformat.c.

AVFilter avfilter_af_aformat
Initial value:
= {
.name = "aformat",
.description = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
.init = init,
.query_formats = query_formats,
.priv_size = sizeof(AFormatContext),
.priv_class = &aformat_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static const AVFilterPad avfilter_af_aformat_inputs[]
Definition: af_aformat.c:122
struct AFormatContext AFormatContext
static int query_formats(AVFilterContext *ctx)
Definition: af_aformat.c:108
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int init(AVFilterContext *ctx)
Definition: af_aformat.c:93
static const AVFilterPad avfilter_af_aformat_outputs[]
Definition: af_aformat.c:130
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 138 of file af_aformat.c.

const AVFilterPad avfilter_af_aformat_inputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 122 of file af_aformat.c.

const AVFilterPad avfilter_af_aformat_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 130 of file af_aformat.c.