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

Unified Diff: webrtc/pc/webrtcsession.cc

Issue 2666853002: Move DTMF sender to RtpSender (as opposed to WebRtcSession). (Closed)
Patch Set: Merge with master Created 3 years, 11 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 | « webrtc/pc/webrtcsession.h ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsession.cc
diff --git a/webrtc/pc/webrtcsession.cc b/webrtc/pc/webrtcsession.cc
index cfcc4871c3529f799ef790a1ad03ae4cd69f301e..a02aa5796a3325ab77129c8a28e561bdfbaa594f 100644
--- a/webrtc/pc/webrtcsession.cc
+++ b/webrtc/pc/webrtcsession.cc
@@ -231,29 +231,6 @@ static bool VerifyIceUfragPwdPresent(const SessionDescription* desc) {
return true;
}
-static bool GetAudioSsrcByTrackId(const SessionDescription* session_description,
- const std::string& track_id,
- uint32_t* ssrc) {
- const cricket::ContentInfo* audio_info =
- cricket::GetFirstAudioContent(session_description);
- if (!audio_info) {
- LOG(LS_ERROR) << "Audio not used in this call";
- return false;
- }
-
- const cricket::MediaContentDescription* audio_content =
- static_cast<const cricket::MediaContentDescription*>(
- audio_info->description);
- const cricket::StreamParams* stream =
- cricket::GetStreamByIds(audio_content->streams(), "", track_id);
- if (!stream) {
- return false;
- }
-
- *ssrc = stream->first_ssrc();
- return true;
-}
-
static bool GetTrackIdBySsrc(const SessionDescription* session_description,
uint32_t ssrc,
std::string* track_id) {
@@ -523,7 +500,6 @@ WebRtcSession::~WebRtcSession() {
quic_data_transport_.reset();
}
#endif
- SignalDestroyed();
LOG(LS_INFO) << "Session: " << id() << " is destroyed.";
}
@@ -1248,49 +1224,6 @@ std::string WebRtcSession::BadStateErrMsg(State state) {
return desc.str();
}
-bool WebRtcSession::CanInsertDtmf(const std::string& track_id) {
- RTC_DCHECK(signaling_thread()->IsCurrent());
- if (!voice_channel_) {
- LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
- return false;
- }
- uint32_t send_ssrc = 0;
- // The Dtmf is negotiated per channel not ssrc, so we only check if the ssrc
- // exists.
- if (!local_description() ||
- !GetAudioSsrcByTrackId(local_description()->description(), track_id,
- &send_ssrc)) {
- LOG(LS_ERROR) << "CanInsertDtmf: Track does not exist: " << track_id;
- return false;
- }
- return voice_channel_->CanInsertDtmf();
-}
-
-bool WebRtcSession::InsertDtmf(const std::string& track_id,
- int code, int duration) {
- RTC_DCHECK(signaling_thread()->IsCurrent());
- if (!voice_channel_) {
- LOG(LS_ERROR) << "InsertDtmf: No audio channel exists.";
- return false;
- }
- uint32_t send_ssrc = 0;
- if (!(local_description() &&
- GetAudioSsrcByTrackId(local_description()->description(),
- track_id, &send_ssrc))) {
- LOG(LS_ERROR) << "InsertDtmf: Track does not exist: " << track_id;
- return false;
- }
- if (!voice_channel_->InsertDtmf(send_ssrc, code, duration)) {
- LOG(LS_ERROR) << "Failed to insert DTMF to channel.";
- return false;
- }
- return true;
-}
-
-sigslot::signal0<>* WebRtcSession::GetOnDestroyedSignal() {
- return &SignalDestroyed;
-}
-
bool WebRtcSession::SendData(const cricket::SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
cricket::SendDataResult* result) {
« no previous file with comments | « webrtc/pc/webrtcsession.h ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698