FFmpeg
Data Structures | Macros | Functions | Variables
vf_transpose_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 "transpose.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  TransposeVtContext
 

Macros

#define OFFSET(x)   offsetof(TransposeVtContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int transpose_vt_init (AVFilterContext *avctx)
 
static av_cold void transpose_vt_uninit (AVFilterContext *avctx)
 
static int transpose_vt_filter_frame (AVFilterLink *link, AVFrame *in)
 
static int transpose_vt_recreate_hw_ctx (AVFilterLink *outlink)
 
static int transpose_vt_config_output (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (transpose_vt)
 

Variables

static const AVOption transpose_vt_options []
 
static const AVFilterPad transpose_vt_inputs []
 
static const AVFilterPad transpose_vt_outputs []
 
const AVFilter ff_vf_transpose_vt
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 229 of file vf_transpose_vt.c.

◆ FLAGS

Definition at line 230 of file vf_transpose_vt.c.

Function Documentation

◆ transpose_vt_init()

static av_cold int transpose_vt_init ( AVFilterContext avctx)
static

Definition at line 40 of file vf_transpose_vt.c.

◆ transpose_vt_uninit()

static av_cold void transpose_vt_uninit ( AVFilterContext avctx)
static

Definition at line 54 of file vf_transpose_vt.c.

◆ transpose_vt_filter_frame()

static int transpose_vt_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 65 of file vf_transpose_vt.c.

◆ transpose_vt_recreate_hw_ctx()

static int transpose_vt_recreate_hw_ctx ( AVFilterLink outlink)
static

Definition at line 107 of file vf_transpose_vt.c.

Referenced by transpose_vt_config_output().

◆ transpose_vt_config_output()

static int transpose_vt_config_output ( AVFilterLink outlink)
static

Definition at line 143 of file vf_transpose_vt.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( transpose_vt  )

Variable Documentation

◆ transpose_vt_options

const AVOption transpose_vt_options[]
static
Initial value:
= {
{ "dir", "set transpose direction",
OFFSET(dir), AV_OPT_TYPE_INT, { .i64 = TRANSPOSE_CCLOCK_FLIP }, 0, 6, FLAGS, .unit = "dir" },
{ "cclock_flip", "rotate counter-clockwise with vertical flip",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK_FLIP }, .flags=FLAGS, .unit = "dir" },
{ "clock", "rotate clockwise",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK }, .flags=FLAGS, .unit = "dir" },
{ "cclock", "rotate counter-clockwise",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK }, .flags=FLAGS, .unit = "dir" },
{ "clock_flip", "rotate clockwise with vertical flip",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK_FLIP }, .flags=FLAGS, .unit = "dir" },
{ "reversal", "rotate by half-turn",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_REVERSAL }, .flags=FLAGS, .unit = "dir" },
{ "hflip", "flip horizontally",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_HFLIP }, .flags=FLAGS, .unit = "dir" },
{ "vflip", "flip vertically",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_VFLIP }, .flags=FLAGS, .unit = "dir" },
{ "passthrough", "do not apply transposition if the input matches the specified geometry",
OFFSET(passthrough), AV_OPT_TYPE_INT, { .i64=TRANSPOSE_PT_TYPE_NONE }, 0, INT_MAX, FLAGS, .unit = "passthrough" },
{ "none", "always apply transposition",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_PT_TYPE_NONE }, INT_MIN, INT_MAX, FLAGS, .unit = "passthrough" },
{ "portrait", "preserve portrait geometry",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_PT_TYPE_PORTRAIT }, INT_MIN, INT_MAX, FLAGS, .unit = "passthrough" },
{ "landscape", "preserve landscape geometry",
0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_PT_TYPE_LANDSCAPE }, INT_MIN, INT_MAX, FLAGS, .unit = "passthrough" },
{ NULL }
}

Definition at line 231 of file vf_transpose_vt.c.

◆ transpose_vt_inputs

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

Definition at line 263 of file vf_transpose_vt.c.

◆ transpose_vt_outputs

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

Definition at line 271 of file vf_transpose_vt.c.

◆ ff_vf_transpose_vt

const AVFilter ff_vf_transpose_vt
Initial value:
= {
.name = "transpose_vt",
.description = NULL_IF_CONFIG_SMALL("Transpose Videotoolbox frames"),
.priv_size = sizeof(TransposeVtContext),
.priv_class = &transpose_vt_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 279 of file vf_transpose_vt.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
transpose_vt_config_output
static int transpose_vt_config_output(AVFilterLink *outlink)
Definition: vf_transpose_vt.c:143
transpose_vt_init
static av_cold int transpose_vt_init(AVFilterContext *avctx)
Definition: vf_transpose_vt.c:40
TRANSPOSE_CLOCK_FLIP
@ TRANSPOSE_CLOCK_FLIP
Definition: transpose.h:34
TRANSPOSE_CCLOCK
@ TRANSPOSE_CCLOCK
Definition: transpose.h:33
FLAGS
#define FLAGS
Definition: vf_transpose_vt.c:230
TRANSPOSE_HFLIP
@ TRANSPOSE_HFLIP
Definition: transpose.h:36
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
OFFSET
#define OFFSET(x)
Definition: vf_transpose_vt.c:229
TransposeVtContext
Definition: vf_transpose_vt.c:32
NULL
#define NULL
Definition: coverity.c:32
transpose_vt_uninit
static av_cold void transpose_vt_uninit(AVFilterContext *avctx)
Definition: vf_transpose_vt.c:54
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
TRANSPOSE_PT_TYPE_PORTRAIT
@ TRANSPOSE_PT_TYPE_PORTRAIT
Definition: transpose.h:27
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
TRANSPOSE_PT_TYPE_NONE
@ TRANSPOSE_PT_TYPE_NONE
Definition: transpose.h:25
transpose_vt_filter_frame
static int transpose_vt_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_transpose_vt.c:65
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
TRANSPOSE_CLOCK
@ TRANSPOSE_CLOCK
Definition: transpose.h:32
TRANSPOSE_CCLOCK_FLIP
@ TRANSPOSE_CCLOCK_FLIP
Definition: transpose.h:31
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
TRANSPOSE_REVERSAL
@ TRANSPOSE_REVERSAL
Definition: transpose.h:35
TRANSPOSE_PT_TYPE_LANDSCAPE
@ TRANSPOSE_PT_TYPE_LANDSCAPE
Definition: transpose.h:26
TRANSPOSE_VFLIP
@ TRANSPOSE_VFLIP
Definition: transpose.h:37
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
transpose_vt_inputs
static const AVFilterPad transpose_vt_inputs[]
Definition: vf_transpose_vt.c:263
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:252
transpose_vt_outputs
static const AVFilterPad transpose_vt_outputs[]
Definition: vf_transpose_vt.c:271