You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kwin/kwin-fix-screensharing-for-...

17 lines
867 B

diff --git a/screencast/pipewirestream.cpp b/screencast/pipewirestream.cpp
index 1203d14..846b6a4 100644
--- a/screencast/pipewirestream.cpp
+++ b/screencast/pipewirestream.cpp
@@ -235,7 +235,10 @@ bool PipeWireStream::createStream()
spa_rectangle resolution = SPA_RECTANGLE(uint32_t(m_resolution.width()), uint32_t(m_resolution.height()));
- const auto format = m_hasAlpha ? SPA_VIDEO_FORMAT_BGRA : SPA_VIDEO_FORMAT_BGR;
+ auto canCreateDmaBuf = [this] () -> bool {
+ return QSharedPointer<DmaBufTexture>(kwinApp()->platform()->createDmaBufTexture(m_resolution));
+ };
+ const auto format = m_hasAlpha || canCreateDmaBuf() ? SPA_VIDEO_FORMAT_BGRA : SPA_VIDEO_FORMAT_BGR;
const spa_pod *param = (spa_pod*)spa_pod_builder_add_object(&podBuilder,
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,