Go to the documentation of this file.
46 #define OFFSET(x) offsetof(ChannelSplitContext, x)
47 #define A AV_OPT_FLAG_AUDIO_PARAM
48 #define F AV_OPT_FLAG_FILTERING_PARAM
50 {
"channel_layout",
"Input channel layout.",
OFFSET(channel_layout_str),
AV_OPT_TYPE_STRING, { .str =
"stereo" }, .flags =
A|
F },
60 uint64_t channel_layout;
62 int all = 0,
ret = 0,
i;
66 s->channel_layout_str);
72 if (!strcmp(
s->channels_str,
"all")) {
74 channel_layout =
s->channel_layout;
122 for (
i = 0;
i <
ctx->nb_outputs;
i++) {
140 for (
i = 0;
i <
ctx->nb_outputs;
i++) {
170 .
name =
"channelsplit",
173 .priv_class = &channelsplit_class,
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)
char * channel_layout_str
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVFILTER_DEFINE_CLASS(channelsplit)
int channels
number of audio channels, only used for audio.
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
static const AVFilterPad avfilter_af_channelsplit_inputs[]
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
uint64_t channel_layout
Channel layout of the audio data.
static av_cold int init(AVFilterContext *ctx)
#define i(width, name, range_min, range_max)
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
Get the channel with the given index in channel_layout.
static const AVOption channelsplit_options[]
uint8_t ** extended_data
pointers to the data planes/channels.
int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel)
Get the index of a channel in channel_layout.
const char * name
Pad name.
enum AVMediaType type
AVFilterPad type.
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
int av_get_extended_channel_layout(const char *name, uint64_t *channel_layout, int *nb_channels)
Return a channel layout and the number of channels based on the specified name.
int ff_append_outpad(AVFilterContext *f, AVFilterPad *p)
const AVFilter ff_af_channelsplit
static int query_formats(AVFilterContext *ctx)