OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/webrtc_audio_source_adapter.h" | 5 #include "remoting/protocol/webrtc_audio_source_adapter.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 base::ObserverList<webrtc::AudioTrackSinkInterface> audio_sinks_; | 52 base::ObserverList<webrtc::AudioTrackSinkInterface> audio_sinks_; |
53 base::Lock audio_sinks_lock_; | 53 base::Lock audio_sinks_lock_; |
54 | 54 |
55 base::ThreadChecker thread_checker_; | 55 base::ThreadChecker thread_checker_; |
56 }; | 56 }; |
57 | 57 |
58 WebrtcAudioSourceAdapter::Core::Core() { | 58 WebrtcAudioSourceAdapter::Core::Core() { |
59 thread_checker_.DetachFromThread(); | 59 thread_checker_.DetachFromThread(); |
60 } | 60 } |
61 | 61 |
62 WebrtcAudioSourceAdapter::Core::~Core() {} | 62 WebrtcAudioSourceAdapter::Core::~Core() { |
| 63 DCHECK(thread_checker_.CalledOnValidThread()); |
| 64 } |
63 | 65 |
64 void WebrtcAudioSourceAdapter::Core::Start( | 66 void WebrtcAudioSourceAdapter::Core::Start( |
65 std::unique_ptr<AudioSource> audio_source) { | 67 std::unique_ptr<AudioSource> audio_source) { |
66 DCHECK(thread_checker_.CalledOnValidThread()); | 68 DCHECK(thread_checker_.CalledOnValidThread()); |
67 audio_source_ = std::move(audio_source); | 69 audio_source_ = std::move(audio_source); |
68 audio_source_->Start( | 70 audio_source_->Start( |
69 base::Bind(&Core::OnAudioPacket, base::Unretained(this))); | 71 base::Bind(&Core::OnAudioPacket, base::Unretained(this))); |
70 } | 72 } |
71 | 73 |
72 void WebrtcAudioSourceAdapter::Core::Pause(bool pause) { | 74 void WebrtcAudioSourceAdapter::Core::Pause(bool pause) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 core_->RemoveSink(sink); | 188 core_->RemoveSink(sink); |
187 } | 189 } |
188 | 190 |
189 void WebrtcAudioSourceAdapter::RegisterObserver( | 191 void WebrtcAudioSourceAdapter::RegisterObserver( |
190 webrtc::ObserverInterface* observer) {} | 192 webrtc::ObserverInterface* observer) {} |
191 void WebrtcAudioSourceAdapter::UnregisterObserver( | 193 void WebrtcAudioSourceAdapter::UnregisterObserver( |
192 webrtc::ObserverInterface* observer) {} | 194 webrtc::ObserverInterface* observer) {} |
193 | 195 |
194 } // namespace protocol | 196 } // namespace protocol |
195 } // namespace remoting | 197 } // namespace remoting |
OLD | NEW |