Go to the documentation of this file.
70 while ((cur = strchr(cur,
'|'))) {
82 for (
i = 0;
i < nb_formats;
i++) {
83 sep = strchr(cur,
'|');
94 if (!strcmp(
ctx->filter->name,
"noformat")) {
97 int nb_formats_lavu = 0, nb_formats_allowed = 0;
103 formats_allowed =
av_malloc_array(nb_formats_lavu + 1,
sizeof(*formats_allowed));
104 if (!formats_allowed)
112 for (
i = 0;
i < nb_formats;
i++) {
119 formats_allowed[nb_formats_allowed++] =
pix_fmt;
123 s->formats = formats_allowed;
141 #define OFFSET(x) offsetof(FormatContext, x)
147 #if CONFIG_FORMAT_FILTER
149 #define format_options options
152 static const AVFilterPad avfilter_vf_format_inputs[] = {
161 static const AVFilterPad avfilter_vf_format_outputs[] = {
171 .description =
NULL_IF_CONFIG_SMALL(
"Convert the input video to one of the specified pixel formats."),
179 .priv_class = &format_class,
181 .
inputs = avfilter_vf_format_inputs,
182 .
outputs = avfilter_vf_format_outputs,
186 #if CONFIG_NOFORMAT_FILTER
188 #define noformat_options options
191 static const AVFilterPad avfilter_vf_noformat_inputs[] = {
200 static const AVFilterPad avfilter_vf_noformat_outputs[] = {
210 .description =
NULL_IF_CONFIG_SMALL(
"Force libavfilter not to use any of the specified pixel formats for the input to the next filter."),
218 .priv_class = &noformat_class,
220 .
inputs = avfilter_vf_noformat_inputs,
221 .
outputs = avfilter_vf_noformat_outputs,
AVPixelFormat
Pixel format.
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_OPT_FLAG_VIDEO_PARAM
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
const char * name
Filter name.
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
static const AVFilterPad outputs[]
static enum AVPixelFormat pix_fmts[]
static enum AVPixelFormat pix_fmt
Describe the class of an AVClass context structure.
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 NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
#define AVFILTER_DEFINE_CLASS(fname)
#define i(width, name, range_min, range_max)
#define av_malloc_array(a, b)
const char * name
Pad name.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
enum AVPixelFormat * formats
pix_fmts parsed into AVPixelFormats and terminated with AV_PIX_FMT_NONE