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 "internal.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 224 of file vf_scale_vt.c.

◆ FLAGS

Definition at line 225 of file vf_scale_vt.c.

Function Documentation

◆ scale_vt_init()

static av_cold int scale_vt_init ( AVFilterContext avctx)
static

Definition at line 48 of file vf_scale_vt.c.

◆ scale_vt_uninit()

static av_cold void scale_vt_uninit ( AVFilterContext avctx)
static

Definition at line 114 of file vf_scale_vt.c.

◆ scale_vt_filter_frame()

static int scale_vt_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 125 of file vf_scale_vt.c.

◆ scale_vt_config_output()

static int scale_vt_config_output ( AVFilterLink outlink)
static

Definition at line 174 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 226 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 242 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 250 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 258 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:46
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: internal.h:351
scale_vt_filter_frame
static int scale_vt_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale_vt.c:125
FLAGS
#define FLAGS
Definition: vf_scale_vt.c:225
scale_vt_init
static av_cold int scale_vt_init(AVFilterContext *avctx)
Definition: vf_scale_vt.c:48
OFFSET
#define OFFSET(x)
Definition: vf_scale_vt.c:224
scale_vt_config_output
static int scale_vt_config_output(AVFilterLink *outlink)
Definition: vf_scale_vt.c:174
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
s
#define s(width, name)
Definition: cbs_vp9.c:198
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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:106
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:138
scale_vt_uninit
static av_cold void scale_vt_uninit(AVFilterContext *avctx)
Definition: vf_scale_vt.c:114
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
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:250
scale_vt_inputs
static const AVFilterPad scale_vt_inputs[]
Definition: vf_scale_vt.c:242
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239
ScaleVtContext
Definition: vf_scale_vt.c:31