#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/test/video_encoder/bitstream_file_writer.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/ranges/algorithm.h"
#include "media/gpu/test/video_test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
namespace test {
class BitstreamFileWriter::FrameFileWriter { … };
BitstreamFileWriter::BitstreamFileWriter(
std::unique_ptr<FrameFileWriter> frame_file_writer,
std::optional<size_t> spatial_layer_index_to_write,
std::optional<size_t> temporal_layer_index_to_write,
const std::vector<gfx::Size>& spatial_layer_resolutions)
: … { … }
BitstreamFileWriter::~BitstreamFileWriter() { … }
std::unique_ptr<BitstreamFileWriter> BitstreamFileWriter::Create(
const base::FilePath& output_filepath,
VideoCodec codec,
const gfx::Size& resolution,
uint32_t frame_rate,
uint32_t num_frames,
std::optional<size_t> spatial_layer_index_to_write,
std::optional<size_t> temporal_layer_index_to_write,
const std::vector<gfx::Size>& spatial_layer_resolutions) { … }
void BitstreamFileWriter::ProcessBitstream(
scoped_refptr<BitstreamRef> bitstream,
size_t frame_index) { … }
void BitstreamFileWriter::WriteBitstreamTask(
scoped_refptr<BitstreamRef> bitstream,
size_t frame_index) { … }
bool BitstreamFileWriter::WaitUntilDone() { … }
}
}