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
This commit is contained in:
minyue@webrtc.org 2013-08-06 05:36:26 +00:00
parent 6e7c203aee
commit 9721db799c
4 changed files with 16 additions and 33 deletions

View File

@ -164,9 +164,6 @@ class NetEq {
// 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;

View File

@ -85,7 +85,6 @@ NetEqImpl::NetEqImpl(int fs,
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 @@ bool NetEqImpl::SetExtraDelay(int extra_delay_ms) {
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 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
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;

View File

@ -113,9 +113,6 @@ class NetEqImpl : public webrtc::NetEq {
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 @@ class NetEqImpl : public webrtc::NetEq {
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_;

View File

@ -151,7 +151,6 @@ int main(int argc, char* argv[]) {
int sample_rate_hz = 16000;
NetEq* neteq = NetEq::Create(sample_rate_hz);
RegisterPayloadTypes(neteq);
neteq->EnableDtmf();
// Read first packet.
NETEQTEST_RTPpacket *rtp;