#include "media/capture/video/video_capture_device.h"
#include <string_view>
#include "base/command_line.h"
#include "base/containers/fixed_flat_set.h"
#include "base/functional/callback.h"
#include "base/i18n/timezone.h"
#include "base/strings/string_util.h"
#include "base/token.h"
#include "build/build_config.h"
#include "media/base/media_switches.h"
#include "media/capture/mojom/video_capture_types.mojom.h"
namespace media {
CapturedExternalVideoBuffer::CapturedExternalVideoBuffer(
gfx::GpuMemoryBufferHandle handle,
VideoCaptureFormat format,
gfx::ColorSpace color_space)
: … { … }
#if BUILDFLAG(IS_WIN)
CapturedExternalVideoBuffer::CapturedExternalVideoBuffer(
Microsoft::WRL::ComPtr<IMFMediaBuffer> imf_buffer,
gfx::GpuMemoryBufferHandle handle,
VideoCaptureFormat format,
gfx::ColorSpace color_space)
: imf_buffer(std::move(imf_buffer)),
handle(std::move(handle)),
format(std::move(format)),
color_space(std::move(color_space)) {}
#endif
CapturedExternalVideoBuffer::CapturedExternalVideoBuffer(
CapturedExternalVideoBuffer&& other)
: … { … }
CapturedExternalVideoBuffer& CapturedExternalVideoBuffer::operator=(
CapturedExternalVideoBuffer&& other) { … }
CapturedExternalVideoBuffer::~CapturedExternalVideoBuffer() = default;
VideoCaptureDevice::Client::Buffer::Buffer() : … { … }
VideoCaptureDevice::Client::Buffer::Buffer(
int buffer_id,
int frame_feedback_id,
std::unique_ptr<HandleProvider> handle_provider,
std::unique_ptr<ScopedAccessPermission> access_permission)
: … { … }
VideoCaptureDevice::Client::Buffer::Buffer(
VideoCaptureDevice::Client::Buffer&& other) = default;
VideoCaptureDevice::Client::Buffer::~Buffer() = default;
VideoCaptureDevice::Client::Buffer& VideoCaptureDevice::Client::Buffer::
operator=(VideoCaptureDevice::Client::Buffer&& other) = default;
void VideoCaptureDevice::Client::OnIncomingCapturedData(
const uint8_t* data,
int length,
const VideoCaptureFormat& frame_format,
const gfx::ColorSpace& color_space,
int clockwise_rotation,
bool flip_y,
base::TimeTicks reference_time,
base::TimeDelta timestamp,
std::optional<base::TimeTicks> capture_begin_timestamp) { … }
void VideoCaptureDevice::Client::OnIncomingCapturedGfxBuffer(
gfx::GpuMemoryBuffer* buffer,
const VideoCaptureFormat& frame_format,
int clockwise_rotation,
base::TimeTicks reference_time,
base::TimeDelta timestamp,
std::optional<base::TimeTicks> capture_begin_timestamp) { … }
VideoCaptureDevice::~VideoCaptureDevice() = default;
void VideoCaptureDevice::ApplySubCaptureTarget(
mojom::SubCaptureTargetType type,
const base::Token& target,
uint32_t sub_capture_target_version,
base::OnceCallback<void(media::mojom::ApplySubCaptureTargetResult)>
callback) { … }
void VideoCaptureDevice::GetPhotoState(GetPhotoStateCallback callback) { … }
void VideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
SetPhotoOptionsCallback callback) { … }
void VideoCaptureDevice::TakePhoto(TakePhotoCallback callback) { … }
PowerLineFrequency VideoCaptureDevice::GetPowerLineFrequencyForLocation() { … }
PowerLineFrequency VideoCaptureDevice::GetPowerLineFrequency(
const VideoCaptureParams& params) { … }
VideoCaptureFrameDropReason ConvertReservationFailureToFrameDropReason(
VideoCaptureDevice::Client::ReserveResult reserve_result) { … }
}