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

Side by Side Diff: media/audio/audio_output_stream_sink.cc

Issue 1538463002: Revert of 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: 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 | « media/audio/audio_output_stream_sink.h ('k') | media/audio/audio_parameters.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/audio/audio_output_stream_sink.h" 5 #include "media/audio/audio_output_stream_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "media/audio/audio_manager.h" 10 #include "media/audio/audio_manager.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 audio_task_runner_->PostTask( 69 audio_task_runner_->PostTask(
70 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume)); 70 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume));
71 return true; 71 return true;
72 } 72 }
73 73
74 OutputDevice* AudioOutputStreamSink::GetOutputDevice() { 74 OutputDevice* AudioOutputStreamSink::GetOutputDevice() {
75 return nullptr; 75 return nullptr;
76 } 76 }
77 77
78 int AudioOutputStreamSink::OnMoreData(AudioBus* dest, 78 int AudioOutputStreamSink::OnMoreData(AudioBus* dest,
79 uint32_t total_bytes_delay, 79 uint32 total_bytes_delay) {
80 uint32_t frames_skipped) {
81 // Note: Runs on the audio thread created by the OS. 80 // Note: Runs on the audio thread created by the OS.
82 base::AutoLock al(callback_lock_); 81 base::AutoLock al(callback_lock_);
83 if (!active_render_callback_) 82 if (!active_render_callback_)
84 return 0; 83 return 0;
85 84
86 return active_render_callback_->Render( 85 return active_render_callback_->Render(
87 dest, total_bytes_delay * 1000.0 / active_params_.GetBytesPerSecond(), 0); 86 dest, total_bytes_delay * 1000.0 / active_params_.GetBytesPerSecond());
88 } 87 }
89 88
90 void AudioOutputStreamSink::OnError(AudioOutputStream* stream) { 89 void AudioOutputStreamSink::OnError(AudioOutputStream* stream) {
91 // Note: Runs on the audio thread created by the OS. 90 // Note: Runs on the audio thread created by the OS.
92 base::AutoLock al(callback_lock_); 91 base::AutoLock al(callback_lock_);
93 if (active_render_callback_) 92 if (active_render_callback_)
94 active_render_callback_->OnRenderError(); 93 active_render_callback_->OnRenderError();
95 } 94 }
96 95
97 void AudioOutputStreamSink::DoStart(const AudioParameters& params) { 96 void AudioOutputStreamSink::DoStart(const AudioParameters& params) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 DCHECK(audio_task_runner_->BelongsToCurrentThread()); 138 DCHECK(audio_task_runner_->BelongsToCurrentThread());
140 stream_->SetVolume(volume); 139 stream_->SetVolume(volume);
141 } 140 }
142 141
143 void AudioOutputStreamSink::ClearCallback() { 142 void AudioOutputStreamSink::ClearCallback() {
144 base::AutoLock al(callback_lock_); 143 base::AutoLock al(callback_lock_);
145 active_render_callback_ = NULL; 144 active_render_callback_ = NULL;
146 } 145 }
147 146
148 } // namepace media 147 } // namepace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_stream_sink.h ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698