| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const AudioParameters& params, | 156 const AudioParameters& params, |
| 157 const std::string& device_id, | 157 const std::string& device_id, |
| 158 const std::string& input_device_id) { | 158 const std::string& input_device_id) { |
| 159 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; | 159 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; |
| 160 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 160 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 161 return new OpenSLESOutputStream(this, params); | 161 return new OpenSLESOutputStream(this, params); |
| 162 } | 162 } |
| 163 | 163 |
| 164 AudioInputStream* AudioManagerAndroid::MakeLinearInputStream( | 164 AudioInputStream* AudioManagerAndroid::MakeLinearInputStream( |
| 165 const AudioParameters& params, const std::string& device_id) { | 165 const AudioParameters& params, const std::string& device_id) { |
| 166 // TODO(henrika): add support for device selection if/when any client |
| 167 // needs it. |
| 168 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; |
| 166 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 169 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
| 167 return new OpenSLESInputStream(this, params); | 170 return new OpenSLESInputStream(this, params); |
| 168 } | 171 } |
| 169 | 172 |
| 170 AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( | 173 AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( |
| 171 const AudioParameters& params, const std::string& device_id) { | 174 const AudioParameters& params, const std::string& device_id) { |
| 172 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 175 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 173 DLOG_IF(ERROR, device_id.empty()) << "Invalid device ID!"; | 176 DLOG_IF(ERROR, device_id.empty()) << "Invalid device ID!"; |
| 174 // Utilize the device ID to select the correct input device. | 177 // Utilize the device ID to select the correct input device. |
| 175 // Note that the input device is always associated with a certain output | 178 // Note that the input device is always associated with a certain output |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 j_audio_manager_.obj()); | 272 j_audio_manager_.obj()); |
| 270 } | 273 } |
| 271 | 274 |
| 272 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { | 275 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { |
| 273 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( | 276 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( |
| 274 base::android::AttachCurrentThread(), | 277 base::android::AttachCurrentThread(), |
| 275 j_audio_manager_.obj()); | 278 j_audio_manager_.obj()); |
| 276 } | 279 } |
| 277 | 280 |
| 278 } // namespace media | 281 } // namespace media |
| OLD | NEW |