| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 private: | 79 private: |
| 80 // These callback methods are called when data is required for playout. | 80 // These callback methods are called when data is required for playout. |
| 81 // They are both called from an internal "OpenSL ES thread" which is not | 81 // They are both called from an internal "OpenSL ES thread" which is not |
| 82 // attached to the Dalvik VM. | 82 // attached to the Dalvik VM. |
| 83 static void SimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf caller, | 83 static void SimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf caller, |
| 84 void* context); | 84 void* context); |
| 85 void FillBufferQueue(); | 85 void FillBufferQueue(); |
| 86 // Reads audio data in PCM format using the AudioDeviceBuffer. | 86 // Reads audio data in PCM format using the AudioDeviceBuffer. |
| 87 // Can be called both on the main thread (during Start()) and from the | 87 // Can be called both on the main thread (during Start()) and from the |
| 88 // internal audio thread while output streaming is active. | 88 // internal audio thread while output streaming is active. |
| 89 void EnqueuePlayoutData(); | 89 // If the |silence| flag is set, the audio is filled with zeros instead of |
| 90 // asking the WebRTC layer for real audio data. This procedure is also known |
| 91 // as audio priming. |
| 92 void EnqueuePlayoutData(bool silence); |
| 90 | 93 |
| 91 // Allocate memory for audio buffers which will be used to render audio | 94 // Allocate memory for audio buffers which will be used to render audio |
| 92 // via the SLAndroidSimpleBufferQueueItf interface. | 95 // via the SLAndroidSimpleBufferQueueItf interface. |
| 93 void AllocateDataBuffers(); | 96 void AllocateDataBuffers(); |
| 94 | 97 |
| 95 // Obtaines the SL Engine Interface from the existing global Engine object. | 98 // Obtaines the SL Engine Interface from the existing global Engine object. |
| 96 // The interface exposes creation methods of all the OpenSL ES object types. | 99 // The interface exposes creation methods of all the OpenSL ES object types. |
| 97 // This method defines the |engine_| member variable. | 100 // This method defines the |engine_| member variable. |
| 98 bool ObtainEngineInterface(); | 101 bool ObtainEngineInterface(); |
| 99 | 102 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // properties. This interface is supported on the Audio Player object. | 187 // properties. This interface is supported on the Audio Player object. |
| 185 SLVolumeItf volume_; | 188 SLVolumeItf volume_; |
| 186 | 189 |
| 187 // Last time the OpenSL ES layer asked for audio data to play out. | 190 // Last time the OpenSL ES layer asked for audio data to play out. |
| 188 uint32_t last_play_time_; | 191 uint32_t last_play_time_; |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace webrtc | 194 } // namespace webrtc |
| 192 | 195 |
| 193 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_PLAYER_H_ | 196 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_PLAYER_H_ |
| OLD | NEW |