From 7e2561fa8313982aa21f7657953eedeeb33b210d Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Mon, 31 Oct 2016 22:14:10 +0000 Subject: lavfi: Use ff_get_video_buffer in all filters using hwframes --- libavfilter/vf_scale_vaapi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libavfilter/vf_scale_vaapi.c') diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c index 704456dd39..67648a9aa0 100644 --- a/libavfilter/vf_scale_vaapi.c +++ b/libavfilter/vf_scale_vaapi.c @@ -31,6 +31,7 @@ #include "avfilter.h" #include "formats.h" #include "internal.h" +#include "video.h" typedef struct ScaleVAAPIContext { const AVClass *class; @@ -274,19 +275,13 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) av_log(ctx, AV_LOG_DEBUG, "Using surface %#x for scale input.\n", input_surface); - output_frame = av_frame_alloc(); + output_frame = ff_get_video_buffer(outlink, ctx->output_width, + ctx->output_height); if (!output_frame) { - av_log(ctx, AV_LOG_ERROR, "Failed to allocate output frame."); err = AVERROR(ENOMEM); goto fail; } - err = av_hwframe_get_buffer(ctx->output_frames_ref, output_frame, 0); - if (err < 0) { - av_log(ctx, AV_LOG_ERROR, "Failed to get surface for " - "output: %d\n.", err); - } - output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; av_log(ctx, AV_LOG_DEBUG, "Using surface %#x for scale output.\n", output_surface); -- cgit v1.2.3