Fix clang style warnings in webrtc/modules/audio_coding
Mostly this consists of marking functions with override when applicable, and moving function bodies from .h to .cc files. BUG=163 R=henrik.lundin@webrtc.org, tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44979004 Cr-Commit-Position: refs/heads/master@{#8938}
This commit is contained in:
parent
f6b7265c6b
commit
2519c45d00
@ -51,12 +51,6 @@ source_set("audio_coding") {
|
|||||||
":audio_coding_config",
|
":audio_coding_config",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_clang) {
|
|
||||||
# Suppress warnings from Chrome's Clang plugins.
|
|
||||||
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
|
||||||
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_win) {
|
if (is_win) {
|
||||||
cflags = [
|
cflags = [
|
||||||
# TODO(kjellander): Bug 261: fix this warning.
|
# TODO(kjellander): Bug 261: fix this warning.
|
||||||
|
@ -118,6 +118,8 @@ AudioDecoderProxy::AudioDecoderProxy()
|
|||||||
decoder_(nullptr) {
|
decoder_(nullptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioDecoderProxy::~AudioDecoderProxy() = default;
|
||||||
|
|
||||||
void AudioDecoderProxy::SetDecoder(AudioDecoder* decoder) {
|
void AudioDecoderProxy::SetDecoder(AudioDecoder* decoder) {
|
||||||
CriticalSectionScoped decoder_lock(decoder_lock_.get());
|
CriticalSectionScoped decoder_lock(decoder_lock_.get());
|
||||||
decoder_ = decoder;
|
decoder_ = decoder;
|
||||||
|
@ -45,6 +45,7 @@ class AcmReceiver;
|
|||||||
class AudioDecoderProxy final : public AudioDecoder {
|
class AudioDecoderProxy final : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderProxy();
|
AudioDecoderProxy();
|
||||||
|
~AudioDecoderProxy() override;
|
||||||
void SetDecoder(AudioDecoder* decoder);
|
void SetDecoder(AudioDecoder* decoder);
|
||||||
bool IsSet() const;
|
bool IsSet() const;
|
||||||
int Decode(const uint8_t* encoded,
|
int Decode(const uint8_t* encoded,
|
||||||
|
@ -94,6 +94,17 @@ bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioCoding::Config::Config()
|
||||||
|
: neteq_config(),
|
||||||
|
clock(Clock::GetRealTimeClock()),
|
||||||
|
transport(nullptr),
|
||||||
|
vad_callback(nullptr),
|
||||||
|
play_dtmf(true),
|
||||||
|
initial_playout_delay_ms(0),
|
||||||
|
playout_channels(1),
|
||||||
|
playout_frequency_hz(32000) {
|
||||||
|
}
|
||||||
|
|
||||||
AudioCoding* AudioCoding::Create(const Config& config) {
|
AudioCoding* AudioCoding::Create(const Config& config) {
|
||||||
return new AudioCodingImpl(config);
|
return new AudioCodingImpl(config);
|
||||||
}
|
}
|
||||||
|
@ -909,6 +909,14 @@ int AudioCodingModuleImpl::SetInitialPlayoutDelay(int delay_ms) {
|
|||||||
return receiver_.SetInitialDelay(delay_ms);
|
return receiver_.SetInitialDelay(delay_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int AudioCodingModuleImpl::SetDtmfPlayoutStatus(bool enable) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AudioCodingModuleImpl::DtmfPlayoutStatus() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioCodingModuleImpl::EnableNack(size_t max_nack_list_size) {
|
int AudioCodingModuleImpl::EnableNack(size_t max_nack_list_size) {
|
||||||
return receiver_.EnableNack(max_nack_list_size);
|
return receiver_.EnableNack(max_nack_list_size);
|
||||||
}
|
}
|
||||||
@ -933,6 +941,20 @@ void AudioCodingModuleImpl::GetDecodingCallStatistics(
|
|||||||
|
|
||||||
} // namespace acm2
|
} // namespace acm2
|
||||||
|
|
||||||
|
AudioCodingImpl::AudioCodingImpl(const Config& config) {
|
||||||
|
AudioCodingModule::Config config_old = config.ToOldConfig();
|
||||||
|
acm_old_.reset(new acm2::AudioCodingModuleImpl(config_old));
|
||||||
|
acm_old_->RegisterTransportCallback(config.transport);
|
||||||
|
acm_old_->RegisterVADCallback(config.vad_callback);
|
||||||
|
acm_old_->SetDtmfPlayoutStatus(config.play_dtmf);
|
||||||
|
if (config.initial_playout_delay_ms > 0) {
|
||||||
|
acm_old_->SetInitialPlayoutDelay(config.initial_playout_delay_ms);
|
||||||
|
}
|
||||||
|
playout_frequency_hz_ = config.playout_frequency_hz;
|
||||||
|
}
|
||||||
|
|
||||||
|
AudioCodingImpl::~AudioCodingImpl() = default;
|
||||||
|
|
||||||
bool AudioCodingImpl::RegisterSendCodec(AudioEncoder* send_codec) {
|
bool AudioCodingImpl::RegisterSendCodec(AudioEncoder* send_codec) {
|
||||||
FATAL() << "Not implemented yet.";
|
FATAL() << "Not implemented yet.";
|
||||||
return false;
|
return false;
|
||||||
|
@ -37,7 +37,7 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
|||||||
friend webrtc::AudioCodingImpl;
|
friend webrtc::AudioCodingImpl;
|
||||||
|
|
||||||
explicit AudioCodingModuleImpl(const AudioCodingModule::Config& config);
|
explicit AudioCodingModuleImpl(const AudioCodingModule::Config& config);
|
||||||
~AudioCodingModuleImpl();
|
~AudioCodingModuleImpl() override;
|
||||||
|
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
// Sender
|
// Sender
|
||||||
@ -168,10 +168,10 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
|||||||
//
|
//
|
||||||
// Configure Dtmf playout status i.e on/off playout the incoming outband Dtmf
|
// Configure Dtmf playout status i.e on/off playout the incoming outband Dtmf
|
||||||
// tone.
|
// tone.
|
||||||
int SetDtmfPlayoutStatus(bool enable) override { return 0; }
|
int SetDtmfPlayoutStatus(bool enable) override;
|
||||||
|
|
||||||
// Get Dtmf playout status.
|
// Get Dtmf playout status.
|
||||||
bool DtmfPlayoutStatus() const override { return true; }
|
bool DtmfPlayoutStatus() const override;
|
||||||
|
|
||||||
// Estimate the Bandwidth based on the incoming stream, needed
|
// Estimate the Bandwidth based on the incoming stream, needed
|
||||||
// for one way audio where the RTCP send the BW estimate.
|
// for one way audio where the RTCP send the BW estimate.
|
||||||
@ -314,19 +314,8 @@ class AudioCodingModuleImpl : public AudioCodingModule {
|
|||||||
|
|
||||||
class AudioCodingImpl : public AudioCoding {
|
class AudioCodingImpl : public AudioCoding {
|
||||||
public:
|
public:
|
||||||
AudioCodingImpl(const Config& config) {
|
AudioCodingImpl(const Config& config);
|
||||||
AudioCodingModule::Config config_old = config.ToOldConfig();
|
~AudioCodingImpl() override;
|
||||||
acm_old_.reset(new acm2::AudioCodingModuleImpl(config_old));
|
|
||||||
acm_old_->RegisterTransportCallback(config.transport);
|
|
||||||
acm_old_->RegisterVADCallback(config.vad_callback);
|
|
||||||
acm_old_->SetDtmfPlayoutStatus(config.play_dtmf);
|
|
||||||
if (config.initial_playout_delay_ms > 0) {
|
|
||||||
acm_old_->SetInitialPlayoutDelay(config.initial_playout_delay_ms);
|
|
||||||
}
|
|
||||||
playout_frequency_hz_ = config.playout_frequency_hz;
|
|
||||||
}
|
|
||||||
|
|
||||||
~AudioCodingImpl() override{};
|
|
||||||
|
|
||||||
bool RegisterSendCodec(AudioEncoder* send_codec) override;
|
bool RegisterSendCodec(AudioEncoder* send_codec) override;
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ Nack::Nack(int nack_threshold_packets)
|
|||||||
samples_per_packet_(sample_rate_khz_ * kDefaultPacketSizeMs),
|
samples_per_packet_(sample_rate_khz_ * kDefaultPacketSizeMs),
|
||||||
max_nack_list_size_(kNackListSizeLimit) {}
|
max_nack_list_size_(kNackListSizeLimit) {}
|
||||||
|
|
||||||
|
Nack::~Nack() = default;
|
||||||
|
|
||||||
Nack* Nack::Create(int nack_threshold_packets) {
|
Nack* Nack::Create(int nack_threshold_packets) {
|
||||||
return new Nack(nack_threshold_packets);
|
return new Nack(nack_threshold_packets);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class Nack {
|
|||||||
// Factory method.
|
// Factory method.
|
||||||
static Nack* Create(int nack_threshold_packets);
|
static Nack* Create(int nack_threshold_packets);
|
||||||
|
|
||||||
~Nack() {}
|
~Nack();
|
||||||
|
|
||||||
// Set a maximum for the size of the NACK list. If the last received packet
|
// Set a maximum for the size of the NACK list. If the last received packet
|
||||||
// has sequence number of N, then NACK list will not contain any element
|
// has sequence number of N, then NACK list will not contain any element
|
||||||
|
@ -997,15 +997,7 @@ class ReceiverInfo;
|
|||||||
class AudioCoding {
|
class AudioCoding {
|
||||||
public:
|
public:
|
||||||
struct Config {
|
struct Config {
|
||||||
Config()
|
Config();
|
||||||
: neteq_config(),
|
|
||||||
clock(Clock::GetRealTimeClock()),
|
|
||||||
transport(NULL),
|
|
||||||
vad_callback(NULL),
|
|
||||||
play_dtmf(true),
|
|
||||||
initial_playout_delay_ms(0),
|
|
||||||
playout_channels(1),
|
|
||||||
playout_frequency_hz(32000) {}
|
|
||||||
|
|
||||||
AudioCodingModule::Config ToOldConfig() const {
|
AudioCodingModule::Config ToOldConfig() const {
|
||||||
AudioCodingModule::Config old_config;
|
AudioCodingModule::Config old_config;
|
||||||
|
@ -38,6 +38,14 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// PCMu
|
// PCMu
|
||||||
|
|
||||||
|
int AudioDecoderPcmU::Init() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
size_t AudioDecoderPcmU::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderPcmU::DecodeInternal(const uint8_t* encoded,
|
int AudioDecoderPcmU::DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
@ -57,7 +65,19 @@ int AudioDecoderPcmU::PacketDuration(const uint8_t* encoded,
|
|||||||
return static_cast<int>(encoded_len / Channels());
|
return static_cast<int>(encoded_len / Channels());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderPcmUMultiCh::Channels() const {
|
||||||
|
return channels_;
|
||||||
|
}
|
||||||
|
|
||||||
// PCMa
|
// PCMa
|
||||||
|
|
||||||
|
int AudioDecoderPcmA::Init() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
size_t AudioDecoderPcmA::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderPcmA::DecodeInternal(const uint8_t* encoded,
|
int AudioDecoderPcmA::DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
@ -77,10 +97,21 @@ int AudioDecoderPcmA::PacketDuration(const uint8_t* encoded,
|
|||||||
return static_cast<int>(encoded_len / Channels());
|
return static_cast<int>(encoded_len / Channels());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderPcmAMultiCh::Channels() const {
|
||||||
|
return channels_;
|
||||||
|
}
|
||||||
|
|
||||||
// PCM16B
|
// PCM16B
|
||||||
#ifdef WEBRTC_CODEC_PCM16
|
#ifdef WEBRTC_CODEC_PCM16
|
||||||
AudioDecoderPcm16B::AudioDecoderPcm16B() {}
|
AudioDecoderPcm16B::AudioDecoderPcm16B() {}
|
||||||
|
|
||||||
|
int AudioDecoderPcm16B::Init() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
size_t AudioDecoderPcm16B::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderPcm16B::DecodeInternal(const uint8_t* encoded,
|
int AudioDecoderPcm16B::DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
@ -105,6 +136,10 @@ AudioDecoderPcm16BMultiCh::AudioDecoderPcm16BMultiCh(int num_channels)
|
|||||||
: channels_(num_channels) {
|
: channels_(num_channels) {
|
||||||
DCHECK(num_channels > 0);
|
DCHECK(num_channels > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderPcm16BMultiCh::Channels() const {
|
||||||
|
return channels_;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// iLBC
|
// iLBC
|
||||||
@ -117,6 +152,10 @@ AudioDecoderIlbc::~AudioDecoderIlbc() {
|
|||||||
WebRtcIlbcfix_DecoderFree(dec_state_);
|
WebRtcIlbcfix_DecoderFree(dec_state_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AudioDecoderIlbc::HasDecodePlc() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderIlbc::DecodeInternal(const uint8_t* encoded,
|
int AudioDecoderIlbc::DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
@ -138,6 +177,10 @@ int AudioDecoderIlbc::DecodePlc(int num_frames, int16_t* decoded) {
|
|||||||
int AudioDecoderIlbc::Init() {
|
int AudioDecoderIlbc::Init() {
|
||||||
return WebRtcIlbcfix_Decoderinit30Ms(dec_state_);
|
return WebRtcIlbcfix_Decoderinit30Ms(dec_state_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderIlbc::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// G.722
|
// G.722
|
||||||
@ -150,6 +193,10 @@ AudioDecoderG722::~AudioDecoderG722() {
|
|||||||
WebRtcG722_FreeDecoder(dec_state_);
|
WebRtcG722_FreeDecoder(dec_state_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AudioDecoderG722::HasDecodePlc() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderG722::DecodeInternal(const uint8_t* encoded,
|
int AudioDecoderG722::DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
@ -174,6 +221,10 @@ int AudioDecoderG722::PacketDuration(const uint8_t* encoded,
|
|||||||
return static_cast<int>(2 * encoded_len / Channels());
|
return static_cast<int>(2 * encoded_len / Channels());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderG722::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
AudioDecoderG722Stereo::AudioDecoderG722Stereo() {
|
AudioDecoderG722Stereo::AudioDecoderG722Stereo() {
|
||||||
WebRtcG722_CreateDecoder(&dec_state_left_);
|
WebRtcG722_CreateDecoder(&dec_state_left_);
|
||||||
WebRtcG722_CreateDecoder(&dec_state_right_);
|
WebRtcG722_CreateDecoder(&dec_state_right_);
|
||||||
@ -222,6 +273,10 @@ int AudioDecoderG722Stereo::DecodeInternal(const uint8_t* encoded,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderG722Stereo::Channels() const {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioDecoderG722Stereo::Init() {
|
int AudioDecoderG722Stereo::Init() {
|
||||||
int r = WebRtcG722_DecoderInit(dec_state_left_);
|
int r = WebRtcG722_DecoderInit(dec_state_left_);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
@ -332,6 +387,10 @@ bool AudioDecoderOpus::PacketHasFec(const uint8_t* encoded,
|
|||||||
fec = WebRtcOpus_PacketHasFec(encoded, static_cast<int>(encoded_len));
|
fec = WebRtcOpus_PacketHasFec(encoded, static_cast<int>(encoded_len));
|
||||||
return (fec == 1);
|
return (fec == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderOpus::Channels() const {
|
||||||
|
return channels_;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AudioDecoderCng::AudioDecoderCng() {
|
AudioDecoderCng::AudioDecoderCng() {
|
||||||
@ -346,6 +405,30 @@ int AudioDecoderCng::Init() {
|
|||||||
return WebRtcCng_InitDec(dec_state_);
|
return WebRtcCng_InitDec(dec_state_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int AudioDecoderCng::IncomingPacket(const uint8_t* payload,
|
||||||
|
size_t payload_len,
|
||||||
|
uint16_t rtp_sequence_number,
|
||||||
|
uint32_t rtp_timestamp,
|
||||||
|
uint32_t arrival_timestamp) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CNG_dec_inst* AudioDecoderCng::CngDecoderInstance() {
|
||||||
|
return dec_state_;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t AudioDecoderCng::Channels() const {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AudioDecoderCng::DecodeInternal(const uint8_t* encoded,
|
||||||
|
size_t encoded_len,
|
||||||
|
int sample_rate_hz,
|
||||||
|
int16_t* decoded,
|
||||||
|
SpeechType* speech_type) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
bool CodecSupported(NetEqDecoder codec_type) {
|
bool CodecSupported(NetEqDecoder codec_type) {
|
||||||
switch (codec_type) {
|
switch (codec_type) {
|
||||||
case kDecoderPCMu:
|
case kDecoderPCMu:
|
||||||
|
@ -37,9 +37,9 @@ namespace webrtc {
|
|||||||
class AudioDecoderPcmU : public AudioDecoder {
|
class AudioDecoderPcmU : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderPcmU() {}
|
AudioDecoderPcmU() {}
|
||||||
virtual int Init() { return 0; }
|
int Init() override;
|
||||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const;
|
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -55,9 +55,9 @@ class AudioDecoderPcmU : public AudioDecoder {
|
|||||||
class AudioDecoderPcmA : public AudioDecoder {
|
class AudioDecoderPcmA : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderPcmA() {}
|
AudioDecoderPcmA() {}
|
||||||
virtual int Init() { return 0; }
|
int Init() override;
|
||||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const;
|
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -76,7 +76,7 @@ class AudioDecoderPcmUMultiCh : public AudioDecoderPcmU {
|
|||||||
: AudioDecoderPcmU(), channels_(channels) {
|
: AudioDecoderPcmU(), channels_(channels) {
|
||||||
assert(channels > 0);
|
assert(channels > 0);
|
||||||
}
|
}
|
||||||
size_t Channels() const override { return channels_; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const size_t channels_;
|
const size_t channels_;
|
||||||
@ -89,7 +89,7 @@ class AudioDecoderPcmAMultiCh : public AudioDecoderPcmA {
|
|||||||
: AudioDecoderPcmA(), channels_(channels) {
|
: AudioDecoderPcmA(), channels_(channels) {
|
||||||
assert(channels > 0);
|
assert(channels > 0);
|
||||||
}
|
}
|
||||||
size_t Channels() const override { return channels_; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const size_t channels_;
|
const size_t channels_;
|
||||||
@ -102,9 +102,9 @@ class AudioDecoderPcmAMultiCh : public AudioDecoderPcmA {
|
|||||||
class AudioDecoderPcm16B : public AudioDecoder {
|
class AudioDecoderPcm16B : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderPcm16B();
|
AudioDecoderPcm16B();
|
||||||
virtual int Init() { return 0; }
|
int Init() override;
|
||||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const;
|
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -123,7 +123,7 @@ class AudioDecoderPcm16B : public AudioDecoder {
|
|||||||
class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B {
|
class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B {
|
||||||
public:
|
public:
|
||||||
explicit AudioDecoderPcm16BMultiCh(int num_channels);
|
explicit AudioDecoderPcm16BMultiCh(int num_channels);
|
||||||
size_t Channels() const override { return channels_; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const size_t channels_;
|
const size_t channels_;
|
||||||
@ -135,11 +135,11 @@ class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B {
|
|||||||
class AudioDecoderIlbc : public AudioDecoder {
|
class AudioDecoderIlbc : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderIlbc();
|
AudioDecoderIlbc();
|
||||||
virtual ~AudioDecoderIlbc();
|
~AudioDecoderIlbc() override;
|
||||||
virtual bool HasDecodePlc() const { return true; }
|
bool HasDecodePlc() const override;
|
||||||
virtual int DecodePlc(int num_frames, int16_t* decoded);
|
int DecodePlc(int num_frames, int16_t* decoded) override;
|
||||||
virtual int Init();
|
int Init() override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -158,11 +158,11 @@ class AudioDecoderIlbc : public AudioDecoder {
|
|||||||
class AudioDecoderG722 : public AudioDecoder {
|
class AudioDecoderG722 : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderG722();
|
AudioDecoderG722();
|
||||||
virtual ~AudioDecoderG722();
|
~AudioDecoderG722() override;
|
||||||
virtual bool HasDecodePlc() const { return false; }
|
bool HasDecodePlc() const override;
|
||||||
virtual int Init();
|
int Init() override;
|
||||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const;
|
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -179,8 +179,8 @@ class AudioDecoderG722 : public AudioDecoder {
|
|||||||
class AudioDecoderG722Stereo : public AudioDecoder {
|
class AudioDecoderG722Stereo : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
AudioDecoderG722Stereo();
|
AudioDecoderG722Stereo();
|
||||||
virtual ~AudioDecoderG722Stereo();
|
~AudioDecoderG722Stereo() override;
|
||||||
virtual int Init();
|
int Init() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -188,7 +188,7 @@ class AudioDecoderG722Stereo : public AudioDecoder {
|
|||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
int16_t* decoded,
|
int16_t* decoded,
|
||||||
SpeechType* speech_type) override;
|
SpeechType* speech_type) override;
|
||||||
size_t Channels() const override { return 2; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Splits the stereo-interleaved payload in |encoded| into separate payloads
|
// Splits the stereo-interleaved payload in |encoded| into separate payloads
|
||||||
@ -210,14 +210,14 @@ class AudioDecoderG722Stereo : public AudioDecoder {
|
|||||||
class AudioDecoderOpus : public AudioDecoder {
|
class AudioDecoderOpus : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
explicit AudioDecoderOpus(int num_channels);
|
explicit AudioDecoderOpus(int num_channels);
|
||||||
virtual ~AudioDecoderOpus();
|
~AudioDecoderOpus() override;
|
||||||
|
|
||||||
virtual int Init();
|
int Init() override;
|
||||||
virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const;
|
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
virtual int PacketDurationRedundant(const uint8_t* encoded,
|
int PacketDurationRedundant(const uint8_t* encoded,
|
||||||
size_t encoded_len) const;
|
size_t encoded_len) const override;
|
||||||
virtual bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const;
|
bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override;
|
||||||
size_t Channels() const override { return channels_; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
@ -247,25 +247,23 @@ class AudioDecoderOpus : public AudioDecoder {
|
|||||||
class AudioDecoderCng : public AudioDecoder {
|
class AudioDecoderCng : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
explicit AudioDecoderCng();
|
explicit AudioDecoderCng();
|
||||||
virtual ~AudioDecoderCng();
|
~AudioDecoderCng() override;
|
||||||
virtual int Init();
|
int Init() override;
|
||||||
virtual int IncomingPacket(const uint8_t* payload,
|
int IncomingPacket(const uint8_t* payload,
|
||||||
size_t payload_len,
|
size_t payload_len,
|
||||||
uint16_t rtp_sequence_number,
|
uint16_t rtp_sequence_number,
|
||||||
uint32_t rtp_timestamp,
|
uint32_t rtp_timestamp,
|
||||||
uint32_t arrival_timestamp) { return -1; }
|
uint32_t arrival_timestamp) override;
|
||||||
|
|
||||||
CNG_dec_inst* CngDecoderInstance() override { return dec_state_; }
|
CNG_dec_inst* CngDecoderInstance() override;
|
||||||
size_t Channels() const override { return 1; }
|
size_t Channels() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int DecodeInternal(const uint8_t* encoded,
|
int DecodeInternal(const uint8_t* encoded,
|
||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
int16_t* decoded,
|
int16_t* decoded,
|
||||||
SpeechType* speech_type) override {
|
SpeechType* speech_type) override;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CNG_dec_inst* dec_state_;
|
CNG_dec_inst* dec_state_;
|
||||||
|
@ -73,7 +73,7 @@ class RefCountedModule : public Module {
|
|||||||
virtual int32_t Release() = 0;
|
virtual int32_t Release() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~RefCountedModule() {}
|
~RefCountedModule() override = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user