Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: webrtc/video/video_send_stream_tests.cc

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Updated tl listener registration. Fixed tests. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include <algorithm> // max 10 #include <algorithm> // max
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 // VideoCodec. 2010 // VideoCodec.
2011 EXPECT_EQ(kVideoCodecConfigObserverNumberOfTemporalLayers, 2011 EXPECT_EQ(kVideoCodecConfigObserverNumberOfTemporalLayers,
2012 config.codecSpecific.VP8.numberOfTemporalLayers); 2012 config.codecSpecific.VP8.numberOfTemporalLayers);
2013 2013
2014 for (unsigned char i = 0; i < config.numberOfSimulcastStreams; ++i) { 2014 for (unsigned char i = 0; i < config.numberOfSimulcastStreams; ++i) {
2015 EXPECT_EQ(kVideoCodecConfigObserverNumberOfTemporalLayers, 2015 EXPECT_EQ(kVideoCodecConfigObserverNumberOfTemporalLayers,
2016 config.simulcastStream[i].numberOfTemporalLayers); 2016 config.simulcastStream[i].numberOfTemporalLayers);
2017 } 2017 }
2018 2018
2019 // Set expected temporal layers as they should have been set when 2019 // Set expected temporal layers as they should have been set when
2020 // reconfiguring the encoder and not match the set config. 2020 // reconfiguring the encoder and not match the set config. Also copy the
2021 // TemporalLayersFactory pointer that has been injected by ViEEncoder.
2021 VideoCodecVP8 encoder_settings = encoder_settings_; 2022 VideoCodecVP8 encoder_settings = encoder_settings_;
2022 encoder_settings.numberOfTemporalLayers = 2023 encoder_settings.numberOfTemporalLayers =
2023 kVideoCodecConfigObserverNumberOfTemporalLayers; 2024 kVideoCodecConfigObserverNumberOfTemporalLayers;
2025 encoder_settings.tl_factory = config.codecSpecific.VP8.tl_factory;
2024 EXPECT_EQ(0, memcmp(&config.codecSpecific.VP8, &encoder_settings, 2026 EXPECT_EQ(0, memcmp(&config.codecSpecific.VP8, &encoder_settings,
2025 sizeof(encoder_settings_))); 2027 sizeof(encoder_settings_)));
2026 } 2028 }
2027 2029
2028 template <> 2030 template <>
2029 rtc::scoped_refptr<VideoEncoderConfig::EncoderSpecificSettings> 2031 rtc::scoped_refptr<VideoEncoderConfig::EncoderSpecificSettings>
2030 VideoCodecConfigObserver<VideoCodecVP8>::GetEncoderSpecificSettings() const { 2032 VideoCodecConfigObserver<VideoCodecVP8>::GetEncoderSpecificSettings() const {
2031 return new rtc::RefCountedObject< 2033 return new rtc::RefCountedObject<
2032 VideoEncoderConfig::Vp8EncoderSpecificSettings>(encoder_settings_); 2034 VideoEncoderConfig::Vp8EncoderSpecificSettings>(encoder_settings_);
2033 } 2035 }
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 observation_complete_.Set(); 2890 observation_complete_.Set();
2889 } 2891 }
2890 } 2892 }
2891 } test; 2893 } test;
2892 2894
2893 RunBaseTest(&test); 2895 RunBaseTest(&test);
2894 } 2896 }
2895 #endif // !defined(RTC_DISABLE_VP9) 2897 #endif // !defined(RTC_DISABLE_VP9)
2896 2898
2897 } // namespace webrtc 2899 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698