FFmpeg
Loading...
Searching...
No Matches
vf_format.c File Reference

format and noformat video filters More...

#include "config_components.h"
#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FormatContext
 

Macros

#define DEFINE_PARSE(name, Type, get, descr, extra_test)
 
#define PARSE_LIST(strfield, fmtfield, tvar, parse)
 
#define OFFSET(x)
 

Functions

static av_cold void uninit (AVFilterContext *ctx)
 
static av_cold int invert_formats (AVFilterFormats **fmts, AVFilterFormats *allfmts)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
 AVFILTER_DEFINE_CLASS_EXT (format, "(no)format", options)
 

Variables

static const AVOption options []
 
static const AVFilterPad inputs []
 

Detailed Description

format and noformat video filters

Definition in file vf_format.c.

Macro Definition Documentation

◆ DEFINE_PARSE

#define DEFINE_PARSE ( name,
Type,
get,
descr,
extra_test )
Value:
static int parse_##name(enum Type *ret, const char *arg, void *log_ctx) \
{ \
char *tail; \
int val = get(arg); \
if (val < 0) { \
val = strtol(arg, &tail, 0); \
if (*tail || extra_test) { \
av_log(log_ctx, AV_LOG_ERROR, "Invalid " descr " '%s'\n", arg); \
return AVERROR(EINVAL); \
} \
} \
*ret = val; \
return 0; \
}
static double val(void *priv, double ch)
Definition aeval.c:77
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
const char * arg
Definition jacosubdec.c:65
Type
Definition vf_idet.c:30
static void get(const uint8_t *pixels, int stride, int16_t *block)
const char * name
Definition qsvenc.c:142

Definition at line 91 of file vf_format.c.

◆ PARSE_LIST

#define PARSE_LIST ( strfield,
fmtfield,
tvar,
parse )
Value:
for (char *sep, *cur = s->strfield; cur; cur = sep) { \
sep = strchr(cur, '|'); \
if (sep && *sep) \
*sep++ = 0; \
if ((ret = parse(&tvar, cur, ctx)) < 0 || \
(ret = ff_add_format(&s->fmtfield, tvar)) < 0) \
return ret; \
}
static AVFormatContext * ctx
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition apv_parser.c:92
#define s(width, name)
Definition cbs_vp9.c:198
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition formats.c:571

Referenced by init().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 171 of file vf_format.c.

Function Documentation

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 53 of file vf_format.c.

◆ invert_formats()

static av_cold int invert_formats ( AVFilterFormats ** fmts,
AVFilterFormats * allfmts )
static

Definition at line 62 of file vf_format.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 112 of file vf_format.c.

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 154 of file vf_format.c.

◆ AVFILTER_DEFINE_CLASS_EXT()

AVFILTER_DEFINE_CLASS_EXT ( format ,
"(no)format" ,
options  )

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "pix_fmts", "A '|'-separated list of pixel formats", OFFSET(pix_fmts), AV_OPT_TYPE_STRING, .flags = AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ "color_spaces", "A '|'-separated list of color spaces", OFFSET(csps), AV_OPT_TYPE_STRING, .flags = AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ "color_ranges", "A '|'-separated list of color ranges", OFFSET(ranges), AV_OPT_TYPE_STRING, .flags = AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ "alpha_modes", "A '|'-separated list of alpha modes", OFFSET(alphamodes), AV_OPT_TYPE_STRING, .flags = AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ NULL }
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
Definition opt.h:380
#define AV_OPT_FLAG_VIDEO_PARAM
Definition opt.h:357
@ 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...
Definition opt.h:275
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296

Definition at line 172 of file vf_format.c.

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.get_buffer.video = ff_null_get_video_buffer,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
Definition video.c:44

Definition at line 182 of file vf_format.c.