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 ff61db8e8d00c07cda36c31a440aac6e833d7eb8..d850675244baf5060defd24d1b5e3f39c0780afe 100644 |
--- a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
+++ b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
@@ -80,8 +80,7 @@ int AudioEncoderPcm::GetTargetBitrate() const { |
AudioEncoder::EncodedInfo AudioEncoderPcm::EncodeInternal( |
uint32_t rtp_timestamp, |
rtc::ArrayView<const int16_t> audio, |
- size_t max_encoded_bytes, |
- uint8_t* encoded) { |
+ rtc::Buffer* encoded) { |
if (speech_buffer_.empty()) { |
first_timestamp_in_buffer_ = rtp_timestamp; |
} |
@@ -90,12 +89,16 @@ AudioEncoder::EncodedInfo AudioEncoderPcm::EncodeInternal( |
return EncodedInfo(); |
} |
RTC_CHECK_EQ(speech_buffer_.size(), full_frame_samples_); |
- RTC_CHECK_GE(max_encoded_bytes, full_frame_samples_); |
EncodedInfo info; |
info.encoded_timestamp = first_timestamp_in_buffer_; |
info.payload_type = payload_type_; |
info.encoded_bytes = |
- EncodeCall(&speech_buffer_[0], full_frame_samples_, encoded); |
+ encoded->AppendData(MaxEncodedBytes(), |
+ [&] (rtc::ArrayView<uint8_t> encoded) { |
+ return EncodeCall(&speech_buffer_[0], |
+ full_frame_samples_, |
+ encoded.data()); |
kwiberg-webrtc
2016/02/25 00:29:04
Wouldn't it be better to change EncodeCall to also
ossu
2016/02/25 10:39:51
I thought about it but decided that EncodeCall is
kwiberg-webrtc
2016/02/25 12:24:25
It will stop making sense when you have to keep th
kwiberg-webrtc
2016/02/27 19:21:46
You never answered this one.
ossu
2016/02/29 08:51:23
It wasn't a question. Also, I didn't understand it
kwiberg-webrtc
2016/02/29 11:42:47
Well, to call AppendData you need *some* encoder-s
ossu
2016/02/29 11:56:52
Ah, right! I think that's already in place in the
|
+ }); |
speech_buffer_.clear(); |
return info; |
} |