removed NetEq::EnableDtmf()
BUG=webrtc:1373
R=turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1822005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4492 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/neteq4/interface/neteq.h b/webrtc/modules/audio_coding/neteq4/interface/neteq.h
index 59e5bab..8905127 100644
--- a/webrtc/modules/audio_coding/neteq4/interface/neteq.h
+++ b/webrtc/modules/audio_coding/neteq4/interface/neteq.h
@@ -164,9 +164,6 @@
// Not implemented.
virtual int CurrentDelay() = 0;
- // Enables playout of DTMF tones.
- virtual int EnableDtmf() = 0;
-
// Sets the playout mode to |mode|.
virtual void SetPlayoutMode(NetEqPlayoutMode mode) = 0;
diff --git a/webrtc/modules/audio_coding/neteq4/neteq_impl.cc b/webrtc/modules/audio_coding/neteq4/neteq_impl.cc
index 98cc19c..8a286a0 100644
--- a/webrtc/modules/audio_coding/neteq4/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq4/neteq_impl.cc
@@ -85,7 +85,6 @@
current_cng_rtp_payload_type_(0xFF), // Invalid RTP payload type.
ssrc_(0),
first_packet_(true),
- dtmf_enabled_(true),
error_code_(0),
decoder_error_code_(0),
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) {
@@ -247,12 +246,6 @@
return false;
}
-int NetEqImpl::EnableDtmf() {
- CriticalSectionScoped lock(crit_sect_);
- dtmf_enabled_ = true;
- return kOK;
-}
-
void NetEqImpl::SetPlayoutMode(NetEqPlayoutMode mode) {
CriticalSectionScoped lock(crit_sect_);
if (!decision_logic_.get() || mode != decision_logic_->playout_mode()) {
@@ -448,24 +441,22 @@
assert(current_packet);
assert(current_packet->payload);
if (decoder_database_->IsDtmf(current_packet->header.payloadType)) {
- if (dtmf_enabled_) {
- DtmfEvent event;
- int ret = DtmfBuffer::ParseEvent(
- current_packet->header.timestamp,
- current_packet->payload,
- current_packet->payload_length,
- &event);
- if (ret != DtmfBuffer::kOK) {
- LOG_FERR2(LS_WARNING, ParseEvent, ret,
- current_packet->payload_length);
- PacketBuffer::DeleteAllPackets(&packet_list);
- return kDtmfParsingError;
- }
- if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) {
- LOG_FERR0(LS_WARNING, InsertEvent);
- PacketBuffer::DeleteAllPackets(&packet_list);
- return kDtmfInsertError;
- }
+ DtmfEvent event;
+ int ret = DtmfBuffer::ParseEvent(
+ current_packet->header.timestamp,
+ current_packet->payload,
+ current_packet->payload_length,
+ &event);
+ if (ret != DtmfBuffer::kOK) {
+ LOG_FERR2(LS_WARNING, ParseEvent, ret,
+ current_packet->payload_length);
+ PacketBuffer::DeleteAllPackets(&packet_list);
+ return kDtmfParsingError;
+ }
+ if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) {
+ LOG_FERR0(LS_WARNING, InsertEvent);
+ PacketBuffer::DeleteAllPackets(&packet_list);
+ return kDtmfInsertError;
}
// TODO(hlundin): Let the destructor of Packet handle the payload.
delete [] current_packet->payload;
diff --git a/webrtc/modules/audio_coding/neteq4/neteq_impl.h b/webrtc/modules/audio_coding/neteq4/neteq_impl.h
index cdc4164..e0e31ce 100644
--- a/webrtc/modules/audio_coding/neteq4/neteq_impl.h
+++ b/webrtc/modules/audio_coding/neteq4/neteq_impl.h
@@ -113,9 +113,6 @@
virtual int CurrentDelay() { return kNotImplemented; }
- // Enables playout of DTMF tones.
- virtual int EnableDtmf();
-
// Sets the playout mode to |mode|.
virtual void SetPlayoutMode(NetEqPlayoutMode mode);
@@ -316,7 +313,6 @@
uint8_t current_cng_rtp_payload_type_;
uint32_t ssrc_;
bool first_packet_;
- bool dtmf_enabled_;
int error_code_; // Store last error code.
int decoder_error_code_;
CriticalSectionWrapper* crit_sect_;
diff --git a/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc
index c5abdf7..491dc77 100644
--- a/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc
+++ b/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc
@@ -151,7 +151,6 @@
int sample_rate_hz = 16000;
NetEq* neteq = NetEq::Create(sample_rate_hz);
RegisterPayloadTypes(neteq);
- neteq->EnableDtmf();
// Read first packet.
NETEQTEST_RTPpacket *rtp;