74 VASurfaceID input_surface, output_surface;
75 VAProcPipelineParameterBuffer
params;
76 VARectangle input_region;
86 input_surface = (VASurfaceID)(uintptr_t)input_frame->
data[3];
97 output_surface = (VASurfaceID)(uintptr_t)output_frame->
data[3];
101 memset(¶ms, 0,
sizeof(params));
103 input_region = (VARectangle) {
106 .width = input_frame->
width -
112 params.surface = input_surface;
113 params.surface_region = &input_region;
114 params.surface_color_standard =
117 params.output_region = 0;
118 params.output_background_color = 0xff000000;
119 params.output_color_standard = params.surface_color_standard;
121 params.pipeline_flags = 0;
122 params.filter_flags = VA_FILTER_SCALING_HQ;
168 #define OFFSET(x) offsetof(ScaleVAAPIContext, x) 169 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM) 171 {
"w",
"Output video width",
173 {
"h",
"Output video height",
175 {
"format",
"Output video format (software format of hardware frames)",
202 .
name =
"scale_vaapi",
208 .
inputs = scale_vaapi_inputs,
209 .
outputs = scale_vaapi_outputs,
210 .priv_class = &scale_vaapi_class,
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
int ff_scale_eval_dimensions(void *log_ctx, const char *w_expr, const char *h_expr, AVFilterLink *inlink, AVFilterLink *outlink, int *ret_w, int *ret_h)
This structure describes decoded (raw) audio or video data.
char * output_format_string
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Main libavfilter public API header.
Memory handling functions.
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
static av_cold int init(AVCodecContext *avctx)
int h
agreed upon image height
AVFILTER_DEFINE_CLASS(scale_vaapi)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_cold int uninit(AVCodecContext *avctx)
AVFilter ff_vf_scale_vaapi
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, VASurfaceID output_surface)
static const AVOption scale_vaapi_options[]
A filter pad used for either input or output.
A link between two filters.
static av_cold int scale_vaapi_init(AVFilterContext *avctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int scale_vaapi_config_output(AVFilterLink *outlink)
void * priv
private data for use by the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVColorSpace colorspace
YUV colorspace type.
simple assert() macros that are a bit more flexible than ISO C assert().
static const AVFilterPad scale_vaapi_inputs[]
int w
agreed upon image width
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
AVFilterContext * src
source filter
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Rational number (pair of numerator and denominator).
static const AVFilterPad scale_vaapi_outputs[]
const char * name
Filter name.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterLink ** outputs
array of pointers to output links
enum AVPixelFormat output_format
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
const char const char * params
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
static int query_formats(AVFilterContext *ctx)
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs)
AVFilterContext * dst
dest filter
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
void(* pipeline_uninit)(AVFilterContext *avctx)
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.