qmlglsrc: Handle HiDPI scaling

When calculating the capture framebuffer size, include
any device scaling applied to the rendered framebuffer

Fixes only capturing part of the window when there is
a global scale factor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3612>
This commit is contained in:
Jan Schmidt 2022-12-21 02:37:58 +11:00 committed by GStreamer Marge Bot
parent d3c85b4d19
commit e2cd5b1660

View file

@ -330,8 +330,12 @@ QtGLWindow::getGeometry(int * width, int * height)
if (width == NULL || height == NULL) if (width == NULL || height == NULL)
return FALSE; return FALSE;
*width = this->source->width(); double scale = this->source->effectiveDevicePixelRatio();
*height = this->source->height(); *width = this->source->width() * scale;
*height = this->source->height() * scale;
GST_LOG("Window width %d height %d scale %f", *width, *height,
scale);
return TRUE; return TRUE;
} }