diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-10-31 22:14:10 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2016-11-02 20:07:15 +0000 |
commit | 7e2561fa8313982aa21f7657953eedeeb33b210d (patch) | |
tree | 1158e9d8c5a42bf5a6616dabb084117c92566c51 /libavfilter/vf_scale_vaapi.c | |
parent | 7433feb82f75827884d909de34d341a1c4401d4a (diff) | |
download | ffmpeg-7e2561fa8313982aa21f7657953eedeeb33b210d.tar.gz |
lavfi: Use ff_get_video_buffer in all filters using hwframes
Diffstat (limited to 'libavfilter/vf_scale_vaapi.c')
-rw-r--r-- | libavfilter/vf_scale_vaapi.c | 11 |
1 files changed, 3 insertions, 8 deletions
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); |