Index: webrtc/video/video_stream_encoder_unittest.cc |
diff --git a/webrtc/video/video_stream_encoder_unittest.cc b/webrtc/video/video_stream_encoder_unittest.cc |
index 69b911942ec560f2f9bf0d7e763667c02fa3b76f..d7d09db7aad8d1379a65f984dddf6369815a95bb 100644 |
--- a/webrtc/video/video_stream_encoder_unittest.cc |
+++ b/webrtc/video/video_stream_encoder_unittest.cc |
@@ -34,7 +34,6 @@ |
const int kMinPixelsPerFrame = 320 * 180; |
const int kMinFramerateFps = 2; |
const int64_t kFrameTimeoutMs = 100; |
-const unsigned char kNumSlDummy = 0; |
} // namespace |
namespace webrtc { |
@@ -318,7 +317,6 @@ |
void ResetEncoder(const std::string& payload_name, |
size_t num_streams, |
size_t num_temporal_layers, |
- unsigned char num_spatial_layers, |
bool nack_enabled, |
bool screenshare) { |
video_send_config_.encoder_settings.payload_name = payload_name; |
@@ -332,13 +330,6 @@ |
video_encoder_config.content_type = |
screenshare ? VideoEncoderConfig::ContentType::kScreen |
: VideoEncoderConfig::ContentType::kRealtimeVideo; |
- if (payload_name == "VP9") { |
- VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); |
- vp9_settings.numberOfSpatialLayers = num_spatial_layers; |
- video_encoder_config.encoder_specific_settings = |
- new rtc::RefCountedObject< |
- VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); |
- } |
ConfigureEncoder(std::move(video_encoder_config), nack_enabled); |
} |
@@ -808,7 +799,7 @@ |
const bool kNackEnabled = true; |
const size_t kNumStreams = 1; |
const size_t kNumTl = 1; |
- ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false); |
+ ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled, false); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
// Capture a frame and wait for it to synchronize with the encoder thread. |
@@ -828,7 +819,7 @@ |
const bool kNackEnabled = true; |
const size_t kNumStreams = 2; |
const size_t kNumTl = 1; |
- ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false); |
+ ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled, false); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
// Capture a frame and wait for it to synchronize with the encoder thread. |
@@ -848,7 +839,7 @@ |
const bool kNackEnabled = false; |
const size_t kNumStreams = 1; |
const size_t kNumTl = 1; |
- ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false); |
+ ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled, false); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
// Capture a frame and wait for it to synchronize with the encoder thread. |
@@ -868,7 +859,7 @@ |
const bool kNackEnabled = true; |
const size_t kNumStreams = 1; |
const size_t kNumTl = 2; |
- ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled, false); |
+ ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled, false); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
// Capture a frame and wait for it to synchronize with the encoder thread. |
@@ -881,94 +872,6 @@ |
EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); |
// Resilience is on for temporal layers. |
EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience); |
- video_stream_encoder_->Stop(); |
-} |
- |
-TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOffFor1SL1TLWithNackEnabled) { |
- const bool kNackEnabled = true; |
- const size_t kNumStreams = 1; |
- const size_t kNumTl = 1; |
- const unsigned char kNumSl = 1; |
- ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false); |
- video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- |
- // Capture a frame and wait for it to synchronize with the encoder thread. |
- video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
- sink_.WaitForEncodedFrame(1); |
- // The encoder have been configured once when the first frame is received. |
- EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
- EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
- EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
- EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
- EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
- // Resilience is off for no spatial and temporal layers with nack on. |
- EXPECT_FALSE(fake_encoder_.codec_config().VP9()->resilienceOn); |
- video_stream_encoder_->Stop(); |
-} |
- |
-TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor1SL1TLWithNackDisabled) { |
- const bool kNackEnabled = false; |
- const size_t kNumStreams = 1; |
- const size_t kNumTl = 1; |
- const unsigned char kNumSl = 1; |
- ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false); |
- video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- |
- // Capture a frame and wait for it to synchronize with the encoder thread. |
- video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
- sink_.WaitForEncodedFrame(1); |
- // The encoder have been configured once when the first frame is received. |
- EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
- EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
- EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
- EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
- EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
- // Resilience is on if nack is off. |
- EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
- video_stream_encoder_->Stop(); |
-} |
- |
-TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor2SL1TLWithNackEnabled) { |
- const bool kNackEnabled = true; |
- const size_t kNumStreams = 1; |
- const size_t kNumTl = 1; |
- const unsigned char kNumSl = 2; |
- ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false); |
- video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- |
- // Capture a frame and wait for it to synchronize with the encoder thread. |
- video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
- sink_.WaitForEncodedFrame(1); |
- // The encoder have been configured once when the first frame is received. |
- EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
- EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
- EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
- EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
- EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
- // Resilience is on for spatial layers. |
- EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
- video_stream_encoder_->Stop(); |
-} |
- |
-TEST_F(VideoStreamEncoderTest, Vp9ResilienceIsOnFor1SL2TLWithNackEnabled) { |
- const bool kNackEnabled = true; |
- const size_t kNumStreams = 1; |
- const size_t kNumTl = 2; |
- const unsigned char kNumSl = 1; |
- ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled, false); |
- video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- |
- // Capture a frame and wait for it to synchronize with the encoder thread. |
- video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
- sink_.WaitForEncodedFrame(1); |
- // The encoder have been configured once when the first frame is received. |
- EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
- EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
- EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
- EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
- EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
- // Resilience is on for temporal layers. |
- EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
video_stream_encoder_->Stop(); |
} |
@@ -2560,7 +2463,7 @@ |
TEST_F(VideoStreamEncoderTest, FailingInitEncodeDoesntCauseCrash) { |
fake_encoder_.ForceInitEncodeFailure(true); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- ResetEncoder("VP8", 2, 1, 1, true, false); |
+ ResetEncoder("VP8", 2, 1, true, false); |
const int kFrameWidth = 1280; |
const int kFrameHeight = 720; |
video_source_.IncomingCapturedFrame( |
@@ -2707,7 +2610,7 @@ |
// Reconfigure encoder with two temporal layers and screensharing, which will |
// disable frame dropping and make testing easier. |
- ResetEncoder("VP8", 1, 2, 1, true, true); |
+ ResetEncoder("VP8", 1, 2, true, true); |
video_stream_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
video_stream_encoder_->SetSource( |