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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2055493003: Voice Engine: Remove RED support (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@remove-red0
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/voe_rtp_rtcp_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index a17f546f4ed7a6f7b4b59c75e22fb1b0afa62200..16b4abb0362028fe268e9da593f22ee185e548d5 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -1028,18 +1028,6 @@ int32_t Channel::Init() {
codec.pltype, codec.plfreq);
}
}
-#ifdef WEBRTC_CODEC_RED
- // Register RED to the receiving side of the ACM.
- // We will not receive an OnInitializeDecoder() callback for RED.
- if (!STR_CASE_CMP(codec.plname, "RED")) {
- if (!RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, codec)) {
- WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
- "Channel::Init() failed to register RED (%d/%d) "
- "correctly",
- codec.pltype, codec.plfreq);
- }
- }
-#endif
}
if (rx_audioproc_->noise_suppression()->set_level(kDefaultNsMode) != 0) {
@@ -2874,53 +2862,6 @@ int Channel::GetRTPStatistics(CallStatistics& stats) {
return 0;
}
-int Channel::SetREDStatus(bool enable, int redPayloadtype) {
- WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
- "Channel::SetREDStatus()");
-
- if (enable) {
- if (redPayloadtype < 0 || redPayloadtype > 127) {
- _engineStatisticsPtr->SetLastError(
- VE_PLTYPE_ERROR, kTraceError,
- "SetREDStatus() invalid RED payload type");
- return -1;
- }
-
- if (SetRedPayloadType(redPayloadtype) < 0) {
- _engineStatisticsPtr->SetLastError(
- VE_CODEC_ERROR, kTraceError,
- "SetSecondarySendCodec() Failed to register RED ACM");
- return -1;
- }
- }
-
- if (!codec_manager_.SetCopyRed(enable) ||
- !codec_manager_.MakeEncoder(&rent_a_codec_, audio_coding_.get())) {
- _engineStatisticsPtr->SetLastError(
- VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
- "SetREDStatus() failed to set RED state in the ACM");
- return -1;
- }
- return 0;
-}
-
-int Channel::GetREDStatus(bool& enabled, int& redPayloadtype) {
- enabled = codec_manager_.GetStackParams()->use_red;
- if (enabled) {
- int8_t payloadType = 0;
- if (_rtpRtcpModule->SendREDPayloadType(&payloadType) != 0) {
- _engineStatisticsPtr->SetLastError(
- VE_RTP_RTCP_MODULE_ERROR, kTraceError,
- "GetREDStatus() failed to retrieve RED PT from RTP/RTCP "
- "module");
- return -1;
- }
- redPayloadtype = payloadType;
- return 0;
- }
- return 0;
-}
-
int Channel::SetCodecFECStatus(bool enable) {
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::SetCodecFECStatus()");
@@ -3461,46 +3402,6 @@ void Channel::RegisterReceiveCodecsToRTPModule() {
}
}
-// Assuming this method is called with valid payload type.
-int Channel::SetRedPayloadType(int red_payload_type) {
- CodecInst codec;
- bool found_red = false;
-
- // Get default RED settings from the ACM database
- const int num_codecs = AudioCodingModule::NumberOfCodecs();
- for (int idx = 0; idx < num_codecs; idx++) {
- audio_coding_->Codec(idx, &codec);
- if (!STR_CASE_CMP(codec.plname, "RED")) {
- found_red = true;
- break;
- }
- }
-
- if (!found_red) {
- _engineStatisticsPtr->SetLastError(
- VE_CODEC_ERROR, kTraceError,
- "SetRedPayloadType() RED is not supported");
- return -1;
- }
-
- codec.pltype = red_payload_type;
- if (!codec_manager_.RegisterEncoder(codec) ||
- !codec_manager_.MakeEncoder(&rent_a_codec_, audio_coding_.get())) {
- _engineStatisticsPtr->SetLastError(
- VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
- "SetRedPayloadType() RED registration in ACM module failed");
- return -1;
- }
-
- if (_rtpRtcpModule->SetSendREDPayloadType(red_payload_type) != 0) {
- _engineStatisticsPtr->SetLastError(
- VE_RTP_RTCP_MODULE_ERROR, kTraceError,
- "SetRedPayloadType() RED registration in RTP/RTCP module failed");
- return -1;
- }
- return 0;
-}
-
int Channel::SetSendRtpHeaderExtension(bool enable,
RTPExtensionType type,
unsigned char id) {
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/voe_rtp_rtcp_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698