| 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_audio_renderer.h" | 5 #include "content/renderer/media/webrtc_audio_renderer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 sink_->Stop(); | 379 sink_->Stop(); |
| 380 sink_ = new_sink; | 380 sink_ = new_sink; |
| 381 output_device_id_ = device_id; | 381 output_device_id_ = device_id; |
| 382 security_origin_ = security_origin; | 382 security_origin_ = security_origin; |
| 383 { | 383 { |
| 384 base::AutoLock auto_lock(lock_); | 384 base::AutoLock auto_lock(lock_); |
| 385 source_->AudioRendererThreadStopped(); | 385 source_->AudioRendererThreadStopped(); |
| 386 } | 386 } |
| 387 PrepareSink(); | 387 PrepareSink(); |
| 388 sink_->Start(); | 388 sink_->Start(); |
| 389 sink_->Play(); // Not all the sinks play on start. |
| 389 | 390 |
| 390 callback.Run(media::OUTPUT_DEVICE_STATUS_OK); | 391 callback.Run(media::OUTPUT_DEVICE_STATUS_OK); |
| 391 } | 392 } |
| 392 | 393 |
| 393 int WebRtcAudioRenderer::Render(media::AudioBus* audio_bus, | 394 int WebRtcAudioRenderer::Render(media::AudioBus* audio_bus, |
| 394 uint32_t frames_delayed, | 395 uint32_t frames_delayed, |
| 395 uint32_t frames_skipped) { | 396 uint32_t frames_skipped) { |
| 396 DCHECK(sink_->CurrentThreadIsRenderingThread()); | 397 DCHECK(sink_->CurrentThreadIsRenderingThread()); |
| 397 base::AutoLock auto_lock(lock_); | 398 base::AutoLock auto_lock(lock_); |
| 398 if (!source_) | 399 if (!source_) |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 base::Bind(&WebRtcAudioRenderer::SourceCallback, | 648 base::Bind(&WebRtcAudioRenderer::SourceCallback, |
| 648 base::Unretained(this)))); | 649 base::Unretained(this)))); |
| 649 } | 650 } |
| 650 sink_params_ = new_sink_params; | 651 sink_params_ = new_sink_params; |
| 651 } | 652 } |
| 652 | 653 |
| 653 sink_->Initialize(new_sink_params, this); | 654 sink_->Initialize(new_sink_params, this); |
| 654 } | 655 } |
| 655 | 656 |
| 656 } // namespace content | 657 } // namespace content |
| OLD | NEW |