FFmpeg
Data Structures | Macros | Functions | Variables
vf_scale_vt.c File Reference
#include <VideoToolbox/VideoToolbox.h>
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_videotoolbox.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "filters.h"
#include "scale_eval.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ScaleVtContext
 

Macros

#define STRING_OPTION(var_name, func_name, default_value)
 
#define OFFSET(x)   offsetof(ScaleVtContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int scale_vt_init (AVFilterContext *avctx)
 
static av_cold void scale_vt_uninit (AVFilterContext *avctx)
 
static int scale_vt_filter_frame (AVFilterLink *link, AVFrame *in)
 
static int scale_vt_config_output (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (scale_vt)
 

Variables

static const AVOption scale_vt_options []
 
static const AVFilterPad scale_vt_inputs []
 
static const AVFilterPad scale_vt_outputs []
 
const AVFilter ff_vf_scale_vt
 

Macro Definition Documentation

◆ STRING_OPTION

#define STRING_OPTION (   var_name,
  func_name,
  default_value 
)
Value:
do { \
if (s->var_name##_string) { \
int var = av_##func_name##_from_name(s->var_name##_string); \
if (var < 0) { \
av_log(avctx, AV_LOG_ERROR, "Invalid %s.\n", #var_name); \
return AVERROR(EINVAL); \
} \
s->var_name = var; \
} else { \
s->var_name = default_value; \
} \
} while (0)

◆ OFFSET

#define OFFSET (   x)    offsetof(ScaleVtContext, x)

Definition at line 228 of file vf_scale_vt.c.

◆ FLAGS

Definition at line 229 of file vf_scale_vt.c.

Function Documentation

◆ scale_vt_init()

static av_cold int scale_vt_init ( AVFilterContext avctx)
static

Definition at line 49 of file vf_scale_vt.c.

◆ scale_vt_uninit()

static av_cold void scale_vt_uninit ( AVFilterContext avctx)
static

Definition at line 115 of file vf_scale_vt.c.

◆ scale_vt_filter_frame()

static int scale_vt_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 126 of file vf_scale_vt.c.

◆ scale_vt_config_output()

static int scale_vt_config_output ( AVFilterLink outlink)
static

Definition at line 175 of file vf_scale_vt.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( scale_vt  )

Variable Documentation

◆ scale_vt_options

const AVOption scale_vt_options[]
static
Initial value:
= {
{ "w", "Output video width",
OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, .flags = FLAGS },
{ "h", "Output video height",
OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, .flags = FLAGS },
{ "color_matrix", "Output colour matrix coefficient set",
OFFSET(colour_matrix_string), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
{ "color_primaries", "Output colour primaries",
OFFSET(colour_primaries_string), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
{ "color_transfer", "Output colour transfer characteristics",
OFFSET(colour_transfer_string), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
{ NULL },
}

Definition at line 230 of file vf_scale_vt.c.

◆ scale_vt_inputs

const AVFilterPad scale_vt_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &scale_vt_filter_frame,
},
}

Definition at line 246 of file vf_scale_vt.c.

◆ scale_vt_outputs

const AVFilterPad scale_vt_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &scale_vt_config_output,
},
}

Definition at line 254 of file vf_scale_vt.c.

◆ ff_vf_scale_vt

const AVFilter ff_vf_scale_vt
Initial value:
= {
.name = "scale_vt",
.description = NULL_IF_CONFIG_SMALL("Scale Videotoolbox frames"),
.priv_size = sizeof(ScaleVtContext),
.priv_class = &scale_vt_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 262 of file vf_scale_vt.c.

AVERROR
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
var_name
var_name
Definition: noise.c:47
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
scale_vt_filter_frame
static int scale_vt_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale_vt.c:126
FLAGS
#define FLAGS
Definition: vf_scale_vt.c:229
scale_vt_init
static av_cold int scale_vt_init(AVFilterContext *avctx)
Definition: vf_scale_vt.c:49
OFFSET
#define OFFSET(x)
Definition: vf_scale_vt.c:228
scale_vt_config_output
static int scale_vt_config_output(AVFilterLink *outlink)
Definition: vf_scale_vt.c:175
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
s
#define s(width, name)
Definition: cbs_vp9.c:198
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: filters.h:206
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:173
scale_vt_uninit
static av_cold void scale_vt_uninit(AVFilterContext *avctx)
Definition: vf_scale_vt.c:115
AV_PIX_FMT_VIDEOTOOLBOX
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition: pixfmt.h:305
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
scale_vt_outputs
static const AVFilterPad scale_vt_outputs[]
Definition: vf_scale_vt.c:254
scale_vt_inputs
static const AVFilterPad scale_vt_inputs[]
Definition: vf_scale_vt.c:246
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_STRING
@ 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:276
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:252
ScaleVtContext
Definition: vf_scale_vt.c:32