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

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

Issue 2420583002: Revert of Android audio playout now supports non-call media streams (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
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 29 matching lines...) Expand all
40 // allows calls like JavaAudioManager::Close() while hiding the Java/JNI 40 // allows calls like JavaAudioManager::Close() while hiding the Java/JNI
41 // parts that are associated with this call. 41 // parts that are associated with this call.
42 class JavaAudioManager { 42 class JavaAudioManager {
43 public: 43 public:
44 JavaAudioManager(NativeRegistration* native_registration, 44 JavaAudioManager(NativeRegistration* native_registration,
45 std::unique_ptr<GlobalRef> audio_manager); 45 std::unique_ptr<GlobalRef> audio_manager);
46 ~JavaAudioManager(); 46 ~JavaAudioManager();
47 47
48 bool Init(); 48 bool Init();
49 void Close(); 49 void Close();
50 void SetCommunicationMode(bool enable);
51 bool IsCommunicationModeEnabled(); 50 bool IsCommunicationModeEnabled();
52 bool IsDeviceBlacklistedForOpenSLESUsage(); 51 bool IsDeviceBlacklistedForOpenSLESUsage();
53 52
54 private: 53 private:
55 std::unique_ptr<GlobalRef> audio_manager_; 54 std::unique_ptr<GlobalRef> audio_manager_;
56 jmethodID init_; 55 jmethodID init_;
57 jmethodID dispose_; 56 jmethodID dispose_;
58 jmethodID set_communication_mode_;
59 jmethodID is_communication_mode_enabled_; 57 jmethodID is_communication_mode_enabled_;
60 jmethodID is_device_blacklisted_for_open_sles_usage_; 58 jmethodID is_device_blacklisted_for_open_sles_usage_;
61 }; 59 };
62 60
63 AudioManager(); 61 AudioManager();
64 ~AudioManager(); 62 ~AudioManager();
65 63
66 // Sets the currently active audio layer combination. Must be called before 64 // Sets the currently active audio layer combination. Must be called before
67 // Init(). 65 // Init().
68 void SetActiveAudioLayer(AudioDeviceModule::AudioLayer audio_layer); 66 void SetActiveAudioLayer(AudioDeviceModule::AudioLayer audio_layer);
69 67
70 // Creates and realizes the main (global) Open SL engine object and returns 68 // Creates and realizes the main (global) Open SL engine object and returns
71 // a reference to it. The engine object is only created at the first call 69 // a reference to it. The engine object is only created at the first call
72 // since OpenSL ES for Android only supports a single engine per application. 70 // since OpenSL ES for Android only supports a single engine per application.
73 // Subsequent calls returns the already created engine. The SL engine object 71 // Subsequent calls returns the already created engine. The SL engine object
74 // is destroyed when the AudioManager object is deleted. It means that the 72 // is destroyed when the AudioManager object is deleted. It means that the
75 // engine object will be the first OpenSL ES object to be created and last 73 // engine object will be the first OpenSL ES object to be created and last
76 // object to be destroyed. 74 // object to be destroyed.
77 // Note that NULL will be returned unless the audio layer is specified as 75 // Note that NULL will be returned unless the audio layer is specified as
78 // AudioDeviceModule::kAndroidOpenSLESAudio or 76 // AudioDeviceModule::kAndroidOpenSLESAudio or
79 // AudioDeviceModule::kAndroidJavaInputAndOpenSLESOutputAudio. 77 // AudioDeviceModule::kAndroidJavaInputAndOpenSLESOutputAudio.
80 SLObjectItf GetOpenSLEngine(); 78 SLObjectItf GetOpenSLEngine();
81 79
82 // Initializes the audio manager and stores the current audio mode. 80 // Initializes the audio manager and stores the current audio mode.
83 bool Init(); 81 bool Init();
84 // Revert any setting done by Init(). 82 // Revert any setting done by Init().
85 bool Close(); 83 bool Close();
86 84
87 // Set audio mode to AudioManager.MODE_IN_COMMUNICATION if |enable| is true
88 // and AudioManager.MODE_NORMAL otherwise.
89 void SetCommunicationMode(bool enable);
90 // Returns true if current audio mode is AudioManager.MODE_IN_COMMUNICATION. 85 // Returns true if current audio mode is AudioManager.MODE_IN_COMMUNICATION.
91 bool IsCommunicationModeEnabled() const; 86 bool IsCommunicationModeEnabled() const;
92 87
93 // Native audio parameters stored during construction. 88 // Native audio parameters stored during construction.
94 const AudioParameters& GetPlayoutAudioParameters(); 89 const AudioParameters& GetPlayoutAudioParameters();
95 const AudioParameters& GetRecordAudioParameters(); 90 const AudioParameters& GetRecordAudioParameters();
96 91
97 // Returns true if the device supports built-in audio effects for AEC, AGC 92 // Returns true if the device supports built-in audio effects for AEC, AGC
98 // and NS. Some devices can also be blacklisted for use in combination with 93 // and NS. Some devices can also be blacklisted for use in combination with
99 // platform effects and these devices will return false. 94 // platform effects and these devices will return false.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Contains native parameters (e.g. sample rate, channel configuration). 197 // Contains native parameters (e.g. sample rate, channel configuration).
203 // Set at construction in OnCacheAudioParameters() which is called from 198 // Set at construction in OnCacheAudioParameters() which is called from
204 // Java on the same thread as this object is created on. 199 // Java on the same thread as this object is created on.
205 AudioParameters playout_parameters_; 200 AudioParameters playout_parameters_;
206 AudioParameters record_parameters_; 201 AudioParameters record_parameters_;
207 }; 202 };
208 203
209 } // namespace webrtc 204 } // namespace webrtc
210 205
211 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_ 206 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_device_unittest.cc ('k') | webrtc/modules/audio_device/android/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698