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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc

Issue 1423043005: Remove ACMCodecDB::Codec, and make the rest of ACMCodecDB private (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac3
Patch Set: rebase Created 5 years, 1 month 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 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 rtp_header_.header.ssrc = 0x12345678; // Arbitrary. 81 rtp_header_.header.ssrc = 0x12345678; // Arbitrary.
82 rtp_header_.header.numCSRCs = 0; 82 rtp_header_.header.numCSRCs = 0;
83 rtp_header_.header.payloadType = 0; 83 rtp_header_.header.payloadType = 0;
84 rtp_header_.frameType = kAudioFrameSpeech; 84 rtp_header_.frameType = kAudioFrameSpeech;
85 rtp_header_.type.Audio.isCNG = false; 85 rtp_header_.type.Audio.isCNG = false;
86 } 86 }
87 87
88 void TearDown() override {} 88 void TearDown() override {}
89 89
90 void InsertOnePacketOfSilence(int codec_id) { 90 void InsertOnePacketOfSilence(int codec_id) {
91 CodecInst codec; 91 CodecInst codec =
92 ACMCodecDB::Codec(codec_id, &codec); 92 *RentACodec::CodecInstById(*RentACodec::CodecIdFromIndex(codec_id));
93 if (timestamp_ == 0) { // This is the first time inserting audio. 93 if (timestamp_ == 0) { // This is the first time inserting audio.
94 ASSERT_EQ(0, acm_->RegisterSendCodec(codec)); 94 ASSERT_EQ(0, acm_->RegisterSendCodec(codec));
95 } else { 95 } else {
96 auto current_codec = acm_->SendCodec(); 96 auto current_codec = acm_->SendCodec();
97 ASSERT_TRUE(current_codec); 97 ASSERT_TRUE(current_codec);
98 if (!CodecsEqual(codec, *current_codec)) 98 if (!CodecsEqual(codec, *current_codec))
99 ASSERT_EQ(0, acm_->RegisterSendCodec(codec)); 99 ASSERT_EQ(0, acm_->RegisterSendCodec(codec));
100 } 100 }
101 AudioFrame frame; 101 AudioFrame frame;
102 // Frame setup according to the codec. 102 // Frame setup according to the codec.
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 EXPECT_EQ(c.id, receiver_->last_audio_codec_id()); 360 EXPECT_EQ(c.id, receiver_->last_audio_codec_id());
361 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); 361 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec));
362 EXPECT_TRUE(CodecsEqual(c.inst, codec)); 362 EXPECT_TRUE(CodecsEqual(c.inst, codec));
363 } 363 }
364 } 364 }
365 365
366 } // namespace acm2 366 } // namespace acm2
367 367
368 } // namespace webrtc 368 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc ('k') | webrtc/modules/audio_coding/main/acm2/codec_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698