aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
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/g711/include/audio_encoder_pcm.h
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/g711/include/audio_encoder_pcm.h')
-rw-r--r--webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h b/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
index 3967c5e00d..e64bcea27e 100644
--- a/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
+++ b/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
@@ -34,6 +34,7 @@ class AudioEncoderPcm : public AudioEncoder {
int SampleRateHz() const override;
int NumChannels() const override;
+ size_t MaxEncodedBytes() const override;
int Num10MsFramesInNextPacket() const override;
int Max10MsFramesInAPacket() const override;
@@ -55,7 +56,7 @@ class AudioEncoderPcm : public AudioEncoder {
const int num_channels_;
const int payload_type_;
const int num_10ms_frames_per_packet_;
- const int16_t full_frame_samples_;
+ const size_t full_frame_samples_;
std::vector<int16_t> speech_buffer_;
uint32_t first_timestamp_in_buffer_;
};