Reland 8749: AudioEncoder: return EncodedInfo from Encode() and EncodeInternal()

Old review at:
https://webrtc-codereview.appspot.com/43839004/

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45769004

Cr-Commit-Position: refs/heads/master@{#8788}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8788 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jmarusic@webrtc.org
2015-03-19 08:50:26 +00:00
parent d21406d333
commit 9afaee74ab
22 changed files with 219 additions and 236 deletions

View File

@ -58,16 +58,15 @@ class AudioEncoder {
// Accepts one 10 ms block of input audio (i.e., sample_rate_hz() / 100 *
// num_channels() samples). Multi-channel audio must be sample-interleaved.
// The encoder produces zero or more bytes of output in |encoded|,
// and provides additional encoding information in |info|.
// The encoder produces zero or more bytes of output in |encoded| and
// returns additional encoding information.
// The caller is responsible for making sure that |max_encoded_bytes| is
// not smaller than the number of bytes actually produced by the encoder.
void Encode(uint32_t rtp_timestamp,
const int16_t* audio,
size_t num_samples_per_channel,
size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info);
EncodedInfo Encode(uint32_t rtp_timestamp,
const int16_t* audio,
size_t num_samples_per_channel,
size_t max_encoded_bytes,
uint8_t* encoded);
// Return the input sample rate in Hz and the number of input channels.
// These are constants set at instantiation time.
@ -107,11 +106,10 @@ class AudioEncoder {
virtual void SetProjectedPacketLossRate(double fraction) {}
protected:
virtual void EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info) = 0;
virtual EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded) = 0;
};
} // namespace webrtc