Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: content/renderer/media/webrtc_audio_renderer.cc

Issue 2204143002: Making WebRtcAudioRenderer sink to always play after start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698