Remove unnecessary interface TelephoneEventHandler.

BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2357583002
Cr-Commit-Position: refs/heads/master@{#14346}
This commit is contained in:
solenberg
2016-09-22 01:46:03 -07:00
committed by Commit bot
parent 6f5a6c3188
commit 2beb42983c
10 changed files with 2 additions and 65 deletions

View File

@ -18,21 +18,6 @@ namespace webrtc {
class RTPPayloadRegistry;
class TelephoneEventHandler {
public:
virtual ~TelephoneEventHandler() {}
// The following three methods implement the TelephoneEventHandler interface.
// Forward DTMFs to decoder for playout.
virtual void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) = 0;
// Is forwarding of outband telephone events turned on/off?
virtual bool TelephoneEventForwardToDecoder() const = 0;
// Is TelephoneEvent configured with payload type payload_type
virtual bool TelephoneEventPayloadType(const int8_t payload_type) const = 0;
};
class RtpReceiver {
public:
// Creates a video-enabled RTP receiver.
@ -51,9 +36,6 @@ class RtpReceiver {
virtual ~RtpReceiver() {}
// Returns a TelephoneEventHandler if available.
virtual TelephoneEventHandler* GetTelephoneEventHandler() = 0;
// Registers a receive payload in the payload registry and notifies the media
// receiver strategy.
virtual int32_t RegisterReceivePayload(

View File

@ -25,9 +25,7 @@ RTPReceiverStrategy* RTPReceiverStrategy::CreateAudioStrategy(
RTPReceiverAudio::RTPReceiverAudio(RtpData* data_callback)
: RTPReceiverStrategy(data_callback),
TelephoneEventHandler(),
last_received_frequency_(8000),
telephone_event_forward_to_decoder_(false),
telephone_event_payload_type_(-1),
cng_nb_payload_type_(-1),
cng_wb_payload_type_(-1),
@ -42,19 +40,6 @@ RTPReceiverAudio::RTPReceiverAudio(RtpData* data_callback)
memset(current_remote_energy_, 0, sizeof(current_remote_energy_));
}
// Outband TelephoneEvent(DTMF) detection
void RTPReceiverAudio::SetTelephoneEventForwardToDecoder(
bool forward_to_decoder) {
rtc::CritScope lock(&crit_sect_);
telephone_event_forward_to_decoder_ = forward_to_decoder;
}
// Is forwarding of outband telephone events turned on/off?
bool RTPReceiverAudio::TelephoneEventForwardToDecoder() const {
rtc::CritScope lock(&crit_sect_);
return telephone_event_forward_to_decoder_;
}
bool RTPReceiverAudio::TelephoneEventPayloadType(
int8_t payload_type) const {
rtc::CritScope lock(&crit_sect_);
@ -356,10 +341,6 @@ int32_t RTPReceiverAudio::ParseAudioCodecSpecific(
// check if it's a DTMF event, hence something we can playout
if (telephone_event_packet) {
if (!telephone_event_forward_to_decoder_) {
// don't forward event to decoder
return 0;
}
std::set<uint8_t>::iterator first =
telephone_event_reported_.begin();
if (first != telephone_event_reported_.end() && *first > 15) {

View File

@ -23,23 +23,13 @@
namespace webrtc {
// Handles audio RTP packets. This class is thread-safe.
class RTPReceiverAudio : public RTPReceiverStrategy,
public TelephoneEventHandler {
class RTPReceiverAudio : public RTPReceiverStrategy {
public:
explicit RTPReceiverAudio(RtpData* data_callback);
virtual ~RTPReceiverAudio() {}
// The following three methods implement the TelephoneEventHandler interface.
// Forward DTMFs to decoder for playout.
void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) override;
// Is forwarding of outband telephone events turned on/off?
bool TelephoneEventForwardToDecoder() const override;
// Is TelephoneEvent configured with payload type payload_type
bool TelephoneEventPayloadType(const int8_t payload_type) const override;
TelephoneEventHandler* GetTelephoneEventHandler() override { return this; }
bool TelephoneEventPayloadType(const int8_t payload_type) const;
// Returns true if CNG is configured with payload type payload_type. If so,
// the frequency and cng_payload_type_has_changed are filled in.

View File

@ -200,10 +200,6 @@ bool RtpReceiverImpl::IncomingRtpPacket(
return true;
}
TelephoneEventHandler* RtpReceiverImpl::GetTelephoneEventHandler() {
return rtp_media_receiver_->GetTelephoneEventHandler();
}
bool RtpReceiverImpl::Timestamp(uint32_t* timestamp) const {
rtc::CritScope lock(&critical_section_rtp_receiver_);
if (!HaveReceivedFrame())

View File

@ -57,8 +57,6 @@ class RtpReceiverImpl : public RtpReceiver {
int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override;
TelephoneEventHandler* GetTelephoneEventHandler() override;
private:
bool HaveReceivedFrame() const;

View File

@ -44,8 +44,6 @@ class RTPReceiverStrategy {
int64_t timestamp_ms,
bool is_first_packet) = 0;
virtual TelephoneEventHandler* GetTelephoneEventHandler() = 0;
// Retrieves the last known applicable frequency.
virtual int GetPayloadTypeFrequency() const = 0;

View File

@ -33,8 +33,6 @@ class RTPReceiverVideo : public RTPReceiverStrategy {
int64_t timestamp,
bool is_first_packet) override;
TelephoneEventHandler* GetTelephoneEventHandler() override { return NULL; }
int GetPayloadTypeFrequency() const override;
RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const override;

View File

@ -162,9 +162,6 @@ TEST_F(RtpRtcpAudioTest, Basic) {
module1->SetSSRC(test_ssrc);
module1->SetStartTimestamp(test_timestamp);
// Test detection at the end of a DTMF tone.
// EXPECT_EQ(0, module2->SetTelephoneEventForwardToDecoder(true));
EXPECT_EQ(0, module1->SetSendingStatus(true));
// Start basic RTP test.

View File

@ -809,7 +809,6 @@ Channel::Channel(int32_t channelId,
this,
this,
rtp_payload_registry_.get())),
telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()),
_outputAudioLevel(),
_externalTransport(false),
// Avoid conflict with other channels by adding 1024 - 1026,
@ -979,7 +978,6 @@ int32_t Channel::Init() {
// disabled by the user.
// After StopListen (when no sockets exists), RTCP packets will no longer
// be transmitted since the Transport object will then be invalid.
telephone_event_handler_->SetTelephoneEventForwardToDecoder(true);
// RTCP is enabled by default.
_rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
// --- Register all permanent callbacks

View File

@ -458,7 +458,6 @@ class Channel
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
std::unique_ptr<StatisticsProxy> statistics_proxy_;
std::unique_ptr<RtpReceiver> rtp_receiver_;
TelephoneEventHandler* telephone_event_handler_;
std::unique_ptr<RtpRtcp> _rtpRtcpModule;
std::unique_ptr<AudioCodingModule> audio_coding_;
acm2::CodecManager codec_manager_;