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
This commit is contained in:
parent
b3c374e22f
commit
f09f21def7
@ -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()");
|
||||
|
Loading…
x
Reference in New Issue
Block a user