OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/media/webrtc_local_audio_track.h" | 5 #include "content/renderer/media/webrtc_local_audio_track.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "content/public/renderer/media_stream_audio_sink.h" | 9 #include "content/public/renderer/media_stream_audio_sink.h" |
10 #include "content/renderer/media/media_stream_audio_level_calculator.h" | 10 #include "content/renderer/media/media_stream_audio_level_calculator.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 sinks = sinks_.Items(); | 182 sinks = sinks_.Items(); |
183 } | 183 } |
184 for (SinkList::ItemList::const_iterator it = sinks.begin(); | 184 for (SinkList::ItemList::const_iterator it = sinks.begin(); |
185 it != sinks.end(); | 185 it != sinks.end(); |
186 ++it) { | 186 ++it) { |
187 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateLive); | 187 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateLive); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 void WebRtcLocalAudioTrack::SetEnabled(bool enabled) { | 191 void WebRtcLocalAudioTrack::SetEnabled(bool enabled) { |
192 DCHECK(thread_checker_.CalledOnValidThread()); | 192 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
193 if (adapter_.get()) | 193 if (adapter_.get()) |
194 adapter_->set_enabled(enabled); | 194 adapter_->set_enabled(enabled); |
195 } | 195 } |
196 | 196 |
197 void WebRtcLocalAudioTrack::Stop() { | 197 void WebRtcLocalAudioTrack::Stop() { |
198 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 198 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
199 DVLOG(1) << "WebRtcLocalAudioTrack::Stop()"; | 199 DVLOG(1) << "WebRtcLocalAudioTrack::Stop()"; |
200 if (!capturer_.get() && !webaudio_source_.get()) | 200 if (!capturer_.get() && !webaudio_source_.get()) |
201 return; | 201 return; |
202 | 202 |
(...skipping 22 matching lines...) Expand all Loading... |
225 | 225 |
226 for (SinkList::ItemList::const_iterator it = sinks.begin(); | 226 for (SinkList::ItemList::const_iterator it = sinks.begin(); |
227 it != sinks.end(); | 227 it != sinks.end(); |
228 ++it){ | 228 ++it){ |
229 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); | 229 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); |
230 (*it)->Reset(); | 230 (*it)->Reset(); |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 webrtc::AudioTrackInterface* WebRtcLocalAudioTrack::GetAudioAdapter() { | 234 webrtc::AudioTrackInterface* WebRtcLocalAudioTrack::GetAudioAdapter() { |
235 DCHECK(thread_checker_.CalledOnValidThread()); | 235 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
236 return adapter_.get(); | 236 return adapter_.get(); |
237 } | 237 } |
238 | 238 |
239 } // namespace content | 239 } // namespace content |
OLD | NEW |