OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/audio/android/audio_manager_android.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "media/audio/android/audio_track_output_android.h" | |
9 #include "media/audio/audio_manager.h" | |
10 #include "media/audio/fake_audio_input_stream.h" | |
11 #include "media/audio/fake_audio_output_stream.h" | |
12 | |
13 void AudioManagerAndroid::Init() { | |
14 AudioManagerBase::Init(); | |
15 } | |
16 | |
17 bool AudioManagerAndroid::HasAudioOutputDevices() { | |
18 return true; | |
19 } | |
20 | |
21 bool AudioManagerAndroid::HasAudioInputDevices() { | |
22 return false; | |
23 } | |
24 | |
25 AudioOutputStream* AudioManagerAndroid::MakeAudioOutputStream( | |
26 const AudioParameters& params) { | |
27 if (!params.IsValid()) | |
28 return NULL; | |
29 | |
30 if (params.format == AudioParameters::AUDIO_MOCK) { | |
31 return FakeAudioOutputStream::MakeFakeStream(params); | |
32 } else if (params.format == AudioParameters::AUDIO_PCM_LINEAR || | |
scherkus (not reviewing)
2011/11/29 20:00:28
nit: no need for else
michaelbai
2011/11/30 17:20:34
Done.
| |
33 params.format == AudioParameters::AUDIO_PCM_LOW_LATENCY) { | |
34 return AudioTrackOutputStream::MakeStream(this, params); | |
35 } | |
36 | |
37 return NULL; | |
38 } | |
39 | |
40 AudioInputStream* AudioManagerAndroid::MakeAudioInputStream( | |
41 const AudioParameters& params) { | |
42 return FakeAudioInputStream::MakeFakeStream(params); | |
43 } | |
44 | |
45 void AudioManagerAndroid::MuteAll() { | |
46 NOTIMPLEMENTED(); | |
47 } | |
48 | |
49 void AudioManagerAndroid::UnMuteAll() { | |
50 NOTIMPLEMENTED(); | |
51 } | |
52 | |
53 AudioManagerAndroid::AudioManagerAndroid() { | |
scherkus (not reviewing)
2011/11/29 20:00:28
nit: collapse empty methods that fit onto one line
michaelbai
2011/11/30 17:20:34
Done.
| |
54 } | |
55 | |
56 AudioManagerAndroid::~AudioManagerAndroid() { | |
scherkus (not reviewing)
2011/11/29 20:00:28
nit: try to match function ordering inside of .h w
michaelbai
2011/11/30 17:20:34
Done.
| |
57 audio_thread_.Stop(); | |
58 } | |
59 | |
60 //static | |
scherkus (not reviewing)
2011/11/29 20:00:28
nit: one period between // and static
also we typ
michaelbai
2011/11/30 17:20:34
Done.
| |
61 AudioManager* AudioManager::CreateAudioManager() { | |
62 return new AudioManagerAndroid(); | |
63 } | |
OLD | NEW |