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

Side by Side Diff: components/audio_modem/audio_player_impl.cc

Issue 865483005: Creating the audio_modem component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging again Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/copresence/mediums/audio/audio_player_impl.h" 5 #include "components/audio_modem/audio_player_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "components/copresence/public/copresence_constants.h" 14 #include "components/audio_modem/public/audio_modem_types.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "media/audio/audio_manager.h" 16 #include "media/audio/audio_manager.h"
17 #include "media/audio/audio_parameters.h" 17 #include "media/audio/audio_parameters.h"
18 #include "media/base/audio_bus.h" 18 #include "media/base/audio_bus.h"
19 19
20 namespace { 20 namespace {
21 21
22 const int kDefaultFrameCount = 1024; 22 const int kDefaultFrameCount = 1024;
23 const double kOutputVolumePercent = 1.0f; 23 const double kOutputVolumePercent = 1.0f;
24 24
25 } // namespace 25 } // namespace
26 26
27 namespace copresence { 27 namespace audio_modem {
28 28
29 // Public methods. 29 // Public methods.
30 30
31 AudioPlayerImpl::AudioPlayerImpl() 31 AudioPlayerImpl::AudioPlayerImpl()
32 : is_playing_(false), stream_(nullptr), frame_index_(0) { 32 : is_playing_(false), stream_(nullptr), frame_index_(0) {
33 } 33 }
34 34
35 AudioPlayerImpl::~AudioPlayerImpl() { 35 AudioPlayerImpl::~AudioPlayerImpl() {
36 } 36 }
37 37
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // successfully executed all the tasks before us. 169 // successfully executed all the tasks before us.
170 base::RunLoop rl; 170 base::RunLoop rl;
171 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply( 171 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply(
172 FROM_HERE, 172 FROM_HERE,
173 base::Bind(base::IgnoreResult(&AudioPlayerImpl::FlushAudioLoopForTesting), 173 base::Bind(base::IgnoreResult(&AudioPlayerImpl::FlushAudioLoopForTesting),
174 base::Unretained(this)), 174 base::Unretained(this)),
175 rl.QuitClosure()); 175 rl.QuitClosure());
176 rl.Run(); 176 rl.Run();
177 } 177 }
178 178
179 } // namespace copresence 179 } // namespace audio_modem
OLDNEW
« no previous file with comments | « components/audio_modem/audio_player_impl.h ('k') | components/audio_modem/audio_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698