From 2e85860c9c63829ee2af1544dfd1f27648a32d64 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 22 Jul 2013 09:12:21 +0200 Subject: [PATCH] tests: simple-decoder: add support for video cropping. Handle video cropping information attached to a VA surface proxy. --- tests/simple-decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/simple-decoder.c b/tests/simple-decoder.c index 3cf46cc..307bb18 100644 --- a/tests/simple-decoder.c +++ b/tests/simple-decoder.c @@ -435,6 +435,7 @@ renderer_process(App *app, RenderFrame *rfp) { GError *error = NULL; GstVaapiSurface *surface; + const GstVaapiRectangle *crop_rect; #define SEND_ERROR(...) \ do { \ @@ -454,7 +455,8 @@ renderer_process(App *app, RenderFrame *rfp) if (G_LIKELY(!g_benchmark)) renderer_wait_until(app, rfp->pts); - if (!gst_vaapi_window_put_surface(app->window, surface, NULL, NULL, + crop_rect = gst_vaapi_surface_proxy_get_crop_rect(rfp->proxy); + if (!gst_vaapi_window_put_surface(app->window, surface, crop_rect, NULL, GST_VAAPI_PICTURE_STRUCTURE_FRAME)) SEND_ERROR("failed to render surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface))); -- 2.7.4