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

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

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 | « content/renderer/media/webrtc_local_audio_renderer.h ('k') | media/audio/alsa/alsa_output.cc » ('j') | 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_local_audio_renderer.h" 5 #include "content/renderer/media/webrtc_local_audio_renderer.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 14 matching lines...) Expand all
25 25
26 enum LocalRendererSinkStates { 26 enum LocalRendererSinkStates {
27 kSinkStarted = 0, 27 kSinkStarted = 0,
28 kSinkNeverStarted, 28 kSinkNeverStarted,
29 kSinkStatesMax // Must always be last! 29 kSinkStatesMax // Must always be last!
30 }; 30 };
31 31
32 } // namespace 32 } // namespace
33 33
34 // media::AudioRendererSink::RenderCallback implementation 34 // media::AudioRendererSink::RenderCallback implementation
35 int WebRtcLocalAudioRenderer::Render( 35 int WebRtcLocalAudioRenderer::Render(media::AudioBus* audio_bus,
36 media::AudioBus* audio_bus, int audio_delay_milliseconds) { 36 uint32_t audio_delay_milliseconds,
37 uint32_t frames_skipped) {
37 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::Render"); 38 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::Render");
38 base::AutoLock auto_lock(thread_lock_); 39 base::AutoLock auto_lock(thread_lock_);
39 40
40 if (!playing_ || !volume_ || !audio_shifter_) { 41 if (!playing_ || !volume_ || !audio_shifter_) {
41 audio_bus->Zero(); 42 audio_bus->Zero();
42 return 0; 43 return 0;
43 } 44 }
44 45
45 audio_shifter_->Pull( 46 audio_shifter_->Pull(
46 audio_bus, 47 audio_bus,
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_, 345 AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
345 output_device_id_, security_origin_); 346 output_device_id_, security_origin_);
346 int frames_per_buffer = sink_->GetOutputParameters().frames_per_buffer(); 347 int frames_per_buffer = sink_->GetOutputParameters().frames_per_buffer();
347 sink_params_ = source_params_; 348 sink_params_ = source_params_;
348 sink_params_.set_frames_per_buffer(WebRtcAudioRenderer::GetOptimalBufferSize( 349 sink_params_.set_frames_per_buffer(WebRtcAudioRenderer::GetOptimalBufferSize(
349 source_params_.sample_rate(), frames_per_buffer)); 350 source_params_.sample_rate(), frames_per_buffer));
350 MaybeStartSink(); 351 MaybeStartSink();
351 } 352 }
352 353
353 } // namespace content 354 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_local_audio_renderer.h ('k') | media/audio/alsa/alsa_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698