diff options
author | Jason Long <jasonlon@google.com> | 2020-08-18 13:22:39 -0400 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-20 17:10:02 +0000 |
commit | a53472940efcc746964fc7755051a624673fe11c (patch) | |
tree | fcc78bfe05b89366800078a28babcf1660f173a4 /audio/voip/voip_core.h | |
parent | e64b3d0159db7ea40348f5f8900abb6c707d8669 (diff) | |
download | webrtc-a53472940efcc746964fc7755051a624673fe11c.tar.gz |
DTMF Event Sub-API on VoIP API
Added VoipDtmf in VoipEngine as a sub-API to provide DTMF related interfaces; also added relevant unit tests.
Bug: webrtc:11802
Change-Id: Ie9832aebe075a48ae1207be142361b73646673ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180225
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tim Na <natim@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Commit-Queue: Tim Na <natim@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31974}
Diffstat (limited to 'audio/voip/voip_core.h')
-rw-r--r-- | audio/voip/voip_core.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/audio/voip/voip_core.h b/audio/voip/voip_core.h index 22a6559981..6654ff7d95 100644 --- a/audio/voip/voip_core.h +++ b/audio/voip/voip_core.h @@ -23,6 +23,7 @@ #include "api/task_queue/task_queue_factory.h" #include "api/voip/voip_base.h" #include "api/voip/voip_codec.h" +#include "api/voip/voip_dtmf.h" #include "api/voip/voip_engine.h" #include "api/voip/voip_network.h" #include "audio/audio_transport_impl.h" @@ -45,7 +46,8 @@ namespace webrtc { class VoipCore : public VoipEngine, public VoipBase, public VoipNetwork, - public VoipCodec { + public VoipCodec, + public VoipDtmf { public: ~VoipCore() override = default; @@ -63,6 +65,7 @@ class VoipCore : public VoipEngine, VoipBase& Base() override { return *this; } VoipNetwork& Network() override { return *this; } VoipCodec& Codec() override { return *this; } + VoipDtmf& Dtmf() override { return *this; } // Implements VoipBase interfaces. absl::optional<ChannelId> CreateChannel( @@ -88,6 +91,14 @@ class VoipCore : public VoipEngine, ChannelId channel, const std::map<int, SdpAudioFormat>& decoder_specs) override; + // Implements VoipDtmf interfaces. + void RegisterTelephoneEventType(ChannelId channel, + int rtp_payload_type, + int sample_rate_hz) override; + bool SendDtmfEvent(ChannelId channel, + DtmfEvent dtmf_event, + int duration_ms) override; + private: // Fetches the corresponding AudioChannel assigned with given |channel|. // Returns nullptr if not found. |