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

Unified Diff: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc

Issue 1883543002: Revert of Remove the deprecated EncodeInternal interface from AudioEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
diff --git a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
index e4da8d7440bc5520342474ca6e9a9360f885c9bc..a24b1526fd23777a5bb674fafe7bbb533066163f 100644
--- a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
+++ b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
@@ -52,6 +52,10 @@
AudioEncoderPcm::~AudioEncoderPcm() = default;
+size_t AudioEncoderPcm::MaxEncodedBytes() const {
+ return full_frame_samples_ * BytesPerSample();
+}
+
int AudioEncoderPcm::SampleRateHz() const {
return sample_rate_hz_;
}
@@ -89,7 +93,7 @@
info.encoded_timestamp = first_timestamp_in_buffer_;
info.payload_type = payload_type_;
info.encoded_bytes =
- encoded->AppendData(full_frame_samples_ * BytesPerSample(),
+ encoded->AppendData(MaxEncodedBytes(),
[&] (rtc::ArrayView<uint8_t> encoded) {
return EncodeCall(&speech_buffer_[0],
full_frame_samples_,

Powered by Google App Engine
This is Rietveld 408576698