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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(volume >= 0 && volume <= 10); |
100 for (auto* observer : audio_observers_) | 100 for (auto* observer : audio_observers_) |
101 observer->OnSetVolume(volume); | 101 observer->OnSetVolume(volume); |
102 } | 102 } |
103 | 103 |
104 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { | 104 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { |
105 RTC_DCHECK(observer != NULL); | 105 RTC_DCHECK(observer != nullptr); |
106 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), | 106 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), |
107 observer) == audio_observers_.end()); | 107 observer) == audio_observers_.end()); |
108 audio_observers_.push_back(observer); | 108 audio_observers_.push_back(observer); |
109 } | 109 } |
110 | 110 |
111 void RemoteAudioSource::UnregisterAudioObserver(AudioObserver* observer) { | 111 void RemoteAudioSource::UnregisterAudioObserver(AudioObserver* observer) { |
112 RTC_DCHECK(observer != NULL); | 112 RTC_DCHECK(observer != nullptr); |
113 audio_observers_.remove(observer); | 113 audio_observers_.remove(observer); |
114 } | 114 } |
115 | 115 |
116 void RemoteAudioSource::AddSink(AudioTrackSinkInterface* sink) { | 116 void RemoteAudioSource::AddSink(AudioTrackSinkInterface* sink) { |
117 RTC_DCHECK(main_thread_->IsCurrent()); | 117 RTC_DCHECK(main_thread_->IsCurrent()); |
118 RTC_DCHECK(sink); | 118 RTC_DCHECK(sink); |
119 | 119 |
120 if (state_ != MediaSourceInterface::kLive) { | 120 if (state_ != MediaSourceInterface::kLive) { |
121 LOG(LS_ERROR) << "Can't register sink as the source isn't live."; | 121 LOG(LS_ERROR) << "Can't register sink as the source isn't live."; |
122 return; | 122 return; |
(...skipping 28 matching lines...) Expand all Loading... |
151 } | 151 } |
152 | 152 |
153 void RemoteAudioSource::OnMessage(rtc::Message* msg) { | 153 void RemoteAudioSource::OnMessage(rtc::Message* msg) { |
154 RTC_DCHECK(main_thread_->IsCurrent()); | 154 RTC_DCHECK(main_thread_->IsCurrent()); |
155 sinks_.clear(); | 155 sinks_.clear(); |
156 state_ = MediaSourceInterface::kEnded; | 156 state_ = MediaSourceInterface::kEnded; |
157 FireOnChanged(); | 157 FireOnChanged(); |
158 } | 158 } |
159 | 159 |
160 } // namespace webrtc | 160 } // namespace webrtc |
OLD | NEW |