Jan Grulich 56d126074e PipeWire video capture: split portal and PipeWire implementations
Allows to use camera portal separately in implementations where each
implementation needs to be called in different places.

This is targeted for Firefox support, where we need to ask for camera
access in the FF frontend code, otherwise making camera access requests
in the backend WebRTC code might result into presenting portal dialogs
asking for access from the javascript API.

Bug: webrtc:15202
Change-Id: Ida8b010bb93e08a9e5ddd9dd8a2a3549ee7fde8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305222
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jan Grulich <grulja@gmail.com>
Cr-Commit-Position: refs/heads/main@{#40148}
2023-05-25 17:04:53 +00:00

48 lines
1.2 KiB
C++

/*
* Copyright (c) 2023 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_VIDEO_CAPTURE_LINUX_CAMERA_PORTAL_H_
#define MODULES_VIDEO_CAPTURE_LINUX_CAMERA_PORTAL_H_
#include <memory>
#include <string>
#include "modules/portal/portal_request_response.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
class CameraPortalPrivate;
class RTC_EXPORT CameraPortal {
public:
class PortalNotifier {
public:
virtual void OnCameraRequestResult(xdg_portal::RequestResponse result,
int fd) = 0;
protected:
PortalNotifier() = default;
virtual ~PortalNotifier() = default;
};
explicit CameraPortal(PortalNotifier* notifier);
~CameraPortal();
void Start();
private:
std::unique_ptr<CameraPortalPrivate> private_;
};
} // namespace webrtc
#endif // MODULES_VIDEO_CAPTURE_LINUX_CAMERA_PORTAL_H_