#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stdint.h>
#include <memory>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "components/viz/test/test_context_provider.h"
#include "media/base/media_switches.h"
#include "media/base/video_frame.h"
#include "media/video/gpu_memory_buffer_video_frame_pool.h"
#include "media/video/mock_gpu_video_accelerator_factories.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/gfx/buffer_format_util.h"
_;
AtLeast;
namespace media {
class GpuMemoryBufferVideoFramePoolTest : public ::testing::Test { … };
void MaybeCreateHardwareFrameCallback(
scoped_refptr<VideoFrame>* video_frame_output,
scoped_refptr<VideoFrame> video_frame) { … }
void MaybeCreateHardwareFrameCallbackAndTrackTime(
scoped_refptr<VideoFrame>* video_frame_output,
base::TimeTicks* output_time,
scoped_refptr<VideoFrame> video_frame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, VideoFrameOutputFormatUnknown) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareFrame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareFrameWithOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareFrameWithOddOrigin) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateOneHardwareFrameWithOddOriginOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOne10BppHardwareFrame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateOne10BppHardwareFrameWithOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, ReuseFirstResource) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, DropResourceWhenSizeIsDifferent) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareNV12Frame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateOneHardwareNV12FrameWithOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareFrameForNV12Input) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateOneHardwareFrameForNV12InputWithOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareXR30Frame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareP010Frame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateOneHardwareP010FrameWithOddSize) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareXR30FrameBT709) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareXR30FrameBT601) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareXB30Frame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareRGBAFrame) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, PreservesMetadata) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateGpuMemoryBufferFail) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest,
CreateGpuMemoryBufferFailAfterShutdown) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, ShutdownReleasesUnusedResources) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, StaleFramesAreExpired) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, AtMostOneCopyInFlight) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, PreservesOrder) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, AbortCopies) { … }
TEST_F(GpuMemoryBufferVideoFramePoolTest, VideoFrameChangesPixelFormat) { … }
}