#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/client/dual_buffer_frame_consumer.h"
#include <memory>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
namespace remoting {
namespace {
class PaddedDesktopFrame : public webrtc::DesktopFrame { … };
PaddedDesktopFrame::PaddedDesktopFrame(webrtc::DesktopSize size)
: … { … }
PaddedDesktopFrame::~PaddedDesktopFrame() { … }
std::unique_ptr<webrtc::DesktopFrame> PaddedDesktopFrame::CopyOf(
const webrtc::DesktopFrame& frame) { … }
}
DualBufferFrameConsumer::DualBufferFrameConsumer(
RenderCallback callback,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
protocol::FrameConsumer::PixelFormat format)
: … { … }
DualBufferFrameConsumer::~DualBufferFrameConsumer() { … }
void DualBufferFrameConsumer::RequestFullDesktopFrame() { … }
std::unique_ptr<webrtc::DesktopFrame> DualBufferFrameConsumer::AllocateFrame(
const webrtc::DesktopSize& size) { … }
void DualBufferFrameConsumer::DrawFrame(
std::unique_ptr<webrtc::DesktopFrame> frame,
base::OnceClosure done) { … }
protocol::FrameConsumer::PixelFormat
DualBufferFrameConsumer::GetPixelFormat() { … }
base::WeakPtr<DualBufferFrameConsumer> DualBufferFrameConsumer::GetWeakPtr() { … }
void DualBufferFrameConsumer::RunRenderCallback(
std::unique_ptr<webrtc::DesktopFrame> frame,
base::OnceClosure done) { … }
}