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

Side by Side Diff: media/audio/sounds/audio_stream_handler.cc

Issue 290003002: Remove OnMoreIOData() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the media unittests on mac. Created 6 years, 7 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 | « media/audio/simple_sources.cc ('k') | media/audio/virtual_audio_input_stream_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sounds/audio_stream_handler.h" 5 #include "media/audio/sounds/audio_stream_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 AudioManager::Get()->GetTaskRunner()->PostDelayedTask( 117 AudioManager::Get()->GetTaskRunner()->PostDelayedTask(
118 FROM_HERE, 118 FROM_HERE,
119 stop_closure_.callback(), 119 stop_closure_.callback(),
120 base::TimeDelta::FromMilliseconds(kKeepAliveMs)); 120 base::TimeDelta::FromMilliseconds(kKeepAliveMs));
121 return 0; 121 return 0;
122 } 122 }
123 cursor_ += bytes_written; 123 cursor_ += bytes_written;
124 return dest->frames(); 124 return dest->frames();
125 } 125 }
126 126
127 virtual int OnMoreIOData(AudioBus* /* source */,
128 AudioBus* dest,
129 AudioBuffersState state) OVERRIDE {
130 return OnMoreData(dest, state);
131 }
132
133 virtual void OnError(AudioOutputStream* /* stream */) OVERRIDE { 127 virtual void OnError(AudioOutputStream* /* stream */) OVERRIDE {
134 LOG(ERROR) << "Error during system sound reproduction."; 128 LOG(ERROR) << "Error during system sound reproduction.";
135 } 129 }
136 130
137 void StopStream() { 131 void StopStream() {
138 DCHECK(AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()); 132 DCHECK(AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread());
139 133
140 base::AutoLock al(state_lock_); 134 base::AutoLock al(state_lock_);
141 135
142 if (stream_ && started_) { 136 if (stream_ && started_) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 g_observer_for_testing = observer; 209 g_observer_for_testing = observer;
216 } 210 }
217 211
218 // static 212 // static
219 void AudioStreamHandler::SetAudioSourceForTesting( 213 void AudioStreamHandler::SetAudioSourceForTesting(
220 AudioOutputStream::AudioSourceCallback* source) { 214 AudioOutputStream::AudioSourceCallback* source) {
221 g_audio_source_for_testing = source; 215 g_audio_source_for_testing = source;
222 } 216 }
223 217
224 } // namespace media 218 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/simple_sources.cc ('k') | media/audio/virtual_audio_input_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698