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

Side by Side Diff: media/audio/android/audio_manager_android.cc

Issue 99063002: Device enumeration on Android now thread safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years 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 | « no previous file | media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java » ('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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698