Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1325023005: Remove Channel::SetRingbackTone() and Channel::PlayRingbackTone(), and the code beneath it (within … (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | talk/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvoiceengine.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
index d0eb4aea24b881f609005d8a7eaa1196fd839288..642fd3d233e649ecbcb989a85391176b1761e0dc 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/talk/media/webrtc/webrtcvoiceengine.cc
@@ -2860,53 +2860,6 @@ bool WebRtcVoiceMediaChannel::SetOutputScaling(
return true;
}
-bool WebRtcVoiceMediaChannel::SetRingbackTone(const char *buf, int len) {
- ringback_tone_.reset(new WebRtcSoundclipStream(buf, len));
- return true;
-}
-
-bool WebRtcVoiceMediaChannel::PlayRingbackTone(uint32 ssrc,
- bool play, bool loop) {
- if (!ringback_tone_) {
- return false;
- }
-
- // The voe file api is not available in chrome.
- if (!engine()->voe()->file()) {
- return false;
- }
-
- // Determine which VoiceEngine channel to play on.
- int channel = (ssrc == 0) ? voe_channel() : GetReceiveChannelNum(ssrc);
- if (channel == -1) {
- return false;
- }
-
- // Make sure the ringtone is cued properly, and play it out.
- if (play) {
- ringback_tone_->set_loop(loop);
- ringback_tone_->Rewind();
- if (engine()->voe()->file()->StartPlayingFileLocally(channel,
- ringback_tone_.get()) == -1) {
- LOG_RTCERR2(StartPlayingFileLocally, channel, ringback_tone_.get());
- LOG(LS_ERROR) << "Unable to start ringback tone";
- return false;
- }
- ringback_channels_.insert(channel);
- LOG(LS_INFO) << "Started ringback on channel " << channel;
- } else {
- if (engine()->voe()->file()->IsPlayingFileLocally(channel) == 1 &&
- engine()->voe()->file()->StopPlayingFileLocally(channel) == -1) {
- LOG_RTCERR1(StopPlayingFileLocally, channel);
- return false;
- }
- LOG(LS_INFO) << "Stopped ringback on channel " << channel;
- ringback_channels_.erase(channel);
- }
-
- return true;
-}
-
bool WebRtcVoiceMediaChannel::CanInsertDtmf() {
return dtmf_allowed_;
}
@@ -2981,22 +2934,6 @@ void WebRtcVoiceMediaChannel::OnPacketReceived(
which_channel = voe_channel();
}
- // Stop any ringback that might be playing on the channel.
- // It's possible the ringback has already stopped, ih which case we'll just
- // use the opportunity to remove the channel from ringback_channels_.
- if (engine()->voe()->file()) {
- const std::set<int>::iterator it = ringback_channels_.find(which_channel);
- if (it != ringback_channels_.end()) {
- if (engine()->voe()->file()->IsPlayingFileLocally(
- which_channel) == 1) {
- engine()->voe()->file()->StopPlayingFileLocally(which_channel);
- LOG(LS_INFO) << "Stopped ringback on channel " << which_channel
- << " due to incoming media";
- }
- ringback_channels_.erase(which_channel);
- }
- }
-
// Pass it off to the decoder.
engine()->voe()->network()->ReceivedRTPPacket(
which_channel, packet->data(), packet->size(),
@@ -3617,18 +3554,6 @@ bool WebRtcVoiceMediaChannel::SetRecvCodecsInternal(
return true;
}
-int WebRtcSoundclipStream::Read(void *buf, size_t len) {
- size_t res = 0;
- mem_.Read(buf, len, &res, NULL);
- return static_cast<int>(res);
-}
-
-int WebRtcSoundclipStream::Rewind() {
- mem_.Rewind();
- // Return -1 to keep VoiceEngine from looping.
- return (loop_) ? 0 : -1;
-}
-
} // namespace cricket
#endif // HAVE_WEBRTC_VOICE
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | talk/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698