tests: simple-decoder: add support for video cropping.

Handle video cropping information attached to a VA surface proxy.
This commit is contained in:
Gwenole Beauchesne 2013-07-22 09:12:21 +02:00
parent 155af03491
commit 2e85860c9c

View file

@ -435,6 +435,7 @@ renderer_process(App *app, RenderFrame *rfp)
{ {
GError *error = NULL; GError *error = NULL;
GstVaapiSurface *surface; GstVaapiSurface *surface;
const GstVaapiRectangle *crop_rect;
#define SEND_ERROR(...) \ #define SEND_ERROR(...) \
do { \ do { \
@ -454,7 +455,8 @@ renderer_process(App *app, RenderFrame *rfp)
if (G_LIKELY(!g_benchmark)) if (G_LIKELY(!g_benchmark))
renderer_wait_until(app, rfp->pts); 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)) GST_VAAPI_PICTURE_STRUCTURE_FRAME))
SEND_ERROR("failed to render surface %" GST_VAAPI_ID_FORMAT, SEND_ERROR("failed to render surface %" GST_VAAPI_ID_FORMAT,
GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface))); GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface)));