#include "components/mirroring/browser/single_client_video_capture_host.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/not_fatal_until.h"
#include "base/token.h"
#include "content/public/browser/web_contents_media_capture_id.h"
#include "media/capture/video/video_capture_buffer_pool.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/video_effects/public/mojom/video_effects_processor.mojom.h"
VideoFrameConsumerFeedbackObserver;
namespace mirroring {
namespace {
class DeviceLauncherCallbacks final
: public content::VideoCaptureDeviceLauncher::Callbacks { … };
}
SingleClientVideoCaptureHost::SingleClientVideoCaptureHost(
const std::string& device_id,
blink::mojom::MediaStreamType type,
DeviceLauncherCreateCallback callback)
: … { … }
SingleClientVideoCaptureHost::~SingleClientVideoCaptureHost() { … }
void SingleClientVideoCaptureHost::Start(
const base::UnguessableToken& device_id,
const base::UnguessableToken& session_id,
const VideoCaptureParams& params,
mojo::PendingRemote<media::mojom::VideoCaptureObserver> observer) { … }
void SingleClientVideoCaptureHost::Stop(
const base::UnguessableToken& device_id) { … }
void SingleClientVideoCaptureHost::Pause(
const base::UnguessableToken& device_id) { … }
void SingleClientVideoCaptureHost::Resume(
const base::UnguessableToken& device_id,
const base::UnguessableToken& session_id,
const VideoCaptureParams& params) { … }
void SingleClientVideoCaptureHost::RequestRefreshFrame(
const base::UnguessableToken& device_id) { … }
void SingleClientVideoCaptureHost::ReleaseBuffer(
const base::UnguessableToken& device_id,
int32_t buffer_id,
const media::VideoCaptureFeedback& feedback) { … }
void SingleClientVideoCaptureHost::GetDeviceSupportedFormats(
const base::UnguessableToken& device_id,
const base::UnguessableToken& session_id,
GetDeviceSupportedFormatsCallback callback) { … }
void SingleClientVideoCaptureHost::GetDeviceFormatsInUse(
const base::UnguessableToken& device_id,
const base::UnguessableToken& session_id,
GetDeviceFormatsInUseCallback callback) { … }
void SingleClientVideoCaptureHost::OnCaptureConfigurationChanged() { … }
void SingleClientVideoCaptureHost::OnNewSubCaptureTargetVersion(
uint32_t sub_capture_target_version) { … }
void SingleClientVideoCaptureHost::OnFrameWithEmptyRegionCapture() { … }
void SingleClientVideoCaptureHost::OnLog(
const base::UnguessableToken& device_id,
const std::string& message) { … }
void SingleClientVideoCaptureHost::OnNewBuffer(
int buffer_id,
media::mojom::VideoBufferHandlePtr buffer_handle) { … }
void SingleClientVideoCaptureHost::OnFrameReadyInBuffer(
media::ReadyFrameInBuffer frame) { … }
void SingleClientVideoCaptureHost::OnBufferRetired(int buffer_id) { … }
void SingleClientVideoCaptureHost::OnError(media::VideoCaptureError error) { … }
void SingleClientVideoCaptureHost::OnFrameDropped(
media::VideoCaptureFrameDropReason reason) { … }
void SingleClientVideoCaptureHost::OnLog(const std::string& message) { … }
void SingleClientVideoCaptureHost::OnStarted() { … }
void SingleClientVideoCaptureHost::OnStartedUsingGpuDecode() { … }
void SingleClientVideoCaptureHost::OnStopped() { … }
void SingleClientVideoCaptureHost::OnDeviceLaunched(
std::unique_ptr<content::LaunchedVideoCaptureDevice> device) { … }
void SingleClientVideoCaptureHost::OnDeviceLaunchFailed(
media::VideoCaptureError error) { … }
void SingleClientVideoCaptureHost::OnDeviceLaunchAborted() { … }
void SingleClientVideoCaptureHost::OnFinishedConsumingBuffer(
int buffer_context_id,
media::VideoCaptureFeedback feedback) { … }
}