You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  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. #include "test/fake_vp8_encoder.h"
  11. #include <memory>
  12. #include <utility>
  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/utility/simulcast_test_fixture_impl.h"
  18. #include "test/fake_vp8_decoder.h"
  19. namespace webrtc {
  20. namespace test {
  21. namespace {
  22. std::unique_ptr<SimulcastTestFixture> CreateSpecificSimulcastTestFixture() {
  23. std::unique_ptr<VideoEncoderFactory> encoder_factory =
  24. std::make_unique<FunctionVideoEncoderFactory>([]() {
  25. return std::make_unique<FakeVP8Encoder>(Clock::GetRealTimeClock());
  26. });
  27. std::unique_ptr<VideoDecoderFactory> decoder_factory =
  28. std::make_unique<FunctionVideoDecoderFactory>(
  29. []() { return std::make_unique<FakeVp8Decoder>(); });
  30. return CreateSimulcastTestFixture(std::move(encoder_factory),
  31. std::move(decoder_factory),
  32. SdpVideoFormat("VP8"));
  33. }
  34. } // namespace
  35. TEST(TestFakeVp8Codec, TestKeyFrameRequestsOnAllStreams) {
  36. auto fixture = CreateSpecificSimulcastTestFixture();
  37. fixture->TestKeyFrameRequestsOnAllStreams();
  38. }
  39. TEST(TestFakeVp8Codec, TestPaddingAllStreams) {
  40. auto fixture = CreateSpecificSimulcastTestFixture();
  41. fixture->TestPaddingAllStreams();
  42. }
  43. TEST(TestFakeVp8Codec, TestPaddingTwoStreams) {
  44. auto fixture = CreateSpecificSimulcastTestFixture();
  45. fixture->TestPaddingTwoStreams();
  46. }
  47. TEST(TestFakeVp8Codec, TestPaddingTwoStreamsOneMaxedOut) {
  48. auto fixture = CreateSpecificSimulcastTestFixture();
  49. fixture->TestPaddingTwoStreamsOneMaxedOut();
  50. }
  51. TEST(TestFakeVp8Codec, TestPaddingOneStream) {
  52. auto fixture = CreateSpecificSimulcastTestFixture();
  53. fixture->TestPaddingOneStream();
  54. }
  55. TEST(TestFakeVp8Codec, TestPaddingOneStreamTwoMaxedOut) {
  56. auto fixture = CreateSpecificSimulcastTestFixture();
  57. fixture->TestPaddingOneStreamTwoMaxedOut();
  58. }
  59. TEST(TestFakeVp8Codec, TestSendAllStreams) {
  60. auto fixture = CreateSpecificSimulcastTestFixture();
  61. fixture->TestSendAllStreams();
  62. }
  63. TEST(TestFakeVp8Codec, TestDisablingStreams) {
  64. auto fixture = CreateSpecificSimulcastTestFixture();
  65. fixture->TestDisablingStreams();
  66. }
  67. TEST(TestFakeVp8Codec, TestSwitchingToOneStream) {
  68. auto fixture = CreateSpecificSimulcastTestFixture();
  69. fixture->TestSwitchingToOneStream();
  70. }
  71. TEST(TestFakeVp8Codec, TestSwitchingToOneOddStream) {
  72. auto fixture = CreateSpecificSimulcastTestFixture();
  73. fixture->TestSwitchingToOneOddStream();
  74. }
  75. TEST(TestFakeVp8Codec, TestSwitchingToOneSmallStream) {
  76. auto fixture = CreateSpecificSimulcastTestFixture();
  77. fixture->TestSwitchingToOneSmallStream();
  78. }
  79. TEST(TestFakeVp8Codec, TestSpatioTemporalLayers333PatternEncoder) {
  80. auto fixture = CreateSpecificSimulcastTestFixture();
  81. fixture->TestSpatioTemporalLayers333PatternEncoder();
  82. }
  83. TEST(TestFakeVp8Codec, TestDecodeWidthHeightSet) {
  84. auto fixture = CreateSpecificSimulcastTestFixture();
  85. fixture->TestDecodeWidthHeightSet();
  86. }
  87. } // namespace test
  88. } // namespace webrtc