aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
diff options
context:
space:
mode:
authorjmarusic@webrtc.org <jmarusic@webrtc.org>2015-03-10 15:41:26 +0000
committerjmarusic@webrtc.org <jmarusic@webrtc.org>2015-03-10 15:42:21 +0000
commit51ccf376387266225cd8c78e63238b725860f0af (patch)
tree685f8abc2ec4711bd60021944abd5fa9f31a2431 /webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
parentd7452a016812ab1de69c3d7a53caca5b06c64990 (diff)
downloadwebrtc-51ccf376387266225cd8c78e63238b725860f0af.tar.gz
AudioEncoder: add method MaxEncodedBytes
Added method AudioEncoder::MaxEncodedBytes() and provided implementations in derived encoders. This method returns the number of bytes that can be produced by the encoder at each Encode() call. Unit tests were updated to use the new method. Buffer allocation was not changed in AudioCodingModuleImpl::Encode(). It will be done after additional investigation. Other refactoring work that was done, that may not be obvious why: 1. Moved some code into AudioEncoderCng::EncodePassive() to make it more consistent with EncodeActive(). 2. Changed the order of NumChannels() and RtpTimestampRateHz() declarations in AudioEncoderG722 and AudioEncoderCopyRed classes. It just bothered me that the order was not the same as in AudioEncoder class and its other derived classes. R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/40259005 Cr-Commit-Position: refs/heads/master@{#8671} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8671 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc')
-rw-r--r--webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
index 92e1c0b371..28c72fb3bb 100644
--- a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
+++ b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
@@ -38,6 +38,10 @@ int AudioEncoderCopyRed::NumChannels() const {
return speech_encoder_->NumChannels();
}
+size_t AudioEncoderCopyRed::MaxEncodedBytes() const {
+ return 2 * speech_encoder_->MaxEncodedBytes();
+}
+
int AudioEncoderCopyRed::Num10MsFramesInNextPacket() const {
return speech_encoder_->Num10MsFramesInNextPacket();
}