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)
188 if ((srate < BS2B_MINSRATE) || (srate > BS2B_MAXSRATE))
191 bs2b_set_srate(bs2b->
bs2bp, srate);
219 .priv_class = &bs2b_class,
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
static const AVFilterPad bs2b_inputs[]
void(* filter_func)(t_bs2bdp bs2bdp, uint8_t *sample, int n)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define AV_CH_LAYOUT_STEREO
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int query_formats(AVFilterContext *ctx)
A filter pad used for either input or output.
A link between two filters.
int sample_rate
samples per second
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
audio channel layout utility functions
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
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
AVFilterContext * src
source filter
static const AVFilterPad outputs[]
int format
agreed upon media format
static int config_output(AVFilterLink *outlink)
A list of supported channel layouts.
AVSampleFormat
Audio sample formats.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
AVFILTER_DEFINE_CLASS(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 inputs
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Describe the class of an AVClass context structure.
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
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
static const AVOption bs2b_options[]
common internal and external API header
static const AVFilterPad bs2b_outputs[]
AVFilterContext * dst
dest filter
static av_cold void uninit(AVFilterContext *ctx)
static enum AVSampleFormat sample_fmts[]
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
uint8_t ** extended_data
pointers to the data planes/channels.
static av_cold int init(AVFilterContext *ctx)
int nb_samples
number of audio samples (per channel) described by this frame
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.