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);
210 case UNIT_BPM: freq =
s->bpm / 60;
break;
211 case UNIT_MS: freq = 1 / (
s->ms / 1000.);
break;
212 case UNIT_HZ: freq =
s->hertz;
break;
218 s->lfoL.mode =
s->mode;
219 s->lfoR.mode =
s->mode;
220 s->lfoL.offset =
s->offset_l;
221 s->lfoR.offset =
s->offset_r;
222 s->lfoL.srate =
inlink->sample_rate;
223 s->lfoR.srate =
inlink->sample_rate;
224 s->lfoL.amount =
s->amount;
225 s->lfoR.amount =
s->amount;
226 s->lfoL.pwidth =
s->pwidth;
227 s->lfoR.pwidth =
s->pwidth;
245 .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
#define AV_CHANNEL_LAYOUT_STEREO
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)
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.
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.
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
#define FILTER_OUTPUTS(array)
static const AVFilterPad inputs[]
@ AV_SAMPLE_FMT_DBL
double