1 /*
2  *  Copyright (c) 2014 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 
11 #include <memory>
12 
13 #include "api/test/create_simulcast_test_fixture.h"
14 #include "api/test/simulcast_test_fixture.h"
15 #include "api/test/video/function_video_decoder_factory.h"
16 #include "api/test/video/function_video_encoder_factory.h"
17 #include "modules/video_coding/codecs/vp8/include/vp8.h"
18 #include "test/gtest.h"
19 
20 namespace webrtc {
21 namespace test {
22 
23 namespace {
CreateSpecificSimulcastTestFixture()24 std::unique_ptr<SimulcastTestFixture> CreateSpecificSimulcastTestFixture() {
25   std::unique_ptr<VideoEncoderFactory> encoder_factory =
26       std::make_unique<FunctionVideoEncoderFactory>(
27           []() { return VP8Encoder::Create(); });
28   std::unique_ptr<VideoDecoderFactory> decoder_factory =
29       std::make_unique<FunctionVideoDecoderFactory>(
30           []() { return VP8Decoder::Create(); });
31   return CreateSimulcastTestFixture(std::move(encoder_factory),
32                                     std::move(decoder_factory),
33                                     SdpVideoFormat("VP8"));
34 }
35 }  // namespace
36 
TEST(LibvpxVp8SimulcastTest,TestKeyFrameRequestsOnAllStreams)37 TEST(LibvpxVp8SimulcastTest, TestKeyFrameRequestsOnAllStreams) {
38   auto fixture = CreateSpecificSimulcastTestFixture();
39   fixture->TestKeyFrameRequestsOnAllStreams();
40 }
41 
TEST(LibvpxVp8SimulcastTest,TestPaddingAllStreams)42 TEST(LibvpxVp8SimulcastTest, TestPaddingAllStreams) {
43   auto fixture = CreateSpecificSimulcastTestFixture();
44   fixture->TestPaddingAllStreams();
45 }
46 
TEST(LibvpxVp8SimulcastTest,TestPaddingTwoStreams)47 TEST(LibvpxVp8SimulcastTest, TestPaddingTwoStreams) {
48   auto fixture = CreateSpecificSimulcastTestFixture();
49   fixture->TestPaddingTwoStreams();
50 }
51 
TEST(LibvpxVp8SimulcastTest,TestPaddingTwoStreamsOneMaxedOut)52 TEST(LibvpxVp8SimulcastTest, TestPaddingTwoStreamsOneMaxedOut) {
53   auto fixture = CreateSpecificSimulcastTestFixture();
54   fixture->TestPaddingTwoStreamsOneMaxedOut();
55 }
56 
TEST(LibvpxVp8SimulcastTest,TestPaddingOneStream)57 TEST(LibvpxVp8SimulcastTest, TestPaddingOneStream) {
58   auto fixture = CreateSpecificSimulcastTestFixture();
59   fixture->TestPaddingOneStream();
60 }
61 
TEST(LibvpxVp8SimulcastTest,TestPaddingOneStreamTwoMaxedOut)62 TEST(LibvpxVp8SimulcastTest, TestPaddingOneStreamTwoMaxedOut) {
63   auto fixture = CreateSpecificSimulcastTestFixture();
64   fixture->TestPaddingOneStreamTwoMaxedOut();
65 }
66 
TEST(LibvpxVp8SimulcastTest,TestSendAllStreams)67 TEST(LibvpxVp8SimulcastTest, TestSendAllStreams) {
68   auto fixture = CreateSpecificSimulcastTestFixture();
69   fixture->TestSendAllStreams();
70 }
71 
TEST(LibvpxVp8SimulcastTest,TestDisablingStreams)72 TEST(LibvpxVp8SimulcastTest, TestDisablingStreams) {
73   auto fixture = CreateSpecificSimulcastTestFixture();
74   fixture->TestDisablingStreams();
75 }
76 
TEST(LibvpxVp8SimulcastTest,TestActiveStreams)77 TEST(LibvpxVp8SimulcastTest, TestActiveStreams) {
78   auto fixture = CreateSpecificSimulcastTestFixture();
79   fixture->TestActiveStreams();
80 }
81 
TEST(LibvpxVp8SimulcastTest,TestSwitchingToOneStream)82 TEST(LibvpxVp8SimulcastTest, TestSwitchingToOneStream) {
83   auto fixture = CreateSpecificSimulcastTestFixture();
84   fixture->TestSwitchingToOneStream();
85 }
86 
TEST(LibvpxVp8SimulcastTest,TestSwitchingToOneOddStream)87 TEST(LibvpxVp8SimulcastTest, TestSwitchingToOneOddStream) {
88   auto fixture = CreateSpecificSimulcastTestFixture();
89   fixture->TestSwitchingToOneOddStream();
90 }
91 
TEST(LibvpxVp8SimulcastTest,TestSwitchingToOneSmallStream)92 TEST(LibvpxVp8SimulcastTest, TestSwitchingToOneSmallStream) {
93   auto fixture = CreateSpecificSimulcastTestFixture();
94   fixture->TestSwitchingToOneSmallStream();
95 }
96 
TEST(LibvpxVp8SimulcastTest,TestSpatioTemporalLayers333PatternEncoder)97 TEST(LibvpxVp8SimulcastTest, TestSpatioTemporalLayers333PatternEncoder) {
98   auto fixture = CreateSpecificSimulcastTestFixture();
99   fixture->TestSpatioTemporalLayers333PatternEncoder();
100 }
101 
TEST(LibvpxVp8SimulcastTest,TestStrideEncodeDecode)102 TEST(LibvpxVp8SimulcastTest, TestStrideEncodeDecode) {
103   auto fixture = CreateSpecificSimulcastTestFixture();
104   fixture->TestStrideEncodeDecode();
105 }
106 
107 }  // namespace test
108 }  // namespace webrtc
109