blob: e79e8e421b439ade49ee1c869baa74eee38b089d [file] [log] [blame]
Ilya Nikolaevskiyb0588e62018-08-27 12:12:271/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Jonas Olssona4d87372019-07-05 17:08:3311#include "test/fake_vp8_encoder.h"
12
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2713#include <memory>
14#include <utility>
15
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2716#include "api/test/create_simulcast_test_fixture.h"
17#include "api/test/simulcast_test_fixture.h"
Danil Chapovalov99b71df2018-10-26 13:57:4818#include "api/test/video/function_video_decoder_factory.h"
19#include "api/test/video/function_video_encoder_factory.h"
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2720#include "modules/video_coding/utility/simulcast_test_fixture_impl.h"
Per Kjellander841c9122018-10-04 16:40:2821#include "test/fake_vp8_decoder.h"
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2722
23namespace webrtc {
24namespace test {
25
26namespace {
27
28std::unique_ptr<SimulcastTestFixture> CreateSpecificSimulcastTestFixture() {
29 std::unique_ptr<VideoEncoderFactory> encoder_factory =
Mirko Bonadei317a1f02019-09-17 15:06:1830 std::make_unique<FunctionVideoEncoderFactory>([]() {
Nikita Zetilov8e9fd482020-03-06 09:43:4131 return std::make_unique<FakeVp8Encoder>(Clock::GetRealTimeClock());
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2732 });
33 std::unique_ptr<VideoDecoderFactory> decoder_factory =
Mirko Bonadei317a1f02019-09-17 15:06:1834 std::make_unique<FunctionVideoDecoderFactory>(
35 []() { return std::make_unique<FakeVp8Decoder>(); });
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2736 return CreateSimulcastTestFixture(std::move(encoder_factory),
37 std::move(decoder_factory),
38 SdpVideoFormat("VP8"));
39}
40} // namespace
41
42TEST(TestFakeVp8Codec, TestKeyFrameRequestsOnAllStreams) {
43 auto fixture = CreateSpecificSimulcastTestFixture();
44 fixture->TestKeyFrameRequestsOnAllStreams();
45}
46
47TEST(TestFakeVp8Codec, TestPaddingAllStreams) {
48 auto fixture = CreateSpecificSimulcastTestFixture();
49 fixture->TestPaddingAllStreams();
50}
51
52TEST(TestFakeVp8Codec, TestPaddingTwoStreams) {
53 auto fixture = CreateSpecificSimulcastTestFixture();
54 fixture->TestPaddingTwoStreams();
55}
56
57TEST(TestFakeVp8Codec, TestPaddingTwoStreamsOneMaxedOut) {
58 auto fixture = CreateSpecificSimulcastTestFixture();
59 fixture->TestPaddingTwoStreamsOneMaxedOut();
60}
61
62TEST(TestFakeVp8Codec, TestPaddingOneStream) {
63 auto fixture = CreateSpecificSimulcastTestFixture();
64 fixture->TestPaddingOneStream();
65}
66
67TEST(TestFakeVp8Codec, TestPaddingOneStreamTwoMaxedOut) {
68 auto fixture = CreateSpecificSimulcastTestFixture();
69 fixture->TestPaddingOneStreamTwoMaxedOut();
70}
71
72TEST(TestFakeVp8Codec, TestSendAllStreams) {
73 auto fixture = CreateSpecificSimulcastTestFixture();
74 fixture->TestSendAllStreams();
75}
76
77TEST(TestFakeVp8Codec, TestDisablingStreams) {
78 auto fixture = CreateSpecificSimulcastTestFixture();
79 fixture->TestDisablingStreams();
80}
81
82TEST(TestFakeVp8Codec, TestSwitchingToOneStream) {
83 auto fixture = CreateSpecificSimulcastTestFixture();
84 fixture->TestSwitchingToOneStream();
85}
86
87TEST(TestFakeVp8Codec, TestSwitchingToOneOddStream) {
88 auto fixture = CreateSpecificSimulcastTestFixture();
89 fixture->TestSwitchingToOneOddStream();
90}
91
92TEST(TestFakeVp8Codec, TestSwitchingToOneSmallStream) {
93 auto fixture = CreateSpecificSimulcastTestFixture();
94 fixture->TestSwitchingToOneSmallStream();
95}
96
97TEST(TestFakeVp8Codec, TestSpatioTemporalLayers333PatternEncoder) {
98 auto fixture = CreateSpecificSimulcastTestFixture();
99 fixture->TestSpatioTemporalLayers333PatternEncoder();
100}
101
Per Kjellander841c9122018-10-04 16:40:28102TEST(TestFakeVp8Codec, TestDecodeWidthHeightSet) {
103 auto fixture = CreateSpecificSimulcastTestFixture();
104 fixture->TestDecodeWidthHeightSet();
105}
106
Per Kjellanderbe0aec22020-09-29 18:00:03107TEST(TestFakeVp8Codec,
108 TestEncoderInfoForDefaultTemporalLayerProfileHasFpsAllocation) {
109 auto fixture = CreateSpecificSimulcastTestFixture();
110 fixture->TestEncoderInfoForDefaultTemporalLayerProfileHasFpsAllocation();
111}
112
Ilya Nikolaevskiyb0588e62018-08-27 12:12:27113} // namespace test
114} // namespace webrtc