FFmpeg
Data Structures | Macros | Functions | Variables
vf_libplacebo.c File Reference
#include "libavutil/file.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "vulkan_filter.h"
#include "scale_eval.h"
#include <libplacebo/renderer.h>
#include <libplacebo/utils/libav.h>
#include <libplacebo/vulkan.h>

Go to the source code of this file.

Data Structures

struct  LibplaceboContext
 

Macros

#define OFFSET(x)   offsetof(LibplaceboContext, x)
 
#define STATIC   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 
#define DYNAMIC   (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)
 

Functions

static enum pl_log_level get_log_level (void)
 
static void pl_av_log (void *log_ctx, enum pl_log_level level, const char *msg)
 
static int parse_shader (AVFilterContext *avctx, const void *shader, size_t len)
 
static int find_scaler (AVFilterContext *avctx, const struct pl_filter_config **opt, const char *name)
 
static int libplacebo_init (AVFilterContext *avctx)
 
static int init_vulkan (AVFilterContext *avctx)
 
static void libplacebo_uninit (AVFilterContext *avctx)
 
static int process_frames (AVFilterContext *avctx, AVFrame *out, AVFrame *in)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static int libplacebo_config_output (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (libplacebo)
 

Variables

static const AVOption libplacebo_options []
 
static const AVFilterPad libplacebo_inputs []
 
static const AVFilterPad libplacebo_outputs []
 
AVFilter ff_vf_libplacebo
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 514 of file vf_libplacebo.c.

◆ STATIC

Definition at line 515 of file vf_libplacebo.c.

◆ DYNAMIC

#define DYNAMIC   (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)

Definition at line 516 of file vf_libplacebo.c.

Function Documentation

◆ get_log_level()

static enum pl_log_level get_log_level ( void  )
inlinestatic

Definition at line 120 of file vf_libplacebo.c.

Referenced by filter_frame(), and libplacebo_init().

◆ pl_av_log()

static void pl_av_log ( void *  log_ctx,
enum pl_log_level  level,
const char *  msg 
)
static

Definition at line 132 of file vf_libplacebo.c.

Referenced by libplacebo_init().

◆ parse_shader()

static int parse_shader ( AVFilterContext avctx,
const void *  shader,
size_t  len 
)
static

Definition at line 149 of file vf_libplacebo.c.

Referenced by init_vulkan().

◆ find_scaler()

static int find_scaler ( AVFilterContext avctx,
const struct pl_filter_config **  opt,
const char *  name 
)
static

Definition at line 164 of file vf_libplacebo.c.

Referenced by process_frames().

◆ libplacebo_init()

static int libplacebo_init ( AVFilterContext avctx)
static

Definition at line 187 of file vf_libplacebo.c.

◆ init_vulkan()

static int init_vulkan ( AVFilterContext avctx)
static

Definition at line 205 of file vf_libplacebo.c.

Referenced by filter_frame().

◆ libplacebo_uninit()

static void libplacebo_uninit ( AVFilterContext avctx)
static

Definition at line 265 of file vf_libplacebo.c.

◆ process_frames()

static int process_frames ( AVFilterContext avctx,
AVFrame out,
AVFrame in 
)
static

Definition at line 279 of file vf_libplacebo.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 391 of file vf_libplacebo.c.

◆ libplacebo_config_output()

static int libplacebo_config_output ( AVFilterLink outlink)
static

Definition at line 458 of file vf_libplacebo.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( libplacebo  )

Variable Documentation

◆ libplacebo_options

const AVOption libplacebo_options[]
static

Definition at line 518 of file vf_libplacebo.c.

◆ libplacebo_inputs

const AVFilterPad libplacebo_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &filter_frame,
.config_props = &ff_vk_filter_config_input,
},
}

Definition at line 666 of file vf_libplacebo.c.

◆ libplacebo_outputs

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

Definition at line 675 of file vf_libplacebo.c.

◆ ff_vf_libplacebo

AVFilter ff_vf_libplacebo
Initial value:
= {
.name = "libplacebo",
.description = NULL_IF_CONFIG_SMALL("Apply various GPU filters from libplacebo"),
.priv_size = sizeof(LibplaceboContext),
.priv_class = &libplacebo_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 683 of file vf_libplacebo.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:371
LibplaceboContext
Definition: vf_libplacebo.c:29
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:346
init
static int init
Definition: av_tx.c:47
libplacebo_config_output
static int libplacebo_config_output(AVFilterLink *outlink)
Definition: vf_libplacebo.c:458
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_libplacebo.c:391
libplacebo_inputs
static const AVFilterPad libplacebo_inputs[]
Definition: vf_libplacebo.c:666
libplacebo_uninit
static void libplacebo_uninit(AVFilterContext *avctx)
Definition: vf_libplacebo.c:265
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
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
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:306
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:882
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:181
libplacebo_outputs
static const AVFilterPad libplacebo_outputs[]
Definition: vf_libplacebo.c:675
ff_vk_filter_config_input
int ff_vk_filter_config_input(AVFilterLink *inlink)
Definition: vulkan_filter.c:52
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:282
libplacebo_init
static int libplacebo_init(AVFilterContext *avctx)
Definition: vf_libplacebo.c:187