#include "services/video_capture/broadcasting_receiver.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/platform_shared_memory_region.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace video_capture {
class BroadcastingReceiver::ClientVideoFrameAccessHandler
: public mojom::VideoFrameAccessHandler { … };
BroadcastingReceiver::ClientContext::ClientContext(
mojo::PendingRemote<mojom::VideoFrameHandler> client,
media::VideoCaptureBufferType target_buffer_type)
: … { … }
BroadcastingReceiver::ClientContext::~ClientContext() = default;
BroadcastingReceiver::ClientContext::ClientContext(
BroadcastingReceiver::ClientContext&& other) = default;
BroadcastingReceiver::ClientContext& BroadcastingReceiver::ClientContext::
operator=(BroadcastingReceiver::ClientContext&& other) = default;
void BroadcastingReceiver::ClientContext::OnStarted() { … }
void BroadcastingReceiver::ClientContext::OnStartedUsingGpuDecode() { … }
BroadcastingReceiver::BufferContext::BufferContext(
int buffer_id,
media::mojom::VideoBufferHandlePtr buffer_handle)
: … { … }
BroadcastingReceiver::BufferContext::~BufferContext() = default;
BroadcastingReceiver::BufferContext::BufferContext(
BroadcastingReceiver::BufferContext&& other)
: … { … }
BroadcastingReceiver::BufferContext&
BroadcastingReceiver::BufferContext::operator=(
BroadcastingReceiver::BufferContext&& other) { … }
void BroadcastingReceiver::BufferContext::IncreaseConsumerCount() { … }
void BroadcastingReceiver::BufferContext::DecreaseConsumerCount() { … }
bool BroadcastingReceiver::BufferContext::IsStillBeingConsumed() const { … }
media::mojom::VideoBufferHandlePtr
BroadcastingReceiver::BufferContext::CloneBufferHandle(
media::VideoCaptureBufferType target_buffer_type) { … }
BroadcastingReceiver::BroadcastingReceiver()
: … { … }
BroadcastingReceiver::~BroadcastingReceiver() { … }
base::WeakPtr<media::VideoFrameReceiver> BroadcastingReceiver::GetWeakPtr() { … }
void BroadcastingReceiver::HideSourceRestartFromClients(
base::OnceClosure on_stopped_handler) { … }
void BroadcastingReceiver::SetOnStoppedHandler(
base::OnceClosure on_stopped_handler) { … }
int32_t BroadcastingReceiver::AddClient(
mojo::PendingRemote<mojom::VideoFrameHandler> client,
media::VideoCaptureBufferType target_buffer_type) { … }
void BroadcastingReceiver::SuspendClient(int32_t client_id) { … }
void BroadcastingReceiver::ResumeClient(int32_t client_id) { … }
mojo::Remote<mojom::VideoFrameHandler> BroadcastingReceiver::RemoveClient(
int32_t client_id) { … }
void BroadcastingReceiver::OnCaptureConfigurationChanged() { … }
void BroadcastingReceiver::OnNewBuffer(
int32_t buffer_id,
media::mojom::VideoBufferHandlePtr buffer_handle) { … }
void BroadcastingReceiver::OnFrameReadyInBuffer(
media::ReadyFrameInBuffer frame) { … }
void BroadcastingReceiver::OnBufferRetired(int32_t buffer_id) { … }
void BroadcastingReceiver::OnError(media::VideoCaptureError error) { … }
void BroadcastingReceiver::OnFrameDropped(
media::VideoCaptureFrameDropReason reason) { … }
void BroadcastingReceiver::OnNewSubCaptureTargetVersion(
uint32_t sub_capture_target_version) { … }
void BroadcastingReceiver::OnFrameWithEmptyRegionCapture() { … }
void BroadcastingReceiver::OnLog(const std::string& message) { … }
void BroadcastingReceiver::OnStarted() { … }
void BroadcastingReceiver::OnStartedUsingGpuDecode() { … }
void BroadcastingReceiver::OnStopped() { … }
void BroadcastingReceiver::OnClientFinishedConsumingFrame(
int32_t buffer_context_id) { … }
void BroadcastingReceiver::OnClientDisconnected(int32_t client_id) { … }
std::vector<BroadcastingReceiver::BufferContext>::iterator
BroadcastingReceiver::FindUnretiredBufferContextFromBufferId(
int32_t buffer_id) { … }
}