Skip to content
Snippets Groups Projects
Commit 7e25936f authored by Hyunjun Ko's avatar Hyunjun Ko Committed by Víctor Manuel Jáquez Leal
Browse files

libs: window: x11: fix src rect info when using vpp

Since we started using VPP in VaapiWindowX11, we need to care about
the case that src rect and window's size are different.

So, once VPP has converted to other format, we should honor the
size of the VPP's surface as source rect. Otherwise, it is cropped
according the previous size of the source rect.

https://bugzilla.gnome.org/show_bug.cgi?id=782542
parent 39636b6e
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@
#include "gstvaapipixmap_priv.h"
#include "gstvaapidisplay_x11.h"
#include "gstvaapidisplay_x11_priv.h"
#include "gstvaapisurface_priv.h"
#include "gstvaapiutils.h"
#include "gstvaapiutils_x11.h"
......@@ -463,9 +464,15 @@ conversion:
gst_vaapi_window_vpp_convert_internal (window, surface, NULL, NULL,
flags);
if (G_LIKELY (vpp_surface)) {
GstVaapiRectangle vpp_src_rect;
surface_id = GST_VAAPI_OBJECT_ID (vpp_surface);
vpp_src_rect.x = vpp_src_rect.y = 0;
vpp_src_rect.width = GST_VAAPI_SURFACE_WIDTH (vpp_surface);
vpp_src_rect.height = GST_VAAPI_SURFACE_HEIGHT (vpp_surface);
status =
gst_vaapi_window_x11_put_surface (window, surface_id, src_rect,
gst_vaapi_window_x11_put_surface (window, surface_id, &vpp_src_rect,
dst_rect, flags);
ret = vaapi_check_status (status, "vaPutSurface()");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment