#include "media/capture/video/mock_video_capture_device_client.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "media/base/video_frame.h"
_;
Invoke;
WithArgs;
namespace media {
namespace {
class StubBufferHandle : public VideoCaptureBufferHandle { … };
class StubBufferHandleProvider
: public VideoCaptureDevice::Client::Buffer::HandleProvider { … };
class StubReadWritePermission
: public VideoCaptureDevice::Client::Buffer::ScopedAccessPermission { … };
VideoCaptureDevice::Client::Buffer CreateStubBuffer(int buffer_id,
size_t mapped_size) { … }
}
MockVideoCaptureDeviceClient::MockVideoCaptureDeviceClient() = default;
MockVideoCaptureDeviceClient::~MockVideoCaptureDeviceClient() = default;
void MockVideoCaptureDeviceClient::OnIncomingCapturedBuffer(
Buffer buffer,
const media::VideoCaptureFormat& format,
base::TimeTicks reference_time,
base::TimeDelta timestamp,
std::optional<base::TimeTicks> capture_begin_time) { … }
void MockVideoCaptureDeviceClient::OnIncomingCapturedBufferExt(
Buffer buffer,
const media::VideoCaptureFormat& format,
const gfx::ColorSpace& color_space,
base::TimeTicks reference_time,
base::TimeDelta timestamp,
std::optional<base::TimeTicks> capture_begin_time,
gfx::Rect visible_rect,
const media::VideoFrameMetadata& additional_metadata) { … }
std::unique_ptr<MockVideoCaptureDeviceClient>
MockVideoCaptureDeviceClient::CreateMockClientWithBufferAllocator(
FakeFrameCapturedCallback frame_captured_callback) { … }
}