#include "modules/desktop_capture/linux/wayland/screencast_portal.h"
#include <gio/gunixfdlist.h>
#include <glib-object.h>
#include "modules/portal/scoped_glib.h"
#include "modules/portal/xdg_desktop_portal_utils.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
namespace webrtc {
namespace {
kScreenCastInterfaceName;
PrepareSignalHandle;
RequestResponse;
RequestResponseFromPortalResponse;
RequestSessionProxy;
SetupRequestResponseSignal;
SetupSessionRequestHandlers;
StartSessionRequest;
TearDownSession;
}
ScreenCastPortal::CaptureSourceType ScreenCastPortal::ToCaptureSourceType(
CaptureType type) { … }
ScreenCastPortal::ScreenCastPortal(CaptureType type, PortalNotifier* notifier)
: … { … }
ScreenCastPortal::ScreenCastPortal(
CaptureType type,
PortalNotifier* notifier,
ProxyRequestResponseHandler proxy_request_response_handler,
SourcesRequestResponseSignalHandler sources_request_response_signal_handler,
gpointer user_data,
bool prefer_cursor_embedded)
: … { … }
ScreenCastPortal::~ScreenCastPortal() { … }
void ScreenCastPortal::Stop() { … }
void ScreenCastPortal::UnsubscribeSignalHandlers() { … }
void ScreenCastPortal::SetSessionDetails(
const xdg_portal::SessionDetails& session_details) { … }
void ScreenCastPortal::Start() { … }
xdg_portal::SessionDetails ScreenCastPortal::GetSessionDetails() { … }
void ScreenCastPortal::OnPortalDone(RequestResponse result) { … }
void ScreenCastPortal::OnProxyRequested(GObject* gobject,
GAsyncResult* result,
gpointer user_data) { … }
void ScreenCastPortal::RequestSession(GDBusProxy* proxy) { … }
void ScreenCastPortal::OnSessionRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void ScreenCastPortal::OnSessionRequestResponseSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void ScreenCastPortal::OnSessionClosedSignal(GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void ScreenCastPortal::SourcesRequest() { … }
void ScreenCastPortal::OnSourcesRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void ScreenCastPortal::OnSourcesRequestResponseSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void ScreenCastPortal::StartRequest() { … }
void ScreenCastPortal::OnStartRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void ScreenCastPortal::OnStartRequestResponseSignal(GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
uint32_t ScreenCastPortal::pipewire_stream_node_id() { … }
void ScreenCastPortal::SetPersistMode(ScreenCastPortal::PersistMode mode) { … }
void ScreenCastPortal::SetRestoreToken(const std::string& token) { … }
std::string ScreenCastPortal::RestoreToken() const { … }
void ScreenCastPortal::OpenPipeWireRemote() { … }
void ScreenCastPortal::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
}