#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/test/video_encoder/video_encoder.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "media/base/video_bitrate_allocation.h"
#include "media/gpu/macros.h"
#include "media/gpu/test/bitstream_helpers.h"
#include "media/gpu/test/raw_video.h"
#include "media/gpu/test/video_encoder/video_encoder_client.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
namespace test {
namespace {
const char* EventName(VideoEncoder::EncoderEvent event) { … }
constexpr base::TimeDelta kDefaultEventWaitTimeout = …;
constexpr size_t kDefaultEventListSize = …;
constexpr std::pair<VideoEncoder::EncoderEvent, size_t> kInvalidEncodeUntil{ … };
}
std::unique_ptr<VideoEncoder> VideoEncoder::Create(
const VideoEncoderClientConfig& config,
std::vector<std::unique_ptr<BitstreamProcessor>> bitstream_processors) { … }
VideoEncoder::VideoEncoder()
: … { … }
VideoEncoder::~VideoEncoder() { … }
bool VideoEncoder::CreateEncoderClient(
const VideoEncoderClientConfig& config,
std::vector<std::unique_ptr<BitstreamProcessor>> bitstream_processors) { … }
void VideoEncoder::SetEventWaitTimeout(base::TimeDelta timeout) { … }
bool VideoEncoder::Initialize(const RawVideo* video) { … }
void VideoEncoder::Encode() { … }
void VideoEncoder::EncodeUntil(EncoderEvent event, size_t event_count) { … }
void VideoEncoder::Flush() { … }
void VideoEncoder::UpdateBitrate(const VideoBitrateAllocation& bitrate,
uint32_t framerate) { … }
void VideoEncoder::ForceKeyFrame() { … }
VideoEncoder::EncoderState VideoEncoder::GetState() const { … }
bool VideoEncoder::WaitForEvent(EncoderEvent event, size_t times) { … }
bool VideoEncoder::WaitUntilIdle() { … }
bool VideoEncoder::WaitForFlushDone() { … }
bool VideoEncoder::WaitForFrameReleased(size_t times) { … }
size_t VideoEncoder::GetEventCount(EncoderEvent event) const { … }
bool VideoEncoder::WaitForBitstreamProcessors() { … }
VideoEncoderStats VideoEncoder::GetStats() const { … }
void VideoEncoder::ResetStats() { … }
size_t VideoEncoder::GetFlushDoneCount() const { … }
size_t VideoEncoder::GetFrameReleasedCount() const { … }
bool VideoEncoder::NotifyEvent(EncoderEvent event) { … }
}
}