Add AudioEncoder::GetTargetBitrate

The GetTargetBitrate implementation will return the
target bitrate of the codec. This may differ from the
desired target bitrate, as set by SetTargetBitrate, depending on implementation.

Tests are updated to exercise the new functionality.

R=kwiberg@webrtc.org

Review URL: https://codereview.webrtc.org/1184313002.

Cr-Commit-Position: refs/heads/master@{#9461}
This commit is contained in:
Henrik Lundin
2015-06-18 14:58:34 +02:00
parent e9bdfd859c
commit 3e89dbf458
21 changed files with 185 additions and 10 deletions

View File

@ -29,6 +29,10 @@ int16_t AudioEncoderPcm16B::EncodeCall(const int16_t* audio,
return WebRtcPcm16b_Encode(audio, static_cast<int16_t>(input_len), encoded);
}
int AudioEncoderPcm16B::BytesPerSample() const {
return 2;
}
namespace {
AudioEncoderPcm16B::Config CreateConfig(const CodecInst& codec_inst) {
AudioEncoderPcm16B::Config config;

View File

@ -17,7 +17,7 @@
namespace webrtc {
class AudioEncoderPcm16B : public AudioEncoderPcm {
class AudioEncoderPcm16B final : public AudioEncoderPcm {
public:
struct Config : public AudioEncoderPcm::Config {
public:
@ -34,6 +34,8 @@ class AudioEncoderPcm16B : public AudioEncoderPcm {
int16_t EncodeCall(const int16_t* audio,
size_t input_len,
uint8_t* encoded) override;
int BytesPerSample() const override;
};
struct CodecInst;