wayland: Add a common interface for screencast and remote desktop portal
Change adapts the `base_capturer_pipewire` so that a portal can be injected in the capturer. This allows the remoting to inject its own portal for the purpose of capturing desktop stream as long as the injected portal provides implementation of the new interface that is added as part of this change. Additionally, a method has been exposed on the capturer to get details about the portal session so that the remoting implementation can use the same underlying session for controlling inputs on the remote host. Finally, desktop capturer interface is extended with a generic method `GetMetadata` that is used to retrieve session related information by CRD and relay it over to its input injector. Clients provide override for the method and it eventually invokes the underlying `GetSessionDetails` method on the portal instance. Bug: chromium:1291247 Change-Id: I81b7ce3b949d8be2e24e2d303d5fbc76a849209c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256400 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Salman Malik <salmanmalik@google.com> Cr-Commit-Position: refs/heads/main@{#36323}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
ed4a5763f8
commit
e1223747c2
@ -13,16 +13,21 @@
|
||||
|
||||
#include "modules/desktop_capture/desktop_capture_options.h"
|
||||
#include "modules/desktop_capture/desktop_capturer.h"
|
||||
#include "modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h"
|
||||
#include "modules/desktop_capture/linux/wayland/screencast_portal.h"
|
||||
#include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
|
||||
#include "modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.h"
|
||||
#include "modules/desktop_capture/linux/wayland/xdg_session_details.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class BaseCapturerPipeWire : public DesktopCapturer,
|
||||
public ScreenCastPortal::PortalNotifier {
|
||||
public:
|
||||
BaseCapturerPipeWire(const DesktopCaptureOptions& options);
|
||||
explicit BaseCapturerPipeWire(const DesktopCaptureOptions& options);
|
||||
BaseCapturerPipeWire(
|
||||
const DesktopCaptureOptions& options,
|
||||
std::unique_ptr<xdg_portal::ScreenCapturePortalInterface> portal);
|
||||
~BaseCapturerPipeWire() override;
|
||||
|
||||
BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete;
|
||||
@ -40,11 +45,13 @@ class BaseCapturerPipeWire : public DesktopCapturer,
|
||||
int fd) override;
|
||||
void OnScreenCastSessionClosed() override;
|
||||
|
||||
xdg_portal::SessionDetails GetSessionDetails();
|
||||
|
||||
private:
|
||||
DesktopCaptureOptions options_ = {};
|
||||
Callback* callback_ = nullptr;
|
||||
bool capturer_failed_ = false;
|
||||
std::unique_ptr<ScreenCastPortal> screencast_portal_;
|
||||
std::unique_ptr<xdg_portal::ScreenCapturePortalInterface> portal_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user