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

Side by Side Diff: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc

Issue 1764583003: Renamed new EncodeInternal to EncodeImpl to ensure proper backwards compatibility. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Clarified doc comments in AudioEncoder. Created 4 years, 9 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 size_t AudioEncoderPcm::Max10MsFramesInAPacket() const { 71 size_t AudioEncoderPcm::Max10MsFramesInAPacket() const {
72 return num_10ms_frames_per_packet_; 72 return num_10ms_frames_per_packet_;
73 } 73 }
74 74
75 int AudioEncoderPcm::GetTargetBitrate() const { 75 int AudioEncoderPcm::GetTargetBitrate() const {
76 return static_cast<int>( 76 return static_cast<int>(
77 8 * BytesPerSample() * SampleRateHz() * NumChannels()); 77 8 * BytesPerSample() * SampleRateHz() * NumChannels());
78 } 78 }
79 79
80 AudioEncoder::EncodedInfo AudioEncoderPcm::EncodeInternal( 80 AudioEncoder::EncodedInfo AudioEncoderPcm::EncodeImpl(
81 uint32_t rtp_timestamp, 81 uint32_t rtp_timestamp,
82 rtc::ArrayView<const int16_t> audio, 82 rtc::ArrayView<const int16_t> audio,
83 rtc::Buffer* encoded) { 83 rtc::Buffer* encoded) {
84 if (speech_buffer_.empty()) { 84 if (speech_buffer_.empty()) {
85 first_timestamp_in_buffer_ = rtp_timestamp; 85 first_timestamp_in_buffer_ = rtp_timestamp;
86 } 86 }
87 speech_buffer_.insert(speech_buffer_.end(), audio.begin(), audio.end()); 87 speech_buffer_.insert(speech_buffer_.end(), audio.begin(), audio.end());
88 if (speech_buffer_.size() < full_frame_samples_) { 88 if (speech_buffer_.size() < full_frame_samples_) {
89 return EncodedInfo(); 89 return EncodedInfo();
90 } 90 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 size_t input_len, 127 size_t input_len,
128 uint8_t* encoded) { 128 uint8_t* encoded) {
129 return WebRtcG711_EncodeU(audio, input_len, encoded); 129 return WebRtcG711_EncodeU(audio, input_len, encoded);
130 } 130 }
131 131
132 size_t AudioEncoderPcmU::BytesPerSample() const { 132 size_t AudioEncoderPcmU::BytesPerSample() const {
133 return 1; 133 return 1;
134 } 134 }
135 135
136 } // namespace webrtc 136 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698