#include "content/browser/renderer_host/media/in_process_launched_video_capture_device.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/token.h"
#include "build/build_config.h"
#include "content/common/buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "media/capture/mojom/video_capture_types.mojom.h"
#include "media/media_buildflags.h"
#if BUILDFLAG(ENABLE_SCREEN_CAPTURE) && !BUILDFLAG(IS_ANDROID)
#include "content/browser/media/capture/desktop_capture_device.h"
#endif
namespace {
void StopAndReleaseDeviceOnDeviceThread(
std::unique_ptr<media::VideoCaptureDevice> device,
base::OnceClosure done_cb) { … }
}
namespace content {
InProcessLaunchedVideoCaptureDevice::InProcessLaunchedVideoCaptureDevice(
std::unique_ptr<media::VideoCaptureDevice> device,
scoped_refptr<base::SingleThreadTaskRunner> device_task_runner)
: … { … }
InProcessLaunchedVideoCaptureDevice::~InProcessLaunchedVideoCaptureDevice() { … }
void InProcessLaunchedVideoCaptureDevice::GetPhotoState(
media::VideoCaptureDevice::GetPhotoStateCallback callback) { … }
void InProcessLaunchedVideoCaptureDevice::SetPhotoOptions(
media::mojom::PhotoSettingsPtr settings,
media::VideoCaptureDevice::SetPhotoOptionsCallback callback) { … }
void InProcessLaunchedVideoCaptureDevice::TakePhoto(
media::VideoCaptureDevice::TakePhotoCallback callback) { … }
void InProcessLaunchedVideoCaptureDevice::MaybeSuspendDevice() { … }
void InProcessLaunchedVideoCaptureDevice::ResumeDevice() { … }
void InProcessLaunchedVideoCaptureDevice::ApplySubCaptureTarget(
media::mojom::SubCaptureTargetType type,
const base::Token& target,
uint32_t sub_capture_target_version,
base::OnceCallback<void(media::mojom::ApplySubCaptureTargetResult)>
callback) { … }
void InProcessLaunchedVideoCaptureDevice::RequestRefreshFrame() { … }
void InProcessLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
gfx::NativeViewId window_id,
base::OnceClosure done_cb) { … }
void InProcessLaunchedVideoCaptureDevice::OnUtilizationReport(
media::VideoCaptureFeedback feedback) { … }
void InProcessLaunchedVideoCaptureDevice::
SetDesktopCaptureWindowIdOnDeviceThread(media::VideoCaptureDevice* device,
gfx::NativeViewId window_id,
base::OnceClosure done_cb) { … }
}