#include "services/video_capture/video_source_provider_impl.h"
#include "base/functional/bind.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "services/video_capture/public/mojom/producer.mojom.h"
#include "services/video_capture/video_source_impl.h"
#include "services/video_capture/virtual_device_enabled_device_factory.h"
namespace video_capture {
VideoSourceProviderImpl::VideoSourceProviderImpl(
DeviceFactory* device_factory,
base::RepeatingClosure on_last_client_disconnected_cb)
: … { … }
VideoSourceProviderImpl::~VideoSourceProviderImpl() = default;
void VideoSourceProviderImpl::AddClient(
mojo::PendingReceiver<mojom::VideoSourceProvider> receiver) { … }
void VideoSourceProviderImpl::GetSourceInfos(GetSourceInfosCallback callback) { … }
void VideoSourceProviderImpl::GetVideoSource(
const std::string& device_id,
mojo::PendingReceiver<mojom::VideoSource> source_receiver) { … }
void VideoSourceProviderImpl::AddSharedMemoryVirtualDevice(
const media::VideoCaptureDeviceInfo& device_info,
mojo::PendingRemote<mojom::Producer> producer,
mojo::PendingReceiver<mojom::SharedMemoryVirtualDevice>
virtual_device_receiver) { … }
void VideoSourceProviderImpl::AddTextureVirtualDevice(
const media::VideoCaptureDeviceInfo& device_info,
mojo::PendingReceiver<mojom::TextureVirtualDevice>
virtual_device_receiver) { … }
void VideoSourceProviderImpl::RegisterVirtualDevicesChangedObserver(
mojo::PendingRemote<mojom::DevicesChangedObserver> observer,
bool raise_event_if_virtual_devices_already_present) { … }
void VideoSourceProviderImpl::RegisterDevicesChangedObserver(
mojo::PendingRemote<mojom::DevicesChangedObserver> observer) { … }
void VideoSourceProviderImpl::Close(CloseCallback callback) { … }
void VideoSourceProviderImpl::OnClientDisconnected() { … }
void VideoSourceProviderImpl::OnClientDisconnectedOrClosed() { … }
void VideoSourceProviderImpl::OnVideoSourceLastClientDisconnected(
const std::string& device_id) { … }
}