| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 RTC_DCHECK(main_thread_->IsCurrent()); | 89 RTC_DCHECK(main_thread_->IsCurrent()); |
| 90 return state_; | 90 return state_; |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool RemoteAudioSource::remote() const { | 93 bool RemoteAudioSource::remote() const { |
| 94 RTC_DCHECK(main_thread_->IsCurrent()); | 94 RTC_DCHECK(main_thread_->IsCurrent()); |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void RemoteAudioSource::SetVolume(double volume) { | 98 void RemoteAudioSource::SetVolume(double volume) { |
| 99 RTC_DCHECK(volume >= 0 && volume <= 10); | 99 RTC_DCHECK_GE(volume, 0); |
| 100 RTC_DCHECK_LE(volume, 10); |
| 100 for (auto* observer : audio_observers_) | 101 for (auto* observer : audio_observers_) |
| 101 observer->OnSetVolume(volume); | 102 observer->OnSetVolume(volume); |
| 102 } | 103 } |
| 103 | 104 |
| 104 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { | 105 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { |
| 105 RTC_DCHECK(observer != NULL); | 106 RTC_DCHECK(observer != NULL); |
| 106 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), | 107 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), |
| 107 observer) == audio_observers_.end()); | 108 observer) == audio_observers_.end()); |
| 108 audio_observers_.push_back(observer); | 109 audio_observers_.push_back(observer); |
| 109 } | 110 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 152 } |
| 152 | 153 |
| 153 void RemoteAudioSource::OnMessage(rtc::Message* msg) { | 154 void RemoteAudioSource::OnMessage(rtc::Message* msg) { |
| 154 RTC_DCHECK(main_thread_->IsCurrent()); | 155 RTC_DCHECK(main_thread_->IsCurrent()); |
| 155 sinks_.clear(); | 156 sinks_.clear(); |
| 156 state_ = MediaSourceInterface::kEnded; | 157 state_ = MediaSourceInterface::kEnded; |
| 157 FireOnChanged(); | 158 FireOnChanged(); |
| 158 } | 159 } |
| 159 | 160 |
| 160 } // namespace webrtc | 161 } // namespace webrtc |
| OLD | NEW |