| 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_renderer.h" | 5 #include "content/renderer/media/webrtc_local_audio_renderer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 RenderFrameImpl::FromRoutingID(source_render_frame_id_); | 266 RenderFrameImpl::FromRoutingID(source_render_frame_id_); |
| 267 MediaStreamDispatcher* const dispatcher = frame ? | 267 MediaStreamDispatcher* const dispatcher = frame ? |
| 268 frame->GetMediaStreamDispatcher() : NULL; | 268 frame->GetMediaStreamDispatcher() : NULL; |
| 269 if (dispatcher && dispatcher->IsAudioDuckingActive()) { | 269 if (dispatcher && dispatcher->IsAudioDuckingActive()) { |
| 270 DVLOG(1) << "Forcing DUCKING to be ON for output"; | 270 DVLOG(1) << "Forcing DUCKING to be ON for output"; |
| 271 implicit_ducking_effect = media::AudioParameters::DUCKING; | 271 implicit_ducking_effect = media::AudioParameters::DUCKING; |
| 272 } else { | 272 } else { |
| 273 DVLOG(1) << "DUCKING not forced ON for output"; | 273 DVLOG(1) << "DUCKING not forced ON for output"; |
| 274 } | 274 } |
| 275 | 275 |
| 276 if (source_params_ == params) | 276 if (source_params_.Equals(params)) |
| 277 return; | 277 return; |
| 278 | 278 |
| 279 // Reset the |source_params_|, |sink_params_| and |loopback_fifo_| to match | 279 // Reset the |source_params_|, |sink_params_| and |loopback_fifo_| to match |
| 280 // the new format. | 280 // the new format. |
| 281 | 281 |
| 282 source_params_ = params; | 282 source_params_ = params; |
| 283 | 283 |
| 284 sink_params_ = media::AudioParameters(source_params_.format(), | 284 sink_params_ = media::AudioParameters(source_params_.format(), |
| 285 source_params_.channel_layout(), source_params_.sample_rate(), | 285 source_params_.channel_layout(), source_params_.sample_rate(), |
| 286 source_params_.bits_per_sample(), | 286 source_params_.bits_per_sample(), |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 sink_->Stop(); | 324 sink_->Stop(); |
| 325 sink_started_ = false; | 325 sink_started_ = false; |
| 326 } | 326 } |
| 327 | 327 |
| 328 sink_ = AudioDeviceFactory::NewOutputDevice(source_render_view_id_, | 328 sink_ = AudioDeviceFactory::NewOutputDevice(source_render_view_id_, |
| 329 source_render_frame_id_); | 329 source_render_frame_id_); |
| 330 MaybeStartSink(); | 330 MaybeStartSink(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace content | 333 } // namespace content |
| OLD | NEW |