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

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

Issue 1603643006: Reallocate encoded buffer size if needed. Initially set to the input image size. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 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 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 observation_complete_.Set(); 2201 observation_complete_.Set();
2202 } 2202 }
2203 const uint8_t num_temporal_layers_; 2203 const uint8_t num_temporal_layers_;
2204 const uint8_t num_spatial_layers_; 2204 const uint8_t num_spatial_layers_;
2205 const bool l_field_; 2205 const bool l_field_;
2206 } test(num_temporal_layers, num_spatial_layers); 2206 } test(num_temporal_layers, num_spatial_layers);
2207 2207
2208 RunBaseTest(&test); 2208 RunBaseTest(&test);
2209 } 2209 }
2210 2210
2211 TEST_F(VideoSendStreamTest, Vp9NonFlexModeSmallResolution) {
2212 static const size_t kNumFramesToSend = 50;
2213 static const int kWidth = 4;
2214 static const int kHeight = 4;
2215 class NonFlexibleModeResolution : public Vp9HeaderObserver {
2216 void ModifyVideoConfigsHook(
2217 VideoSendStream::Config* send_config,
2218 std::vector<VideoReceiveStream::Config>* receive_configs,
2219 VideoEncoderConfig* encoder_config) override {
2220 vp9_settings_.flexibleMode = false;
2221 vp9_settings_.numberOfTemporalLayers = 1;
2222 vp9_settings_.numberOfSpatialLayers = 1;
2223
2224 EXPECT_EQ(1u, encoder_config->streams.size());
2225 encoder_config->streams[0].width = kWidth;
2226 encoder_config->streams[0].height = kHeight;
2227 }
2228
2229 void InspectHeader(const RTPVideoHeaderVP9& vp9_header) override {
2230 if (frames_sent_ > kNumFramesToSend)
2231 observation_complete_.Set();
2232 }
2233 } test;
2234
2235 RunBaseTest(&test);
2236 }
2237
2211 #if !defined(MEMORY_SANITIZER) 2238 #if !defined(MEMORY_SANITIZER)
2212 // Fails under MemorySanitizer: 2239 // Fails under MemorySanitizer:
2213 // See https://code.google.com/p/webrtc/issues/detail?id=5402. 2240 // See https://code.google.com/p/webrtc/issues/detail?id=5402.
2214 TEST_F(VideoSendStreamTest, Vp9FlexModeRefCount) { 2241 TEST_F(VideoSendStreamTest, Vp9FlexModeRefCount) {
2215 class FlexibleMode : public Vp9HeaderObserver { 2242 class FlexibleMode : public Vp9HeaderObserver {
2216 void ModifyVideoConfigsHook( 2243 void ModifyVideoConfigsHook(
2217 VideoSendStream::Config* send_config, 2244 VideoSendStream::Config* send_config,
2218 std::vector<VideoReceiveStream::Config>* receive_configs, 2245 std::vector<VideoReceiveStream::Config>* receive_configs,
2219 VideoEncoderConfig* encoder_config) override { 2246 VideoEncoderConfig* encoder_config) override {
2220 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen; 2247 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen;
(...skipping 10 matching lines...) Expand all
2231 observation_complete_.Set(); 2258 observation_complete_.Set();
2232 } 2259 }
2233 } 2260 }
2234 } test; 2261 } test;
2235 2262
2236 RunBaseTest(&test); 2263 RunBaseTest(&test);
2237 } 2264 }
2238 #endif 2265 #endif
2239 2266
2240 } // namespace webrtc 2267 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698