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. // Not implemented.
virtual int CurrentDelay() = 0; virtual int CurrentDelay() = 0;
// Enables playout of DTMF tones.
virtual int EnableDtmf() = 0;
// Sets the playout mode to |mode|. // Sets the playout mode to |mode|.
virtual void SetPlayoutMode(NetEqPlayoutMode mode) = 0; 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. current_cng_rtp_payload_type_(0xFF), // Invalid RTP payload type.
ssrc_(0), ssrc_(0),
first_packet_(true), first_packet_(true),
dtmf_enabled_(true),
error_code_(0), error_code_(0),
decoder_error_code_(0), decoder_error_code_(0),
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) { crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) {
@@ -247,12 +246,6 @@ bool NetEqImpl::SetExtraDelay(int extra_delay_ms) {
return false; return false;
} }
int NetEqImpl::EnableDtmf() {
CriticalSectionScoped lock(crit_sect_);
dtmf_enabled_ = true;
return kOK;
}
void NetEqImpl::SetPlayoutMode(NetEqPlayoutMode mode) { void NetEqImpl::SetPlayoutMode(NetEqPlayoutMode mode) {
CriticalSectionScoped lock(crit_sect_); CriticalSectionScoped lock(crit_sect_);
if (!decision_logic_.get() || mode != decision_logic_->playout_mode()) { 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);
assert(current_packet->payload); assert(current_packet->payload);
if (decoder_database_->IsDtmf(current_packet->header.payloadType)) { if (decoder_database_->IsDtmf(current_packet->header.payloadType)) {
if (dtmf_enabled_) { DtmfEvent event;
DtmfEvent event; int ret = DtmfBuffer::ParseEvent(
int ret = DtmfBuffer::ParseEvent( current_packet->header.timestamp,
current_packet->header.timestamp, current_packet->payload,
current_packet->payload, current_packet->payload_length,
current_packet->payload_length, &event);
&event); if (ret != DtmfBuffer::kOK) {
if (ret != DtmfBuffer::kOK) { LOG_FERR2(LS_WARNING, ParseEvent, ret,
LOG_FERR2(LS_WARNING, ParseEvent, ret, current_packet->payload_length);
current_packet->payload_length); PacketBuffer::DeleteAllPackets(&packet_list);
PacketBuffer::DeleteAllPackets(&packet_list); return kDtmfParsingError;
return kDtmfParsingError; }
} if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) {
if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) { LOG_FERR0(LS_WARNING, InsertEvent);
LOG_FERR0(LS_WARNING, InsertEvent); PacketBuffer::DeleteAllPackets(&packet_list);
PacketBuffer::DeleteAllPackets(&packet_list); return kDtmfInsertError;
return kDtmfInsertError;
}
} }
// TODO(hlundin): Let the destructor of Packet handle the payload. // TODO(hlundin): Let the destructor of Packet handle the payload.
delete [] current_packet->payload; delete [] current_packet->payload;

View File

@@ -113,9 +113,6 @@ class NetEqImpl : public webrtc::NetEq {
virtual int CurrentDelay() { return kNotImplemented; } virtual int CurrentDelay() { return kNotImplemented; }
// Enables playout of DTMF tones.
virtual int EnableDtmf();
// Sets the playout mode to |mode|. // Sets the playout mode to |mode|.
virtual void SetPlayoutMode(NetEqPlayoutMode mode); virtual void SetPlayoutMode(NetEqPlayoutMode mode);
@@ -316,7 +313,6 @@ class NetEqImpl : public webrtc::NetEq {
uint8_t current_cng_rtp_payload_type_; uint8_t current_cng_rtp_payload_type_;
uint32_t ssrc_; uint32_t ssrc_;
bool first_packet_; bool first_packet_;
bool dtmf_enabled_;
int error_code_; // Store last error code. int error_code_; // Store last error code.
int decoder_error_code_; int decoder_error_code_;
CriticalSectionWrapper* crit_sect_; CriticalSectionWrapper* crit_sect_;

View File

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