Also provide sample rate when registering decoders

This replaces the old practice of looking up the sample rate in a
table, which won't work when we add support for external decoders.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4474
R=jmarusic@webrtc.org, minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9276}
This commit is contained in:
Karl Wiberg
2015-05-25 14:39:56 +02:00
parent 323b132f5e
commit d8399e630f
10 changed files with 75 additions and 51 deletions

View File

@ -117,11 +117,12 @@ class NetEqImpl : public webrtc::NetEq {
// Provides an externally created decoder object |decoder| to insert in the
// decoder database. The decoder implements a decoder of type |codec| and
// associates it with |rtp_payload_type|. Returns kOK on success, kFail on
// failure.
// associates it with |rtp_payload_type|. The decoder will produce samples
// at the rate |sample_rate_hz|. Returns kOK on success, kFail on failure.
int RegisterExternalDecoder(AudioDecoder* decoder,
enum NetEqDecoder codec,
uint8_t rtp_payload_type) override;
uint8_t rtp_payload_type,
int sample_rate_hz) override;
// Removes |rtp_payload_type| from the codec database. Returns 0 on success,
// -1 on failure.