Go to the documentation of this file.
59 #define OFFSET(x) offsetof(AudioPulsatorContext, x)
60 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
108 val = (phs - 0.75) * 4 - 1;
115 val = phs < 0.5 ? -1 : +1;
134 const double *
src = (
const double *)in->
data[0];
136 const double level_out =
s->level_out;
137 const double level_in =
s->level_in;
138 const double amount =
s->amount;
153 dst = (
double *)
out->data[0];
155 for (n = 0; n < nb_samples; n++) {
158 double inL =
src[0] * level_in;
159 double inR =
src[1] * level_in;
166 outL = procL + inL * (1 - amount);
167 outR = procR + inR * (1 - amount);
198 { .nb_channels = 0 },
221 case UNIT_BPM: freq =
s->bpm / 60;
break;
222 case UNIT_MS: freq = 1 / (
s->ms / 1000.);
break;
223 case UNIT_HZ: freq =
s->hertz;
break;
229 s->lfoL.mode =
s->mode;
230 s->lfoR.mode =
s->mode;
231 s->lfoL.offset =
s->offset_l;
232 s->lfoR.offset =
s->offset_r;
233 s->lfoL.srate =
inlink->sample_rate;
234 s->lfoR.srate =
inlink->sample_rate;
235 s->lfoL.amount =
s->amount;
236 s->lfoR.amount =
s->amount;
237 s->lfoL.pwidth =
s->pwidth;
238 s->lfoR.pwidth =
s->pwidth;
256 .priv_class = &apulsator_class,
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame 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. Frame references ownership and permissions
#define AV_CHANNEL_LAYOUT_STEREO
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
enum MovChannelLayoutTag * layouts
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void lfo_advance(SimpleLFO *lfo, unsigned count)
static const AVOption apulsator_options[]
static double val(void *priv, double ch)
A filter pad used for either input or output.
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define FILTER_OUTPUTS(array)
Describe the class of an AVClass context structure.
static __device__ float fabs(float a)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
AVFILTER_DEFINE_CLASS(apulsator)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
int nb_samples
number of audio samples (per channel) described by this frame
AVSampleFormat
Audio sample formats.
static double lfo_get_value(SimpleLFO *lfo)
#define FILTER_QUERY_FUNC2(func)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const char * name
Pad name.
static int config_input(AVFilterLink *inlink)
const AVFilter ff_af_apulsator
@ AV_OPT_TYPE_INT
Underlying C type is int.
static const AVFilterPad inputs[]
@ AV_SAMPLE_FMT_DBL
double
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.