FFmpeg
Data Structures | Macros | Functions | Variables
vf_tonemap_vaapi.c File Reference
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/mastering_display_metadata.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "vaapi_vpp.h"

Go to the source code of this file.

Data Structures

struct  HDRVAAPIContext
 

Macros

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

Functions

static int tonemap_vaapi_save_metadata (AVFilterContext *avctx, AVFrame *input_frame)
 
static int tonemap_vaapi_set_filter_params (AVFilterContext *avctx, AVFrame *input_frame)
 
static int tonemap_vaapi_build_filter_params (AVFilterContext *avctx)
 
static int tonemap_vaapi_filter_frame (AVFilterLink *inlink, AVFrame *input_frame)
 
static av_cold int tonemap_vaapi_init (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (tonemap_vaapi)
 

Variables

static const AVOption tonemap_vaapi_options []
 
static const AVFilterPad tonemap_vaapi_inputs []
 
static const AVFilterPad tonemap_vaapi_outputs []
 
AVFilter ff_vf_tonemap_vaapi
 

Macro Definition Documentation

◆ STRING_OPTION

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

◆ OFFSET

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

Definition at line 361 of file vf_tonemap_vaapi.c.

◆ FLAGS

Definition at line 362 of file vf_tonemap_vaapi.c.

Function Documentation

◆ tonemap_vaapi_save_metadata()

static int tonemap_vaapi_save_metadata ( AVFilterContext avctx,
AVFrame input_frame 
)
static

Definition at line 50 of file vf_tonemap_vaapi.c.

Referenced by tonemap_vaapi_filter_frame().

◆ tonemap_vaapi_set_filter_params()

static int tonemap_vaapi_set_filter_params ( AVFilterContext avctx,
AVFrame input_frame 
)
static

Definition at line 151 of file vf_tonemap_vaapi.c.

Referenced by tonemap_vaapi_filter_frame().

◆ tonemap_vaapi_build_filter_params()

static int tonemap_vaapi_build_filter_params ( AVFilterContext avctx)
static

Definition at line 179 of file vf_tonemap_vaapi.c.

Referenced by tonemap_vaapi_init().

◆ tonemap_vaapi_filter_frame()

static int tonemap_vaapi_filter_frame ( AVFilterLink inlink,
AVFrame input_frame 
)
static

Definition at line 234 of file vf_tonemap_vaapi.c.

◆ tonemap_vaapi_init()

static av_cold int tonemap_vaapi_init ( AVFilterContext avctx)
static

Definition at line 317 of file vf_tonemap_vaapi.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( tonemap_vaapi  )

Variable Documentation

◆ tonemap_vaapi_options

const AVOption tonemap_vaapi_options[]
static
Initial value:
= {
{ "format", "Output pixel format set", OFFSET(output_format_string), AV_OPT_TYPE_STRING, .flags = FLAGS, "format" },
{ "matrix", "Output color matrix coefficient set",
OFFSET(color_matrix_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "matrix" },
{ "m", "Output color matrix coefficient set",
OFFSET(color_matrix_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "matrix" },
{ "primaries", "Output color primaries set",
OFFSET(color_primaries_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "primaries" },
{ "p", "Output color primaries set",
OFFSET(color_primaries_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "primaries" },
{ "transfer", "Output color transfer characteristics set",
OFFSET(color_transfer_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "transfer" },
{ "t", "Output color transfer characteristics set",
OFFSET(color_transfer_string), AV_OPT_TYPE_STRING,
{ .str = NULL }, .flags = FLAGS, "transfer" },
{ NULL }
}

Definition at line 363 of file vf_tonemap_vaapi.c.

◆ tonemap_vaapi_inputs

const AVFilterPad tonemap_vaapi_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &tonemap_vaapi_filter_frame,
.config_props = &ff_vaapi_vpp_config_input,
},
{ NULL }
}

Definition at line 389 of file vf_tonemap_vaapi.c.

◆ tonemap_vaapi_outputs

const AVFilterPad tonemap_vaapi_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &ff_vaapi_vpp_config_output,
},
{ NULL }
}

Definition at line 399 of file vf_tonemap_vaapi.c.

◆ ff_vf_tonemap_vaapi

AVFilter ff_vf_tonemap_vaapi
Initial value:
= {
.name = "tonemap_vaapi",
.description = NULL_IF_CONFIG_SMALL("VAAPI VPP for tone-mapping"),
.priv_size = sizeof(HDRVAAPIContext),
.priv_class = &tonemap_vaapi_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 408 of file vf_tonemap_vaapi.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
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
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:365
OFFSET
#define OFFSET(x)
Definition: vf_tonemap_vaapi.c:361
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
ctx
AVFormatContext * ctx
Definition: movenc.c:48
FLAGS
#define FLAGS
Definition: vf_tonemap_vaapi.c:362
NULL
#define NULL
Definition: coverity.c:32
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:680
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
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:188
var_name
var_name
Definition: aeval.c:46
tonemap_vaapi_outputs
static const AVFilterPad tonemap_vaapi_outputs[]
Definition: vf_tonemap_vaapi.c:399
tonemap_vaapi_filter_frame
static int tonemap_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_tonemap_vaapi.c:234
ff_vaapi_vpp_config_output
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition: vaapi_vpp.c:95
tonemap_vaapi_init
static av_cold int tonemap_vaapi_init(AVFilterContext *avctx)
Definition: vf_tonemap_vaapi.c:317
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
tonemap_vaapi_inputs
static const AVFilterPad tonemap_vaapi_inputs[]
Definition: vf_tonemap_vaapi.c:389
HDRVAAPIContext
Definition: vf_tonemap_vaapi.c:31