26#include "config_components.h"
74 for (
int j = 0; j < (*fmts)->nb_formats; j++) {
75 if (allfmts->
formats[
i] == (*fmts)->formats[j]) {
91#define DEFINE_PARSE(name, Type, get, descr, extra_test) \
92static int parse_##name(enum Type *ret, const char *arg, void *log_ctx) \
97 val = strtol(arg, &tail, 0); \
98 if (*tail || extra_test) { \
99 av_log(log_ctx, AV_LOG_ERROR, "Invalid " descr " '%s'\n", arg); \
100 return AVERROR(EINVAL); \
121 #define PARSE_LIST(strfield, fmtfield, tvar, parse) \
122 for (char *sep, *cur = s->strfield; cur; cur = sep) { \
123 sep = strchr(cur, '|'); \
126 if ((ret = parse(&tvar, cur, ctx)) < 0 || \
127 (ret = ff_add_format(&s->fmtfield, tvar)) < 0) \
132 PARSE_LIST(csps, color_spaces, csp, parse_color_space)
133 PARSE_LIST(ranges, color_ranges, crg, parse_color_range)
134 PARSE_LIST(alphamodes, alpha_modes, alm, parse_alpha_mode)
136 if (!strcmp(
ctx->filter->name,
"noformat")) {
146 s->color_spaces && (ret =
ff_formats_ref(
s->color_spaces, &
s->color_spaces)) < 0 ||
147 s->color_ranges && (ret =
ff_formats_ref(
s->color_ranges, &
s->color_ranges)) < 0 ||
171#define OFFSET(x) offsetof(FormatContext, x)
190#if CONFIG_FORMAT_FILTER
193 .p.description =
NULL_IF_CONFIG_SMALL(
"Convert the input video to one of the specified pixel formats."),
194 .p.priv_class = &format_class,
210#if CONFIG_NOFORMAT_FILTER
212 .p.name =
"noformat",
213 .p.description =
NULL_IF_CONFIG_SMALL(
"Force libavfilter not to use any of the specified pixel formats for the input to the next filter."),
214 .p.priv_class = &format_class,
static double val(void *priv, double ch)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad inputs[]
static const char *const format[]
const FFFilter ff_vf_noformat
const FFFilter ff_vf_format
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
static int parse_pixel_format(AVCodecContext *avctx)
static enum AVPixelFormat pix_fmt
int(* init)(AVBSFContext *ctx)
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
#define AV_OPT_FLAG_VIDEO_PARAM
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options)
#define FILTER_QUERY_FUNC2(func)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
Memory handling functions.
int av_color_space_from_name(const char *name)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
int av_color_range_from_name(const char *name)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
enum AVAlphaMode av_alpha_mode_from_name(const char *name)
AVColorRange
Visual content value range.
AVAlphaMode
Correlation between the alpha channel and color values.
AVPixelFormat
Pixel format.
AVColorSpace
YUV colorspace type.
Describe the class of an AVClass context structure.
A filter pad used for either input or output.
AVFilterFormats * alpha_modes
parsed from alphamodes
AVFilterFormats * color_ranges
parsed from ranges
AVFilterFormats * color_spaces
parsed from csps
AVFilterFormats * formats
parsed from pix_fmts
static AVFormatContext * ctx
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.