Go to the documentation of this file.
58 #define OFFSET(x) offsetof(AudioPulsatorContext, x)
59 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
107 val = (phs - 0.75) * 4 - 1;
114 val = phs < 0.5 ? -1 : +1;
133 const double *
src = (
const double *)in->
data[0];
135 const double level_out =
s->level_out;
136 const double level_in =
s->level_in;
137 const double amount =
s->amount;
152 dst = (
double *)
out->data[0];
154 for (n = 0; n < nb_samples; n++) {
157 double inL =
src[0] * level_in;
158 double inR =
src[1] * level_in;
165 outL = procL + inL * (1 - amount);
166 outR = procR + inR * (1 - amount);
209 case UNIT_BPM: freq =
s->bpm / 60;
break;
210 case UNIT_MS: freq = 1 / (
s->ms / 1000.);
break;
211 case UNIT_HZ: freq =
s->hertz;
break;
217 s->lfoL.mode =
s->mode;
218 s->lfoR.mode =
s->mode;
219 s->lfoL.offset =
s->offset_l;
220 s->lfoR.offset =
s->offset_r;
221 s->lfoL.srate =
inlink->sample_rate;
222 s->lfoR.srate =
inlink->sample_rate;
223 s->lfoL.amount =
s->amount;
224 s->lfoR.amount =
s->amount;
225 s->lfoL.pwidth =
s->pwidth;
226 s->lfoR.pwidth =
s->pwidth;
251 .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.
A list of supported channel layouts.
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
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
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.
This structure describes decoded (raw) audio or video data.
#define FILTER_QUERY_FUNC(func)
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)
#define AV_CH_LAYOUT_STEREO
A filter pad used for either input or output.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int query_formats(AVFilterContext *ctx)
#define FILTER_INPUTS(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.
AVFILTER_DEFINE_CLASS(apulsator)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
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 layout
int nb_samples
number of audio samples (per channel) described by this frame
static double lfo_get_value(SimpleLFO *lfo)
const char * name
Pad name.
static int config_input(AVFilterLink *inlink)
const AVFilter ff_af_apulsator
static const AVFilterPad outputs[]
#define FILTER_OUTPUTS(array)
static const AVFilterPad inputs[]
@ AV_SAMPLE_FMT_DBL
double