OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // Stores thread ID in first call to SimpleBufferQueueCallback() from internal | 124 // Stores thread ID in first call to SimpleBufferQueueCallback() from internal |
125 // non-application thread which is not attached to the Dalvik JVM. | 125 // non-application thread which is not attached to the Dalvik JVM. |
126 // Detached during construction of this object. | 126 // Detached during construction of this object. |
127 rtc::ThreadChecker thread_checker_opensles_; | 127 rtc::ThreadChecker thread_checker_opensles_; |
128 | 128 |
129 // Contains audio parameters provided to this class at construction by the | 129 // Contains audio parameters provided to this class at construction by the |
130 // AudioManager. | 130 // AudioManager. |
131 const AudioParameters audio_parameters_; | 131 const AudioParameters audio_parameters_; |
132 | 132 |
| 133 // Contains the stream type provided to this class at construction by the |
| 134 // AudioManager. Possible input values are: |
| 135 // - AudioManager.STREAM_VOICE_CALL = 0 |
| 136 // - AudioManager.STREAM_RING = 2 |
| 137 // - AudioManager.STREAM_MUSIC = 3 |
| 138 // These value are mapped to the corresponding audio playback stream type |
| 139 // values in the "OpenSL ES domain": |
| 140 // - SL_ANDROID_STREAM_VOICE <=> STREAM_VOICE_CALL (0) |
| 141 // - SL_ANDROID_STREAM_RING <=> STREAM_RING (2) |
| 142 // - SL_ANDROID_STREAM_MEDIA <=> STREAM_MUSIC (3) |
| 143 // when creating the audio player. See SLES/OpenSLES_AndroidConfiguration.h |
| 144 // for details. |
| 145 const int stream_type_; |
| 146 |
133 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the | 147 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the |
134 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create(). | 148 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create(). |
135 AudioDeviceBuffer* audio_device_buffer_; | 149 AudioDeviceBuffer* audio_device_buffer_; |
136 | 150 |
137 bool initialized_; | 151 bool initialized_; |
138 bool playing_; | 152 bool playing_; |
139 | 153 |
140 // PCM-type format definition. | 154 // PCM-type format definition. |
141 // TODO(henrika): add support for SLAndroidDataFormat_PCM_EX (android-21) if | 155 // TODO(henrika): add support for SLAndroidDataFormat_PCM_EX (android-21) if |
142 // 32-bit float representation is needed. | 156 // 32-bit float representation is needed. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 SLAndroidSimpleBufferQueueItf simple_buffer_queue_; | 207 SLAndroidSimpleBufferQueueItf simple_buffer_queue_; |
194 | 208 |
195 // This interface exposes controls for manipulating the object’s audio volume | 209 // This interface exposes controls for manipulating the object’s audio volume |
196 // properties. This interface is supported on the Audio Player object. | 210 // properties. This interface is supported on the Audio Player object. |
197 SLVolumeItf volume_; | 211 SLVolumeItf volume_; |
198 }; | 212 }; |
199 | 213 |
200 } // namespace webrtc | 214 } // namespace webrtc |
201 | 215 |
202 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_PLAYER_H_ | 216 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_PLAYER_H_ |
OLD | NEW |