We changed Encode() and EncodeInternal() return type from bool to void in this issue:

https://webrtc-codereview.appspot.com/38279004/
Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.

R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8749}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8749 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jmarusic@webrtc.org
2015-03-17 12:12:17 +00:00
parent 73d763e71f
commit 0cb612b43b
21 changed files with 222 additions and 237 deletions

View File

@ -56,11 +56,10 @@ class AudioEncoderCng final : public AudioEncoder {
void SetProjectedPacketLossRate(double fraction) override;
protected:
void EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info) override;
EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded) override;
private:
// Deleter for use with scoped_ptr. E.g., use as
@ -69,12 +68,8 @@ class AudioEncoderCng final : public AudioEncoder {
inline void operator()(CNG_enc_inst* ptr) const { WebRtcCng_FreeEnc(ptr); }
};
void EncodePassive(size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info);
void EncodeActive(size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info);
EncodedInfo EncodePassive(size_t max_encoded_bytes, uint8_t* encoded);
EncodedInfo EncodeActive(size_t max_encoded_bytes, uint8_t* encoded);
size_t SamplesPer10msFrame() const;
AudioEncoder* speech_encoder_;