| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 << "InsertDtmf is called on DtmfSender that can't send DTMF."; | 130 << "InsertDtmf is called on DtmfSender that can't send DTMF."; |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 tones_ = tones; | 134 tones_ = tones; |
| 135 duration_ = duration; | 135 duration_ = duration; |
| 136 inter_tone_gap_ = inter_tone_gap; | 136 inter_tone_gap_ = inter_tone_gap; |
| 137 // Clear the previous queue. | 137 // Clear the previous queue. |
| 138 signaling_thread_->Clear(this, MSG_DO_INSERT_DTMF); | 138 signaling_thread_->Clear(this, MSG_DO_INSERT_DTMF); |
| 139 // Kick off a new DTMF task queue. | 139 // Kick off a new DTMF task queue. |
| 140 signaling_thread_->Post(this, MSG_DO_INSERT_DTMF); | 140 signaling_thread_->Post(RTC_FROM_HERE, this, MSG_DO_INSERT_DTMF); |
| 141 return true; | 141 return true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 const AudioTrackInterface* DtmfSender::track() const { | 144 const AudioTrackInterface* DtmfSender::track() const { |
| 145 return track_; | 145 return track_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 std::string DtmfSender::tones() const { | 148 std::string DtmfSender::tones() const { |
| 149 return tones_; | 149 return tones_; |
| 150 } | 150 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 // Fire a “OnToneChange” event with the tone that's just processed. | 216 // Fire a “OnToneChange” event with the tone that's just processed. |
| 217 if (observer_) { | 217 if (observer_) { |
| 218 observer_->OnToneChange(tones_.substr(first_tone_pos, 1)); | 218 observer_->OnToneChange(tones_.substr(first_tone_pos, 1)); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // Erase the unrecognized characters plus the tone that's just processed. | 221 // Erase the unrecognized characters plus the tone that's just processed. |
| 222 tones_.erase(0, first_tone_pos + 1); | 222 tones_.erase(0, first_tone_pos + 1); |
| 223 | 223 |
| 224 // Continue with the next tone. | 224 // Continue with the next tone. |
| 225 signaling_thread_->PostDelayed(tone_gap, this, MSG_DO_INSERT_DTMF); | 225 signaling_thread_->PostDelayed(RTC_FROM_HERE, tone_gap, this, |
| 226 MSG_DO_INSERT_DTMF); |
| 226 } | 227 } |
| 227 | 228 |
| 228 void DtmfSender::OnProviderDestroyed() { | 229 void DtmfSender::OnProviderDestroyed() { |
| 229 LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue."; | 230 LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue."; |
| 230 StopSending(); | 231 StopSending(); |
| 231 provider_ = NULL; | 232 provider_ = NULL; |
| 232 } | 233 } |
| 233 | 234 |
| 234 void DtmfSender::StopSending() { | 235 void DtmfSender::StopSending() { |
| 235 signaling_thread_->Clear(this); | 236 signaling_thread_->Clear(this); |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace webrtc | 239 } // namespace webrtc |
| OLD | NEW |