#include "media/capture/video/video_capture_device_client.h"
#include <stddef.h>
#include <memory>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "media/base/limits.h"
#include "media/base/video_frame.h"
#include "media/base/video_types.h"
#include "media/capture/mojom/video_capture_buffer.mojom.h"
#include "media/capture/mojom/video_effects_manager.mojom.h"
#include "media/capture/video/mock_gpu_memory_buffer_manager.h"
#include "media/capture/video/mock_video_frame_receiver.h"
#include "media/capture/video/video_capture_buffer_pool_impl.h"
#include "media/capture/video/video_capture_buffer_tracker.h"
#include "media/capture/video/video_capture_buffer_tracker_factory.h"
#include "media/capture/video/video_capture_buffer_tracker_factory_impl.h"
#include "media/capture/video/video_frame_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/video_effects/public/mojom/video_effects_processor.mojom.h"
#include "services/video_effects/test/fake_video_effects_processor.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "media/capture/video/chromeos/video_capture_jpeg_decoder.h"
#endif
_;
AtLeast;
Field;
InSequence;
Invoke;
Mock;
NiceMock;
Optional;
Pointee;
SaveArg;
namespace media {
namespace {
#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<VideoCaptureJpegDecoder> ReturnNullPtrAsJpecDecoder() {
return nullptr;
}
#endif
class FakeVideoEffectsManagerImpl : public media::mojom::VideoEffectsManager { … };
class FakeVideoCaptureBufferHandle : public VideoCaptureBufferHandle { … };
class FakeVideoCaptureBufferTracker : public VideoCaptureBufferTracker { … };
class FakeVideoCaptureBufferTrackerFactory
: public VideoCaptureBufferTrackerFactory { … };
}
class VideoCaptureDeviceClientTest : public ::testing::Test { … };
TEST_F(VideoCaptureDeviceClientTest, Minimal) { … }
TEST_F(VideoCaptureDeviceClientTest,
ProgressesCaptureBeginTimestampsForOnIncomingCapturedData) { … }
TEST_F(VideoCaptureDeviceClientTest,
ProgressesCaptureBeginTimestampsForOnIncomingCapturedGfxBuffer) { … }
TEST_F(VideoCaptureDeviceClientTest,
ProgressesCaptureBeginTimestampsForOnIncomingCapturedExternalBuffer) { … }
TEST_F(VideoCaptureDeviceClientTest, DropsFrameIfNoBuffer) { … }
TEST_F(VideoCaptureDeviceClientTest, DataCaptureGoodPixelFormats) { … }
TEST_F(VideoCaptureDeviceClientTest, CheckRotationsAndCrops) { … }
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(VideoCaptureDeviceClientTest, DestructionClosesVideoEffectsManager) { … }
#endif
}