From 4bfc4ac4b0651a24769d46467aeb304faaa94148 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 22 Mar 2023 18:23:34 +0100 Subject: [PATCH] PipeWire capturer: drop old DmaBuf support Drop support for old compositors that don't use DmaBufs the way they are supposed to be used now. There is now a whole negotiation process that includes DmaBuf modifiers and there is also support for renegotiation in case we fail to import DmaBufs with certain modifier. This is something that didn't exist before and in such case, failing to import DmaBufs we would just end up with broken screen sharing. For that reason it would be better to use MemFD instead to make sure old compositors will work just fine Bug: webrtc:15029 Change-Id: Icc303504e510adc829c12feff7178ae01578a6da Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298700 Reviewed-by: Alexander Cooper Commit-Queue: Jan Grulich Cr-Commit-Position: refs/heads/main@{#39649} --- .../linux/wayland/shared_screencast_stream.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index 37de3a54ca..21863b7d8d 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -39,7 +39,6 @@ constexpr int CursorMetaSize(int w, int h) { w * h * kCursorBpp); } -constexpr PipeWireVersion kDmaBufMinVersion = {0, 3, 24}; constexpr PipeWireVersion kDmaBufModifierMinVersion = {0, 3, 33}; constexpr PipeWireVersion kDropSingleModifierMinVersion = {0, 3, 40}; @@ -295,10 +294,9 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( that->modifier_ = has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; std::vector params; - const int buffer_types = - has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) - ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) - : (1 << SPA_DATA_MemFd); + const int buffer_types = has_modifier + ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) + : (1 << SPA_DATA_MemFd); params.push_back(reinterpret_cast(spa_pod_builder_add_object( &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,