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

Side by Side Diff: webrtc/modules/video_coding/video_sender_unittest.cc

Issue 1464313004: Remove unused methods in VideoCodingModule. (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
« no previous file with comments | « webrtc/modules/video_coding/video_sender.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 protected: 198 protected:
199 static const int kDefaultWidth = 1280; 199 static const int kDefaultWidth = 1280;
200 static const int kDefaultHeight = 720; 200 static const int kDefaultHeight = 720;
201 static const int kNumberOfStreams = 3; 201 static const int kNumberOfStreams = 3;
202 static const int kNumberOfLayers = 3; 202 static const int kNumberOfLayers = 3;
203 static const int kUnusedPayloadType = 10; 203 static const int kUnusedPayloadType = 10;
204 204
205 void SetUp() override { 205 void SetUp() override {
206 TestVideoSender::SetUp(); 206 TestVideoSender::SetUp();
207 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, false); 207 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, false);
208 memset(&settings_, 0, sizeof(settings_)); 208 VideoCodingModule::Codec(kVideoCodecVP8, &settings_);
209 EXPECT_EQ(0, VideoCodingModule::Codec(kVideoCodecVP8, &settings_));
210 settings_.numberOfSimulcastStreams = kNumberOfStreams; 209 settings_.numberOfSimulcastStreams = kNumberOfStreams;
211 ConfigureStream(kDefaultWidth / 4, kDefaultHeight / 4, 100, 210 ConfigureStream(kDefaultWidth / 4, kDefaultHeight / 4, 100,
212 &settings_.simulcastStream[0]); 211 &settings_.simulcastStream[0]);
213 ConfigureStream(kDefaultWidth / 2, kDefaultHeight / 2, 500, 212 ConfigureStream(kDefaultWidth / 2, kDefaultHeight / 2, 500,
214 &settings_.simulcastStream[1]); 213 &settings_.simulcastStream[1]);
215 ConfigureStream(kDefaultWidth, kDefaultHeight, 1200, 214 ConfigureStream(kDefaultWidth, kDefaultHeight, 1200,
216 &settings_.simulcastStream[2]); 215 &settings_.simulcastStream[2]);
217 settings_.plType = kUnusedPayloadType; // Use the mocked encoder. 216 settings_.plType = kUnusedPayloadType; // Use the mocked encoder.
218 generator_.reset( 217 generator_.reset(
219 new EmptyFrameGenerator(settings_.width, settings_.height)); 218 new EmptyFrameGenerator(settings_.width, settings_.height));
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 codec_.maxBitrate = codec_bitrate_kbps_; 372 codec_.maxBitrate = codec_bitrate_kbps_;
374 encoder_.reset(VP8Encoder::Create()); 373 encoder_.reset(VP8Encoder::Create());
375 sender_->RegisterExternalEncoder(encoder_.get(), codec_.plType, false); 374 sender_->RegisterExternalEncoder(encoder_.get(), codec_.plType, false);
376 EXPECT_EQ(0, sender_->RegisterSendCodec(&codec_, 1, 1200)); 375 EXPECT_EQ(0, sender_->RegisterSendCodec(&codec_, 1, 1200));
377 } 376 }
378 377
379 static VideoCodec MakeVp8VideoCodec(int width, 378 static VideoCodec MakeVp8VideoCodec(int width,
380 int height, 379 int height,
381 int temporal_layers) { 380 int temporal_layers) {
382 VideoCodec codec; 381 VideoCodec codec;
383 memset(&codec, 0, sizeof(codec)); 382 VideoCodingModule::Codec(kVideoCodecVP8, &codec);
384 EXPECT_EQ(0, VideoCodingModule::Codec(kVideoCodecVP8, &codec));
385 codec.width = width; 383 codec.width = width;
386 codec.height = height; 384 codec.height = height;
387 codec.codecSpecific.VP8.numberOfTemporalLayers = temporal_layers; 385 codec.codecSpecific.VP8.numberOfTemporalLayers = temporal_layers;
388 return codec; 386 return codec;
389 } 387 }
390 388
391 void InsertFrames(float framerate, float seconds) { 389 void InsertFrames(float framerate, float seconds) {
392 for (int i = 0; i < seconds * framerate; ++i) { 390 for (int i = 0; i < seconds * framerate; ++i) {
393 clock_.AdvanceTimeMilliseconds(1000.0f / framerate); 391 clock_.AdvanceTimeMilliseconds(1000.0f / framerate);
394 EXPECT_CALL(post_encode_callback_, Encoded(_, NULL, NULL)) 392 EXPECT_CALL(post_encode_callback_, Encoded(_, NULL, NULL))
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 479 }
482 { 480 {
483 // TODO(andresp): Find out why this fails with framerate = 7.5 481 // TODO(andresp): Find out why this fails with framerate = 7.5
484 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; 482 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}};
485 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); 483 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected));
486 } 484 }
487 } 485 }
488 } // namespace 486 } // namespace
489 } // namespace vcm 487 } // namespace vcm
490 } // namespace webrtc 488 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/video_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698