Go to the documentation of this file.
49 #define OFFSET(x) offsetof(Bs2bContext, x)
50 #define A AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
53 {
"profile",
"Apply a pre-defined crossfeed level",
55 {
"default",
"default profile", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0,
A, .unit =
"profile" },
56 {
"cmoy",
"Chu Moy circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_CMOY_CLEVEL }, 0, 0,
A, .unit =
"profile" },
57 {
"jmeier",
"Jan Meier circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_JMEIER_CLEVEL }, 0, 0,
A, .unit =
"profile" },
58 {
"fcut",
"Set cut frequency (in Hz)",
60 {
"feed",
"Set feed level (in Hz)",
71 if (!(bs2b->
bs2bp = bs2b_open()))
77 bs2b_set_level_fcut(bs2b->
bs2bp, bs2b->
fcut);
80 bs2b_set_level_feed(bs2b->
bs2bp, bs2b->
feed);
90 bs2b_close(bs2b->
bs2bp);
150 if (
frame != out_frame)
162 int srate =
inlink->sample_rate;
184 if ((srate < BS2B_MINSRATE) || (srate > BS2B_MAXSRATE))
187 bs2b_set_srate(bs2b->
bs2bp, srate);
212 .priv_class = &bs2b_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.
static enum AVSampleFormat sample_fmts[]
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.
static void feed(AVFilterContext *ctx, int ch, const float *in_samples, float *out_samples, float *in_frame, float *out_dist_frame, float *windowed_frame, float *drc_frame, float *spectrum_buf, float *energy, float *target_gain, float *envelope, float *factors)
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const char * name
Filter name.
A link between two filters.
A filter pad used for either input or output.
static const AVFilterPad bs2b_outputs[]
#define FILTER_OUTPUTS(array)
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
static av_cold int init(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
AVFILTER_DEFINE_CLASS(bs2b)
#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.
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
void(* filter_func)(t_bs2bdp bs2bdp, uint8_t *sample, int n)
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
AVFilterContext * src
source filter
int nb_samples
number of audio samples (per channel) described by this frame
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
uint8_t ** extended_data
pointers to the data planes/channels.
AVSampleFormat
Audio sample formats.
#define FILTER_QUERY_FUNC2(func)
@ AV_SAMPLE_FMT_S16
signed 16 bits
static const AVOption bs2b_options[]
const char * name
Pad name.
const AVFilter ff_af_bs2b
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 For filters that do not use the this method is called when a frame is wanted on an output For a 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 or at least make progress towards producing a frame
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
@ AV_SAMPLE_FMT_DBL
double
@ AV_SAMPLE_FMT_S32
signed 32 bits
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad bs2b_inputs[]