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

Side by Side Diff: webrtc/modules/audio_device/android/opensles_player.h

Issue 2410033002: AudioTransport::NeedMorePlayData is no longer called from different threads using OpenSL ES on Andr… (Closed)
Patch Set: Created 4 years, 2 months 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
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/opensles_player.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/opensles_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698