64 while ((cur = strchr(cur,
'|'))) {
76 for (i = 0; i < nb_formats; i++) {
77 sep = strchr(cur,
'|');
94 int nb_formats_lavu = 0, nb_formats_allowed = 0;;
100 formats_allowed =
av_malloc_array(nb_formats_lavu + 1,
sizeof(*formats_allowed));
101 if (!formats_allowed)
109 for (i = 0; i < nb_formats; i++) {
116 formats_allowed[nb_formats_allowed++] =
pix_fmt;
139 #define OFFSET(x) offsetof(FormatContext, x)
145 #if CONFIG_FORMAT_FILTER
146 static const AVClass format_class = {
153 static const AVFilterPad avfilter_vf_format_inputs[] = {
162 static const AVFilterPad avfilter_vf_format_outputs[] = {
172 .description =
NULL_IF_CONFIG_SMALL(
"Convert the input video to one of the specified pixel formats."),
180 .priv_class = &format_class,
182 .
inputs = avfilter_vf_format_inputs,
183 .
outputs = avfilter_vf_format_outputs,
187 #if CONFIG_NOFORMAT_FILTER
188 static const AVClass noformat_class = {
195 static const AVFilterPad avfilter_vf_noformat_inputs[] = {
204 static const AVFilterPad avfilter_vf_noformat_outputs[] = {
214 .description =
NULL_IF_CONFIG_SMALL(
"Force libavfilter not to use any of the specified pixel formats for the input to the next filter."),
222 .priv_class = &noformat_class,
224 .
inputs = avfilter_vf_noformat_inputs,
225 .
outputs = avfilter_vf_noformat_outputs,
static const AVFilterPad outputs[]
Main libavfilter public API header.
memory handling functions
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
static enum AVSampleFormat formats[]
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * name
Pad name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#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
void av_log(void *avcl, int level, const char *fmt,...)
common internal API header
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
enum AVPixelFormat * formats
pix_fmts parsed into AVPixelFormats and terminated with AV_PIX_FMT_NONE
enum AVPixelFormat pix_fmt
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define AV_OPT_FLAG_VIDEO_PARAM
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
Filter name.
static void * av_malloc_array(size_t nmemb, size_t size)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
AVPixelFormat
Pixel format.
const AVFilter * filter
the AVFilter of which this is an instance
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.