Commit cea27813 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

screencating: query for dmabuf availability before we start streaming

As things are right now, we can only do 32bit textures for dmabuf (see
gbm_bo_format in gbm.h). This means that we were lying to our receivers
when we had 24bit textures by then giving a 32bit texture instead.

This changes it so we request a dummy texture before starting and if we
are offered one we assume they're available and offer a 32bits stream
directly (i.e. BGRA).
parent e298caaa
......@@ -236,7 +236,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,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment