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,
"profile" },
56 {
"cmoy",
"Chu Moy circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_CMOY_CLEVEL }, 0, 0,
A,
"profile" },
57 {
"jmeier",
"Jan Meier circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_JMEIER_CLEVEL }, 0, 0,
A,
"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);
154 if (
frame != out_frame)
166 int srate =
inlink->sample_rate;
188 if ((srate < BS2B_MINSRATE) || (srate > BS2B_MAXSRATE))
191 bs2b_set_srate(bs2b->
bs2bp, srate);
219 .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.
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.
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.
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
A link between two filters.
static int query_formats(AVFilterContext *ctx)
#define AV_CH_LAYOUT_STEREO
A filter pad used for either input or output.
static const AVFilterPad bs2b_outputs[]
static const AVFilterPad outputs[]
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.
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
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.
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
uint8_t ** extended_data
pointers to the data planes/channels.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S16
signed 16 bits
static const AVOption bs2b_options[]
const char * name
Pad name.
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
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
@ AV_SAMPLE_FMT_DBL
double
@ AV_SAMPLE_FMT_S32
signed 32 bits
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad bs2b_inputs[]