|
|
|
@ -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); |
|
|
|
|