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

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

Issue 1322973004: Fold AudioEncoderMutable into AudioEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: review fixes Created 5 years, 3 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 codec.pltype = payload_type; 58 codec.pltype = payload_type;
59 codec.pacsize = frame_size_samples; 59 codec.pacsize = frame_size_samples;
60 codec_registered_ = (acm_->RegisterSendCodec(codec) == 0); 60 codec_registered_ = (acm_->RegisterSendCodec(codec) == 0);
61 input_frame_.num_channels_ = channels; 61 input_frame_.num_channels_ = channels;
62 assert(input_block_size_samples_ * input_frame_.num_channels_ <= 62 assert(input_block_size_samples_ * input_frame_.num_channels_ <=
63 AudioFrame::kMaxDataSizeSamples); 63 AudioFrame::kMaxDataSizeSamples);
64 return codec_registered_; 64 return codec_registered_;
65 } 65 }
66 66
67 bool AcmSendTestOldApi::RegisterExternalCodec( 67 bool AcmSendTestOldApi::RegisterExternalCodec(
68 AudioEncoderMutable* external_speech_encoder) { 68 AudioEncoder* external_speech_encoder) {
69 acm_->RegisterExternalSendCodec(external_speech_encoder); 69 acm_->RegisterExternalSendCodec(external_speech_encoder);
70 input_frame_.num_channels_ = external_speech_encoder->NumChannels(); 70 input_frame_.num_channels_ = external_speech_encoder->NumChannels();
71 assert(input_block_size_samples_ * input_frame_.num_channels_ <= 71 assert(input_block_size_samples_ * input_frame_.num_channels_ <=
72 AudioFrame::kMaxDataSizeSamples); 72 AudioFrame::kMaxDataSizeSamples);
73 return codec_registered_ = true; 73 return codec_registered_ = true;
74 } 74 }
75 75
76 Packet* AcmSendTestOldApi::NextPacket() { 76 Packet* AcmSendTestOldApi::NextPacket() {
77 assert(codec_registered_); 77 assert(codec_registered_);
78 if (filter_.test(static_cast<size_t>(payload_type_))) { 78 if (filter_.test(static_cast<size_t>(payload_type_))) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 last_payload_vec_.size()); 148 last_payload_vec_.size());
149 Packet* packet = 149 Packet* packet =
150 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); 150 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds());
151 assert(packet); 151 assert(packet);
152 assert(packet->valid_header()); 152 assert(packet->valid_header());
153 return packet; 153 return packet;
154 } 154 }
155 155
156 } // namespace test 156 } // namespace test
157 } // namespace webrtc 157 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698