#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/test/video_frame_writer.h"
#include <stdint.h>
#include <vector>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/i18n/time_formatting.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/geometry/size.h"
namespace {
const base::FilePath::CharType kFrameFileName[] = …);
const base::FilePath::CharType kRemotingFolder[] = …);
const base::FilePath::CharType kDumpFrameFolder[] = …);
}
namespace remoting {
namespace test {
VideoFrameWriter::VideoFrameWriter()
: … { … }
VideoFrameWriter::~VideoFrameWriter() = default;
void VideoFrameWriter::WriteFrameToPath(const webrtc::DesktopFrame& frame,
const base::FilePath& image_path) { … }
void VideoFrameWriter::WriteFrameToDefaultPath(
const webrtc::DesktopFrame& frame) { … }
void VideoFrameWriter::HighlightRectInFrame(webrtc::DesktopFrame* frame,
const webrtc::DesktopRect& rect) { … }
base::FilePath VideoFrameWriter::AppendCreationDateAndTime(
const base::FilePath& file_path) { … }
bool VideoFrameWriter::CreateDirectoryIfNotExists(
const base::FilePath& file_path) { … }
void VideoFrameWriter::ShiftPixelColor(webrtc::DesktopFrame* frame,
int x,
int y,
int shift_amount) { … }
}
}