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

Go to the source code of this file.

Data Structures

struct  ScaleVAAPIContext
 

Macros

#define D(name)   case VA_FILTER_SCALING_ ## name: return #name
 
#define STRING_OPTION(var_name, func_name, default_value)
 
#define OFFSET(x)   offsetof(ScaleVAAPIContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static const char * scale_vaapi_mode_name (int mode)
 
static int scale_vaapi_config_output (AVFilterLink *outlink)
 
static int scale_vaapi_filter_frame (AVFilterLink *inlink, AVFrame *input_frame)
 
static av_cold int scale_vaapi_init (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (scale_vaapi)
 

Variables

static const AVOption scale_vaapi_options []
 
static const AVFilterPad scale_vaapi_inputs []
 
static const AVFilterPad scale_vaapi_outputs []
 
AVFilter ff_vf_scale_vaapi
 

Macro Definition Documentation

#define D (   name)    case VA_FILTER_SCALING_ ## name: return #name

Referenced by scale_vaapi_mode_name().

#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)
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
var_name
Definition: aeval.c:46
AVFormatContext * ctx
Definition: movenc.c:48
if(ret)
int
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
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

Referenced by scale_vaapi_init().

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

Definition at line 201 of file vf_scale_vaapi.c.

Definition at line 202 of file vf_scale_vaapi.c.

Function Documentation

static const char* scale_vaapi_mode_name ( int  mode)
static

Definition at line 55 of file vf_scale_vaapi.c.

Referenced by scale_vaapi_filter_frame().

static int scale_vaapi_config_output ( AVFilterLink outlink)
static

Definition at line 70 of file vf_scale_vaapi.c.

static int scale_vaapi_filter_frame ( AVFilterLink inlink,
AVFrame input_frame 
)
static

Definition at line 96 of file vf_scale_vaapi.c.

static av_cold int scale_vaapi_init ( AVFilterContext avctx)
static

Definition at line 161 of file vf_scale_vaapi.c.

AVFILTER_DEFINE_CLASS ( scale_vaapi  )

Variable Documentation

const AVOption scale_vaapi_options[]
static

Definition at line 203 of file vf_scale_vaapi.c.

const AVFilterPad scale_vaapi_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &scale_vaapi_filter_frame,
.config_props = &ff_vaapi_vpp_config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)

Definition at line 256 of file vf_scale_vaapi.c.

const AVFilterPad scale_vaapi_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &scale_vaapi_config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int scale_vaapi_config_output(AVFilterLink *outlink)

Definition at line 266 of file vf_scale_vaapi.c.

AVFilter ff_vf_scale_vaapi
Initial value:
= {
.name = "scale_vaapi",
.description = NULL_IF_CONFIG_SMALL("Scale to/from VAAPI surfaces."),
.priv_size = sizeof(ScaleVAAPIContext),
.priv_class = &scale_vaapi_class,
.flags_internal = 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:385
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
static av_cold int scale_vaapi_init(AVFilterContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad scale_vaapi_inputs[]
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static const AVFilterPad scale_vaapi_outputs[]
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:680

Definition at line 275 of file vf_scale_vaapi.c.