Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc

Issue 1415163002: Removing AudioCoding class, a.k.a the new ACM API (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index 879af49bd235c7b2d5eaa19c49419ed6df69bdc5..467e749ccecd73609a83086bdee3d8e22774337b 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -803,287 +803,4 @@ void AudioCodingModuleImpl::GetDecodingCallStatistics(
}
} // 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);
- 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) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::RegisterSendCodec(int encoder_type,
- uint8_t payload_type,
- int frame_size_samples) {
- std::string codec_name;
- int sample_rate_hz;
- int channels;
- if (!MapCodecTypeToParameters(
- encoder_type, &codec_name, &sample_rate_hz, &channels)) {
- return false;
- }
- webrtc::CodecInst codec;
- AudioCodingModule::Codec(
- codec_name.c_str(), &codec, sample_rate_hz, channels);
- codec.pltype = payload_type;
- if (frame_size_samples > 0) {
- codec.pacsize = frame_size_samples;
- }
- return acm_old_->RegisterSendCodec(codec) == 0;
-}
-
-const AudioEncoder* AudioCodingImpl::GetSenderInfo() const {
- FATAL() << "Not implemented yet.";
- return reinterpret_cast<const AudioEncoder*>(NULL);
-}
-
-const CodecInst* AudioCodingImpl::GetSenderCodecInst() {
- if (acm_old_->SendCodec(&current_send_codec_) != 0) {
- return NULL;
- }
- return &current_send_codec_;
-}
-
-int AudioCodingImpl::Add10MsAudio(const AudioFrame& audio_frame) {
- acm2::AudioCodingModuleImpl::InputData input_data;
- CriticalSectionScoped lock(acm_old_->acm_crit_sect_.get());
- if (acm_old_->Add10MsDataInternal(audio_frame, &input_data) != 0)
- return -1;
- return acm_old_->Encode(input_data);
-}
-
-const ReceiverInfo* AudioCodingImpl::GetReceiverInfo() const {
- FATAL() << "Not implemented yet.";
- return reinterpret_cast<const ReceiverInfo*>(NULL);
-}
-
-bool AudioCodingImpl::RegisterReceiveCodec(AudioDecoder* receive_codec) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::RegisterReceiveCodec(int decoder_type,
- uint8_t payload_type) {
- std::string codec_name;
- int sample_rate_hz;
- int channels;
- if (!MapCodecTypeToParameters(
- decoder_type, &codec_name, &sample_rate_hz, &channels)) {
- return false;
- }
- webrtc::CodecInst codec;
- AudioCodingModule::Codec(
- codec_name.c_str(), &codec, sample_rate_hz, channels);
- codec.pltype = payload_type;
- return acm_old_->RegisterReceiveCodec(codec) == 0;
-}
-
-bool AudioCodingImpl::InsertPacket(const uint8_t* incoming_payload,
- size_t payload_len_bytes,
- const WebRtcRTPHeader& rtp_info) {
- return acm_old_->IncomingPacket(
- incoming_payload, payload_len_bytes, rtp_info) == 0;
-}
-
-bool AudioCodingImpl::InsertPayload(const uint8_t* incoming_payload,
- size_t payload_len_byte,
- uint8_t payload_type,
- uint32_t timestamp) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::SetMinimumPlayoutDelay(int time_ms) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::SetMaximumPlayoutDelay(int time_ms) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-int AudioCodingImpl::LeastRequiredDelayMs() const {
- FATAL() << "Not implemented yet.";
- return -1;
-}
-
-bool AudioCodingImpl::PlayoutTimestamp(uint32_t* timestamp) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::Get10MsAudio(AudioFrame* audio_frame) {
- return acm_old_->PlayoutData10Ms(playout_frequency_hz_, audio_frame) == 0;
-}
-
-bool AudioCodingImpl::GetNetworkStatistics(
- NetworkStatistics* network_statistics) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-bool AudioCodingImpl::EnableNack(size_t max_nack_list_size) {
- FATAL() << "Not implemented yet.";
- return false;
-}
-
-void AudioCodingImpl::DisableNack() {
- // A bug in the linker of Visual Studio 2013 Update 3 prevent us from using
- // FATAL() here, if we do so then the linker hang when the WPO is turned on.
- // TODO(sebmarchand): Re-evaluate this when we upgrade the toolchain.
-}
-
-bool AudioCodingImpl::SetVad(bool enable_dtx,
- bool enable_vad,
- ACMVADMode vad_mode) {
- return acm_old_->SetVAD(enable_dtx, enable_vad, vad_mode) == 0;
-}
-
-std::vector<uint16_t> AudioCodingImpl::GetNackList(
- int round_trip_time_ms) const {
- return acm_old_->GetNackList(round_trip_time_ms);
-}
-
-void AudioCodingImpl::GetDecodingCallStatistics(
- AudioDecodingCallStats* call_stats) const {
- acm_old_->GetDecodingCallStatistics(call_stats);
-}
-
-bool AudioCodingImpl::MapCodecTypeToParameters(int codec_type,
- std::string* codec_name,
- int* sample_rate_hz,
- int* channels) {
- switch (codec_type) {
- case acm2::ACMCodecDB::kPCM16B:
- *codec_name = "L16";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kPCM16Bwb:
- *codec_name = "L16";
- *sample_rate_hz = 16000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kPCM16Bswb32kHz:
- *codec_name = "L16";
- *sample_rate_hz = 32000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kPCM16B_2ch:
- *codec_name = "L16";
- *sample_rate_hz = 8000;
- *channels = 2;
- break;
- case acm2::ACMCodecDB::kPCM16Bwb_2ch:
- *codec_name = "L16";
- *sample_rate_hz = 16000;
- *channels = 2;
- break;
- case acm2::ACMCodecDB::kPCM16Bswb32kHz_2ch:
- *codec_name = "L16";
- *sample_rate_hz = 32000;
- *channels = 2;
- break;
-#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
- case acm2::ACMCodecDB::kISAC:
- *codec_name = "ISAC";
- *sample_rate_hz = 16000;
- *channels = 1;
- break;
-#endif
-#ifdef WEBRTC_CODEC_ISAC
- case acm2::ACMCodecDB::kISACSWB:
- *codec_name = "ISAC";
- *sample_rate_hz = 32000;
- *channels = 1;
- break;
-#endif
-#ifdef WEBRTC_CODEC_ILBC
- case acm2::ACMCodecDB::kILBC:
- *codec_name = "ILBC";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
-#endif
- case acm2::ACMCodecDB::kPCMA:
- *codec_name = "PCMA";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kPCMA_2ch:
- *codec_name = "PCMA";
- *sample_rate_hz = 8000;
- *channels = 2;
- break;
- case acm2::ACMCodecDB::kPCMU:
- *codec_name = "PCMU";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kPCMU_2ch:
- *codec_name = "PCMU";
- *sample_rate_hz = 8000;
- *channels = 2;
- break;
-#ifdef WEBRTC_CODEC_G722
- case acm2::ACMCodecDB::kG722:
- *codec_name = "G722";
- *sample_rate_hz = 16000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kG722_2ch:
- *codec_name = "G722";
- *sample_rate_hz = 16000;
- *channels = 2;
- break;
-#endif
-#ifdef WEBRTC_CODEC_OPUS
- case acm2::ACMCodecDB::kOpus:
- *codec_name = "opus";
- *sample_rate_hz = 48000;
- *channels = 2;
- break;
-#endif
- case acm2::ACMCodecDB::kCNNB:
- *codec_name = "CN";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kCNWB:
- *codec_name = "CN";
- *sample_rate_hz = 16000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kCNSWB:
- *codec_name = "CN";
- *sample_rate_hz = 32000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kRED:
- *codec_name = "red";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- case acm2::ACMCodecDB::kAVT:
- *codec_name = "telephone-event";
- *sample_rate_hz = 8000;
- *channels = 1;
- break;
- default:
- FATAL() << "Codec type " << codec_type << " not supported.";
- }
- return true;
-}
-
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698