| 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 "content/public/renderer/media_stream_audio_sink.h" | 7 #include "content/public/renderer/media_stream_audio_sink.h" |
| 8 #include "content/renderer/media/media_stream_audio_level_calculator.h" | 8 #include "content/renderer/media/media_stream_audio_level_calculator.h" |
| 9 #include "content/renderer/media/media_stream_audio_processor.h" | 9 #include "content/renderer/media/media_stream_audio_processor.h" |
| 10 #include "content/renderer/media/media_stream_audio_sink_owner.h" | 10 #include "content/renderer/media/media_stream_audio_sink_owner.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 level_calculator_.reset(new MediaStreamAudioLevelCalculator()); | 106 level_calculator_.reset(new MediaStreamAudioLevelCalculator()); |
| 107 | 107 |
| 108 base::AutoLock auto_lock(lock_); | 108 base::AutoLock auto_lock(lock_); |
| 109 // Remember to notify all sinks of the new format. | 109 // Remember to notify all sinks of the new format. |
| 110 sinks_.TagAll(); | 110 sinks_.TagAll(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WebRtcLocalAudioTrack::SetAudioProcessor( | 113 void WebRtcLocalAudioTrack::SetAudioProcessor( |
| 114 const scoped_refptr<MediaStreamAudioProcessor>& processor) { | 114 const scoped_refptr<MediaStreamAudioProcessor>& processor) { |
| 115 // if the |processor| does not have audio processing, which can happen if | 115 // if the |processor| does not have audio processing, which can happen if |
| 116 // kDisableAudioTrackProcessing is set set or all the constraints in | 116 // kEnableAudioTrackProcessing is not set or all the constraints in |
| 117 // the |processor| are turned off. In such case, we pass NULL to the | 117 // the |processor| are turned off. In such case, we pass NULL to the |
| 118 // adapter to indicate that no stats can be gotten from the processor. | 118 // adapter to indicate that no stats can be gotten from the processor. |
| 119 adapter_->SetAudioProcessor(processor->has_audio_processing() ? | 119 adapter_->SetAudioProcessor(processor->has_audio_processing() ? |
| 120 processor : NULL); | 120 processor : NULL); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void WebRtcLocalAudioTrack::AddSink(MediaStreamAudioSink* sink) { | 123 void WebRtcLocalAudioTrack::AddSink(MediaStreamAudioSink* sink) { |
| 124 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 124 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
| 125 DVLOG(1) << "WebRtcLocalAudioTrack::AddSink()"; | 125 DVLOG(1) << "WebRtcLocalAudioTrack::AddSink()"; |
| 126 base::AutoLock auto_lock(lock_); | 126 base::AutoLock auto_lock(lock_); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 for (SinkList::ItemList::const_iterator it = sinks.begin(); | 243 for (SinkList::ItemList::const_iterator it = sinks.begin(); |
| 244 it != sinks.end(); | 244 it != sinks.end(); |
| 245 ++it){ | 245 ++it){ |
| 246 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); | 246 (*it)->OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); |
| 247 (*it)->Reset(); | 247 (*it)->Reset(); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace content | 251 } // namespace content |
| OLD | NEW |