FFmpeg
Data Structures | Macros | Functions | Variables
vf_transpose_opencl.c File Reference
#include <float.h>
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "opencl.h"
#include "opencl_source.h"
#include "video.h"
#include "transpose.h"

Go to the source code of this file.

Data Structures

struct  TransposeOpenCLContext
 

Macros

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

Functions

static int transpose_opencl_init (AVFilterContext *avctx)
 
static int transpose_opencl_config_output (AVFilterLink *outlink)
 
static AVFrameget_video_buffer (AVFilterLink *inlink, int w, int h)
 
static int transpose_opencl_filter_frame (AVFilterLink *inlink, AVFrame *input)
 
static av_cold void transpose_opencl_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (transpose_opencl)
 

Variables

static const AVOption transpose_opencl_options []
 
static const AVFilterPad transpose_opencl_inputs []
 
static const AVFilterPad transpose_opencl_outputs []
 
const AVFilter ff_vf_transpose_opencl
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 235 of file vf_transpose_opencl.c.

◆ FLAGS

Definition at line 236 of file vf_transpose_opencl.c.

Function Documentation

◆ transpose_opencl_init()

static int transpose_opencl_init ( AVFilterContext avctx)
static

Definition at line 41 of file vf_transpose_opencl.c.

Referenced by transpose_opencl_filter_frame().

◆ transpose_opencl_config_output()

static int transpose_opencl_config_output ( AVFilterLink outlink)
static

Definition at line 72 of file vf_transpose_opencl.c.

◆ get_video_buffer()

static AVFrame* get_video_buffer ( AVFilterLink inlink,
int  w,
int  h 
)
static

Definition at line 124 of file vf_transpose_opencl.c.

◆ transpose_opencl_filter_frame()

static int transpose_opencl_filter_frame ( AVFilterLink inlink,
AVFrame input 
)
static

Definition at line 133 of file vf_transpose_opencl.c.

◆ transpose_opencl_uninit()

static av_cold void transpose_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 213 of file vf_transpose_opencl.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( transpose_opencl  )

Variable Documentation

◆ transpose_opencl_options

const AVOption transpose_opencl_options[]
static
Initial value:
= {
{ "dir", "set transpose direction", OFFSET(dir), AV_OPT_TYPE_INT, { .i64 = TRANSPOSE_CCLOCK_FLIP }, 0, 3, FLAGS, "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" },
{ "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, "passthrough" },
{ "none", "always apply transposition", 0, AV_OPT_TYPE_CONST, {.i64=TRANSPOSE_PT_TYPE_NONE}, INT_MIN, INT_MAX, FLAGS, "passthrough" },
{ "portrait", "preserve portrait geometry", 0, AV_OPT_TYPE_CONST, {.i64=TRANSPOSE_PT_TYPE_PORTRAIT}, INT_MIN, INT_MAX, FLAGS, "passthrough" },
{ "landscape", "preserve landscape geometry", 0, AV_OPT_TYPE_CONST, {.i64=TRANSPOSE_PT_TYPE_LANDSCAPE}, INT_MIN, INT_MAX, FLAGS, "passthrough" },
{ NULL }
}

Definition at line 237 of file vf_transpose_opencl.c.

◆ transpose_opencl_inputs

const AVFilterPad transpose_opencl_inputs[]
static
Initial value:
= {
{
.name = "default",
.get_buffer.video = get_video_buffer,
},
}

Definition at line 255 of file vf_transpose_opencl.c.

◆ transpose_opencl_outputs

const AVFilterPad transpose_opencl_outputs[]
static
Initial value:
= {
{
.name = "default",
},
}

Definition at line 265 of file vf_transpose_opencl.c.

◆ ff_vf_transpose_opencl

const AVFilter ff_vf_transpose_opencl
Initial value:
= {
.name = "transpose_opencl",
.description = NULL_IF_CONFIG_SMALL("Transpose input video"),
.priv_size = sizeof(TransposeOpenCLContext),
.priv_class = &transpose_opencl_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 273 of file vf_transpose_opencl.c.

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:370
transpose_opencl_outputs
static const AVFilterPad transpose_opencl_outputs[]
Definition: vf_transpose_opencl.c:265
FLAGS
#define FLAGS
Definition: vf_transpose_opencl.c:236
TRANSPOSE_CLOCK_FLIP
@ TRANSPOSE_CLOCK_FLIP
Definition: transpose.h:34
init
static int init
Definition: av_tx.c:47
transpose_opencl_config_output
static int transpose_opencl_config_output(AVFilterLink *outlink)
Definition: vf_transpose_opencl.c:72
TRANSPOSE_CCLOCK
@ TRANSPOSE_CCLOCK
Definition: transpose.h:33
get_video_buffer
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
Definition: vf_transpose_opencl.c:124
TransposeOpenCLContext
Definition: vf_transpose_opencl.c:32
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:327
TRANSPOSE_PT_TYPE_PORTRAIT
@ TRANSPOSE_PT_TYPE_PORTRAIT
Definition: transpose.h:27
transpose_opencl_inputs
static const AVFilterPad transpose_opencl_inputs[]
Definition: vf_transpose_opencl.c:255
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:117
TRANSPOSE_PT_TYPE_NONE
@ TRANSPOSE_PT_TYPE_NONE
Definition: transpose.h:25
ff_opencl_filter_config_input
int ff_opencl_filter_config_input(AVFilterLink *inlink)
Check that the input link contains a suitable hardware frames context and extract the device from it.
Definition: opencl.c:45
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:180
transpose_opencl_filter_frame
static int transpose_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
Definition: vf_transpose_opencl.c:133
TRANSPOSE_CLOCK
@ TRANSPOSE_CLOCK
Definition: transpose.h:32
ff_opencl_filter_init
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Definition: opencl.c:132
TRANSPOSE_CCLOCK_FLIP
@ TRANSPOSE_CCLOCK_FLIP
Definition: transpose.h:31
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
TRANSPOSE_PT_TYPE_LANDSCAPE
@ TRANSPOSE_PT_TYPE_LANDSCAPE
Definition: transpose.h:26
OFFSET
#define OFFSET(x)
Definition: vf_transpose_opencl.c:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
transpose_opencl_uninit
static av_cold void transpose_opencl_uninit(AVFilterContext *avctx)
Definition: vf_transpose_opencl.c:213
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234