Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/android/audio_manager_android.h" | 5 #include "media/audio/android/audio_manager_android.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 } | 203 } |
| 204 | 204 |
| 205 AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( | 205 AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( |
| 206 const AudioParameters& params, const std::string& device_id) { | 206 const AudioParameters& params, const std::string& device_id) { |
| 207 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 207 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 208 DLOG_IF(ERROR, device_id.empty()) << "Invalid device ID!"; | 208 DLOG_IF(ERROR, device_id.empty()) << "Invalid device ID!"; |
| 209 // Use the device ID to select the correct input device. | 209 // Use the device ID to select the correct input device. |
| 210 // Note that the input device is always associated with a certain output | 210 // Note that the input device is always associated with a certain output |
| 211 // device, i.e., this selection does also switch the output device. | 211 // device, i.e., this selection does also switch the output device. |
| 212 // All input and output streams will be affected by the device selection. | 212 // All input and output streams will be affected by the device selection. |
| 213 if (!SetAudioDevice(device_id)) { | 213 if (!SetAudioDevice(device_id)) { |
|
henrika (OOO until Aug 14)
2014/01/15 10:09:12
Thanks.
| |
| 214 LOG(ERROR) << "Unable to select audio device!"; | 214 LOG(ERROR) << "Unable to select audio device!"; |
| 215 return NULL; | 215 return NULL; |
| 216 } | 216 } |
| 217 | 217 |
| 218 if (params.effects() != AudioParameters::NO_EFFECTS) { | 218 if (params.effects() != AudioParameters::NO_EFFECTS) { |
| 219 // Platform effects can only be enabled through the AudioRecord path. | 219 // Platform effects can only be enabled through the AudioRecord path. |
| 220 // An effect should only have been requested here if recommended by | 220 // An effect should only have been requested here if recommended by |
| 221 // AudioManagerAndroid.shouldUse<Effect>. | 221 // AudioManagerAndroid.shouldUse<Effect>. |
| 222 // | 222 // |
| 223 // Creating this class requires Jelly Bean, which is already guaranteed by | 223 // Creating this class requires Jelly Bean, which is already guaranteed by |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 j_audio_manager_.obj()); | 342 j_audio_manager_.obj()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { | 345 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { |
| 346 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( | 346 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( |
| 347 base::android::AttachCurrentThread(), | 347 base::android::AttachCurrentThread(), |
| 348 j_audio_manager_.obj()); | 348 j_audio_manager_.obj()); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace media | 351 } // namespace media |
| OLD | NEW |