| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 provider->SetRawAudioSink( | 99 provider->SetRawAudioSink( |
| 100 ssrc, rtc::scoped_ptr<AudioSinkInterface>(new Sink(this))); | 100 ssrc, rtc::scoped_ptr<AudioSinkInterface>(new Sink(this))); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 MediaSourceInterface::SourceState RemoteAudioSource::state() const { | 104 MediaSourceInterface::SourceState RemoteAudioSource::state() const { |
| 105 RTC_DCHECK(main_thread_->IsCurrent()); | 105 RTC_DCHECK(main_thread_->IsCurrent()); |
| 106 return state_; | 106 return state_; |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool RemoteAudioSource::remote() const { |
| 110 RTC_DCHECK(main_thread_->IsCurrent()); |
| 111 return true; |
| 112 } |
| 113 |
| 109 void RemoteAudioSource::SetVolume(double volume) { | 114 void RemoteAudioSource::SetVolume(double volume) { |
| 110 RTC_DCHECK(volume >= 0 && volume <= 10); | 115 RTC_DCHECK(volume >= 0 && volume <= 10); |
| 111 for (auto* observer : audio_observers_) | 116 for (auto* observer : audio_observers_) |
| 112 observer->OnSetVolume(volume); | 117 observer->OnSetVolume(volume); |
| 113 } | 118 } |
| 114 | 119 |
| 115 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { | 120 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { |
| 116 RTC_DCHECK(observer != NULL); | 121 RTC_DCHECK(observer != NULL); |
| 117 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), | 122 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), |
| 118 observer) == audio_observers_.end()); | 123 observer) == audio_observers_.end()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 167 } |
| 163 | 168 |
| 164 void RemoteAudioSource::OnMessage(rtc::Message* msg) { | 169 void RemoteAudioSource::OnMessage(rtc::Message* msg) { |
| 165 RTC_DCHECK(main_thread_->IsCurrent()); | 170 RTC_DCHECK(main_thread_->IsCurrent()); |
| 166 sinks_.clear(); | 171 sinks_.clear(); |
| 167 state_ = MediaSourceInterface::kEnded; | 172 state_ = MediaSourceInterface::kEnded; |
| 168 FireOnChanged(); | 173 FireOnChanged(); |
| 169 } | 174 } |
| 170 | 175 |
| 171 } // namespace webrtc | 176 } // namespace webrtc |
| OLD | NEW |