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

Unified Diff: webrtc/modules/audio_device/android/audio_manager.h

Issue 2019223004: Moves ownership of OpenSL engine object to Android audio manager (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from magjed@ Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/audio_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/audio_manager.h
diff --git a/webrtc/modules/audio_device/android/audio_manager.h b/webrtc/modules/audio_device/android/audio_manager.h
index aa51d092d0ffb323a261b7f4b280e159bd51d33c..808417ca9d8439fac5adc0f0e8c2e1e0a76ffc7b 100644
--- a/webrtc/modules/audio_device/android/audio_manager.h
+++ b/webrtc/modules/audio_device/android/audio_manager.h
@@ -14,11 +14,13 @@
#include <memory>
#include <jni.h>
+#include <SLES/OpenSLES.h>
#include "webrtc/base/thread_checker.h"
#include "webrtc/modules/audio_device/android/audio_common.h"
#include "webrtc/modules/audio_device/audio_device_config.h"
#include "webrtc/modules/audio_device/include/audio_device_defines.h"
+#include "webrtc/modules/audio_device/android/opensles_common.h"
#include "webrtc/modules/audio_device/audio_device_generic.h"
#include "webrtc/modules/utility/include/helpers_android.h"
#include "webrtc/modules/utility/include/jvm_android.h"
@@ -63,6 +65,18 @@ class AudioManager {
// Init().
void SetActiveAudioLayer(AudioDeviceModule::AudioLayer audio_layer);
+ // Creates and realizes the main (global) Open SL engine object and returns
+ // a reference to it. The engine object is only created at the first call
+ // since OpenSL ES for Android only supports a single engine per application.
+ // Subsequent calls returns the already created engine. The SL engine object
+ // is destroyed when the AudioManager object is deleted. It means that the
+ // engine object will be the first OpenSL ES object to be created and last
+ // object to be destroyed.
+ // Note that NULL will be returned unless the audio layer is specified as
+ // AudioDeviceModule::kAndroidOpenSLESAudio or
+ // AudioDeviceModule::kAndroidJavaInputAndOpenSLESOutputAudio.
+ SLObjectItf GetOpenSLEngine();
+
// Initializes the audio manager and stores the current audio mode.
bool Init();
// Revert any setting done by Init().
@@ -143,8 +157,17 @@ class AudioManager {
// Wraps the Java specific parts of the AudioManager.
std::unique_ptr<AudioManager::JavaAudioManager> j_audio_manager_;
+ // Contains the selected audio layer specified by the AudioLayer enumerator
+ // in the AudioDeviceModule class.
AudioDeviceModule::AudioLayer audio_layer_;
+ // This object is the global entry point of the OpenSL ES API.
+ // After creating the engine object, the application can obtain this object‘s
+ // SLEngineItf interface. This interface contains creation methods for all
+ // the other object types in the API. None of these interface are realized
+ // by this class. It only provides access to the global engine object.
+ webrtc::ScopedSLObjectItf engine_object_;
+
// Set to true by Init() and false by Close().
bool initialized_;
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698