h264_simulcast_unittest.cc (3801B)
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 #include <utility> 13 14 #include "api/environment/environment.h" 15 #include "api/test/create_simulcast_test_fixture.h" 16 #include "api/test/simulcast_test_fixture.h" 17 #include "api/test/video/function_video_decoder_factory.h" 18 #include "api/test/video/function_video_encoder_factory.h" 19 #include "api/video_codecs/sdp_video_format.h" 20 #include "api/video_codecs/video_decoder_factory.h" 21 #include "api/video_codecs/video_encoder_factory.h" 22 #include "modules/video_coding/codecs/h264/include/h264.h" 23 #include "test/gtest.h" 24 25 namespace webrtc { 26 namespace test { 27 28 namespace { 29 std::unique_ptr<SimulcastTestFixture> CreateSpecificSimulcastTestFixture() { 30 std::unique_ptr<VideoEncoderFactory> encoder_factory = 31 std::make_unique<FunctionVideoEncoderFactory>( 32 [](const Environment& env, const SdpVideoFormat& format) { 33 return CreateH264Encoder(env); 34 }); 35 std::unique_ptr<VideoDecoderFactory> decoder_factory = 36 std::make_unique<FunctionVideoDecoderFactory>( 37 []() { return H264Decoder::Create(); }); 38 return CreateSimulcastTestFixture(std::move(encoder_factory), 39 std::move(decoder_factory), 40 SdpVideoFormat::H264()); 41 } 42 } // namespace 43 44 TEST(TestH264Simulcast, TestKeyFrameRequestsOnAllStreams) { 45 GTEST_SKIP() << "Not applicable to H264."; 46 } 47 48 TEST(TestH264Simulcast, TestKeyFrameRequestsOnSpecificStreams) { 49 auto fixture = CreateSpecificSimulcastTestFixture(); 50 fixture->TestKeyFrameRequestsOnSpecificStreams(); 51 } 52 53 TEST(TestH264Simulcast, TestPaddingAllStreams) { 54 auto fixture = CreateSpecificSimulcastTestFixture(); 55 fixture->TestPaddingAllStreams(); 56 } 57 58 TEST(TestH264Simulcast, TestPaddingTwoStreams) { 59 auto fixture = CreateSpecificSimulcastTestFixture(); 60 fixture->TestPaddingTwoStreams(); 61 } 62 63 TEST(TestH264Simulcast, TestPaddingTwoStreamsOneMaxedOut) { 64 auto fixture = CreateSpecificSimulcastTestFixture(); 65 fixture->TestPaddingTwoStreamsOneMaxedOut(); 66 } 67 68 TEST(TestH264Simulcast, TestPaddingOneStream) { 69 auto fixture = CreateSpecificSimulcastTestFixture(); 70 fixture->TestPaddingOneStream(); 71 } 72 73 TEST(TestH264Simulcast, TestPaddingOneStreamTwoMaxedOut) { 74 auto fixture = CreateSpecificSimulcastTestFixture(); 75 fixture->TestPaddingOneStreamTwoMaxedOut(); 76 } 77 78 TEST(TestH264Simulcast, TestSendAllStreams) { 79 auto fixture = CreateSpecificSimulcastTestFixture(); 80 fixture->TestSendAllStreams(); 81 } 82 83 TEST(TestH264Simulcast, TestDisablingStreams) { 84 auto fixture = CreateSpecificSimulcastTestFixture(); 85 fixture->TestDisablingStreams(); 86 } 87 88 TEST(TestH264Simulcast, TestActiveStreams) { 89 auto fixture = CreateSpecificSimulcastTestFixture(); 90 fixture->TestActiveStreams(); 91 } 92 93 TEST(TestH264Simulcast, TestSwitchingToOneStream) { 94 auto fixture = CreateSpecificSimulcastTestFixture(); 95 fixture->TestSwitchingToOneStream(); 96 } 97 98 TEST(TestH264Simulcast, TestSwitchingToOneOddStream) { 99 auto fixture = CreateSpecificSimulcastTestFixture(); 100 fixture->TestSwitchingToOneOddStream(); 101 } 102 103 TEST(TestH264Simulcast, TestStrideEncodeDecode) { 104 auto fixture = CreateSpecificSimulcastTestFixture(); 105 fixture->TestStrideEncodeDecode(); 106 } 107 108 TEST(TestH264Simulcast, TestSpatioTemporalLayers333PatternEncoder) { 109 auto fixture = CreateSpecificSimulcastTestFixture(); 110 fixture->TestSpatioTemporalLayers333PatternEncoder(); 111 } 112 113 } // namespace test 114 } // namespace webrtc