#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/protocol/fake_desktop_capturer.h"
#include <stdint.h>
#include <memory>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
namespace remoting::protocol {
static const int kWidth = …;
static const int kHeight = …;
static const int kBoxWidth = …;
static const int kBoxHeight = …;
static const int kSpeed = …;
static_assert …;
static_assert …;
namespace {
class DefaultFrameGenerator
: public base::RefCountedThreadSafe<DefaultFrameGenerator> { … };
std::unique_ptr<webrtc::DesktopFrame> DefaultFrameGenerator::GenerateFrame(
webrtc::SharedMemoryFactory* shared_memory_factory) { … }
}
FakeDesktopCapturer::FakeDesktopCapturer() : … { … }
FakeDesktopCapturer::~FakeDesktopCapturer() = default;
void FakeDesktopCapturer::set_frame_generator(FrameGenerator frame_generator) { … }
void FakeDesktopCapturer::Start(Callback* callback) { … }
void FakeDesktopCapturer::SetSharedMemoryFactory(
std::unique_ptr<webrtc::SharedMemoryFactory> shared_memory_factory) { … }
void FakeDesktopCapturer::CaptureFrame() { … }
bool FakeDesktopCapturer::GetSourceList(SourceList* sources) { … }
bool FakeDesktopCapturer::SelectSource(SourceId id) { … }
}