Add new methods to AudioEncoder interface

The following three methods are added:
rtp_timestamp_rate_hz()
SetTargetBitrate()
SetProjectedPacketLossRate()

Default implementations are provided, and a few overrides are
implemented. AudioEncoderCopyRed and AudioEncoderCng propagate the new
methods to the underlying speech codec.

BUG=3926
COAUTHOR:kwiberg@webrtc.org

R=tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8171}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8171 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2015-01-27 18:24:45 +00:00
parent 5614cf16e7
commit 478cedc055
19 changed files with 175 additions and 30 deletions

View File

@ -84,7 +84,7 @@ class AudioEncoderDecoderIsacT : public AudioEncoder, public AudioDecoder {
protected:
// AudioEncoder protected method.
virtual bool EncodeInternal(uint32_t timestamp,
virtual bool EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded,

View File

@ -120,7 +120,7 @@ int AudioEncoderDecoderIsacT<T>::Max10MsFramesInAPacket() const {
}
template <typename T>
bool AudioEncoderDecoderIsacT<T>::EncodeInternal(uint32_t timestamp,
bool AudioEncoderDecoderIsacT<T>::EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded,
@ -128,7 +128,7 @@ bool AudioEncoderDecoderIsacT<T>::EncodeInternal(uint32_t timestamp,
if (!packet_in_progress_) {
// Starting a new packet; remember the timestamp for later.
packet_in_progress_ = true;
packet_timestamp_ = timestamp;
packet_timestamp_ = rtp_timestamp;
}
int r;
{