Chromium Code Reviews| Index: webrtc/modules/audio_device/android/opensles_player.h |
| diff --git a/webrtc/modules/audio_device/android/opensles_player.h b/webrtc/modules/audio_device/android/opensles_player.h |
| index 4058ff999488dc421a8ec5ae119be8539bb4cded..247eb224259bfde6b55b93fba429ab0af412c62f 100644 |
| --- a/webrtc/modules/audio_device/android/opensles_player.h |
| +++ b/webrtc/modules/audio_device/android/opensles_player.h |
| @@ -55,12 +55,6 @@ class OpenSLESPlayer { |
| // audio manager at construction. |
| static const int kNumOfOpenSLESBuffers = 4; |
| - // There is no need for this class to use JNI. |
| - static int32_t SetAndroidAudioDeviceObjects(void* javaVM, void* context) { |
| - return 0; |
| - } |
| - static void ClearAndroidAudioDeviceObjects() {} |
| - |
| explicit OpenSLESPlayer(AudioManager* audio_manager); |
| ~OpenSLESPlayer(); |
| @@ -103,9 +97,9 @@ class OpenSLESPlayer { |
| // via the SLAndroidSimpleBufferQueueItf interface. |
| void AllocateDataBuffers(); |
| - // Creates/destroys the main engine object and the SLEngineItf interface. |
| - bool CreateEngine(); |
| - void DestroyEngine(); |
| + // Gets the SL Engine Interface from the existing global Engine object. |
| + // This interface exposes creation methods of all the OpenSL ES object types. |
| + bool GetEngineInterface(); |
|
magjed_webrtc
2016/05/31 11:24:07
I don't think calling this function 'GetEngineInte
henrika_webrtc
2016/05/31 12:04:03
Good point. However, the OpenSL ES API is a bit me
|
| // Creates/destroys the output mix object. |
| bool CreateMix(); |
| @@ -127,6 +121,11 @@ class OpenSLESPlayer { |
| // Detached during construction of this object. |
| rtc::ThreadChecker thread_checker_opensles_; |
| + // Raw pointer to the audio manager injected at construction. Used to cache |
| + // audio parameters and to access the global SL engine object needed by the |
| + // GetEngineInterface() method. |
| + AudioManager* audio_manager_; |
|
magjed_webrtc
2016/05/31 11:24:07
Can you comment on the lifetime of AudioManager? I
henrika_webrtc
2016/05/31 12:04:03
Done.
|
| + |
| // Contains audio parameters provided to this class at construction by the |
| // AudioManager. |
| const AudioParameters audio_parameters_; |
| @@ -169,10 +168,6 @@ class OpenSLESPlayer { |
| // Example (kNumOfOpenSLESBuffers = 2): counts 0, 1, 0, 1, ... |
| int buffer_index_; |
| - // The engine object which provides the SLEngineItf interface. |
| - // Created by the global Open SL ES constructor slCreateEngine(). |
| - webrtc::ScopedSLObjectItf engine_object_; |
| - |
| // This interface exposes creation methods for all the OpenSL ES object types. |
| // It is the OpenSL ES API entry point. |
| SLEngineItf engine_; |