summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-20 16:44:53 +0100
committerClément Bœsch <u@pkh.me>2017-03-20 16:44:53 +0100
commitbc1023eb36c6320f349237034c8f46c201a1a57f (patch)
tree9e58c1b0343fe456047bd123434177be4296097c /libavfilter
parent9a0f91314adca49f259eb7e36ccf4e5cea31f62c (diff)
parentbdf7610eb266fd3de650040c97328791868abd82 (diff)
Merge commit 'bdf7610eb266fd3de650040c97328791868abd82'
* commit 'bdf7610eb266fd3de650040c97328791868abd82': vf_scale_vaapi: Crop input surface to active region Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_scale_vaapi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 5e6298a263..8221849ee0 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -273,6 +273,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
VASurfaceID input_surface, output_surface;
VAProcPipelineParameterBuffer params;
VABufferID params_id;
+ VARectangle input_region;
VAStatus vas;
int err;
@@ -306,8 +307,17 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
memset(&params, 0, sizeof(params));
+ // If there were top/left cropping, it could be taken into
+ // account here.
+ input_region = (VARectangle) {
+ .x = 0,
+ .y = 0,
+ .width = input_frame->width,
+ .height = input_frame->height,
+ };
+
params.surface = input_surface;
- params.surface_region = 0;
+ params.surface_region = &input_region;
params.surface_color_standard =
vaapi_proc_colour_standard(input_frame->colorspace);