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

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

Issue 11048029: Allow Thread to initialize COM for Windows consumers who need it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | remoting/host/setup/daemon_controller_win.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 "media/audio/fake_audio_output_stream.h" 5 #include "media/audio/fake_audio_output_stream.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/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h"
10 #include "media/audio/audio_manager_base.h" 11 #include "media/audio/audio_manager_base.h"
11 12
12 namespace media { 13 namespace media {
13 14
14 // static 15 // static
15 AudioOutputStream* FakeAudioOutputStream::MakeFakeStream( 16 AudioOutputStream* FakeAudioOutputStream::MakeFakeStream(
16 AudioManagerBase* manager, const AudioParameters& params) { 17 AudioManagerBase* manager, const AudioParameters& params) {
17 return new FakeAudioOutputStream(manager, params); 18 return new FakeAudioOutputStream(manager, params);
18 } 19 }
19 20
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Calculate our sleep duration for simulated playback. Sleep for at least 76 // Calculate our sleep duration for simulated playback. Sleep for at least
76 // one millisecond so we don't spin the CPU. 77 // one millisecond so we don't spin the CPU.
77 MessageLoop::current()->PostDelayedTask( 78 MessageLoop::current()->PostDelayedTask(
78 FROM_HERE, base::Bind( 79 FROM_HERE, base::Bind(
79 &FakeAudioOutputStream::OnMoreDataTask, weak_this_.GetWeakPtr()), 80 &FakeAudioOutputStream::OnMoreDataTask, weak_this_.GetWeakPtr()),
80 base::TimeDelta::FromMilliseconds( 81 base::TimeDelta::FromMilliseconds(
81 std::max(1.0f, frames_received / frames_per_millisecond_))); 82 std::max(1.0f, frames_received / frames_per_millisecond_)));
82 } 83 }
83 84
84 } // namespace media 85 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | remoting/host/setup/daemon_controller_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698