diff options
author | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 03:08:32 +0000 |
---|---|---|
committer | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 03:08:32 +0000 |
commit | 42c8c0b74d77c7923e0afaad9aafbc5b823e2fe2 (patch) | |
tree | 8d1f640c88bf56d0f57af027b30db8873555bd75 /content/renderer/media/rtc_peer_connection_handler.cc | |
parent | b94584a231b160d2570cc38e78457fb852eb0c41 (diff) | |
download | chromium_src-42c8c0b74d77c7923e0afaad9aafbc5b823e2fe2.zip chromium_src-42c8c0b74d77c7923e0afaad9aafbc5b823e2fe2.tar.gz chromium_src-42c8c0b74d77c7923e0afaad9aafbc5b823e2fe2.tar.bz2 |
Glue code for DTMF sender.
Note: This cl is dependent on a libjingle roll and an updated WebKit version.
BUG=webrtc 1232
TEST=manual test with https://codereview.chromium.org/12041097/
Review URL: https://chromiumcodereview.appspot.com/11896100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media/rtc_peer_connection_handler.cc')
-rw-r--r-- | content/renderer/media/rtc_peer_connection_handler.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index 7d59112..e25c16d 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc @@ -14,10 +14,12 @@ #include "content/renderer/media/media_stream_dependency_factory.h" #include "content/renderer/media/peer_connection_tracker.h" #include "content/renderer/media/rtc_data_channel_handler.h" +#include "content/renderer/media/rtc_dtmf_sender_handler.h" #include "content/renderer/media/rtc_media_constraints.h" #include "content/renderer/render_thread_impl.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaConstraints.h" // TODO(hta): Move the following include to WebRTCStatsRequest.h file. +#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSource.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCConfiguration.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCICECandidate.h" @@ -581,6 +583,28 @@ WebKit::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( return new RtcDataChannelHandler(webrtc_channel); } +WebKit::WebRTCDTMFSenderHandler* RTCPeerConnectionHandler::createDTMFSender( + const WebKit::WebMediaStreamTrack& track) { + DVLOG(1) << "createDTMFSender."; + + if (track.source().type() != WebKit::WebMediaStreamSource::TypeAudio) { + DLOG(ERROR) << "Could not create DTMF sender from a non-audio track."; + return NULL; + } + + webrtc::AudioTrackInterface* audio_track = + static_cast<webrtc::AudioTrackInterface*>( + GetLocalNativeMediaStreamTrack(track.stream(), track)); + + talk_base::scoped_refptr<webrtc::DtmfSenderInterface> sender( + native_peer_connection_->CreateDtmfSender(audio_track)); + if (!sender) { + DLOG(ERROR) << "Could not create native DTMF sender."; + return NULL; + } + return new RtcDtmfSenderHandler(sender); +} + void RTCPeerConnectionHandler::stop() { DVLOG(1) << "RTCPeerConnectionHandler::stop"; native_peer_connection_ = NULL; |