summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioEffect.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use only strong references to AudioEffectEric Laurent2015-06-081-4/+7
| | | | | | | | | | | | Do not refer to an AudioEffect instance by a raw pointer from the child AudioEffectClient. Also align destructor cleanup sequence on those of AudioTrack and AudioRecord. Bug: 21629892. Change-Id: I970307aedbc38db2e41a2cc652fd6df9112f712c
* Respect the record audio app op - mediaSvet Ganov2015-04-291-5/+7
| | | | Change-Id: I3a97977b6e9a09355e2008f780d22d480fb7308b
* namespace does not need a closing semicolonGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: Ie8f9d42fc061f6d558f23b98414e04eb3d14b376
* Update calls to IInterface::asBinder()Marco Nelissen2014-11-141-2/+2
| | | | | | to use the new static version. Change-Id: I89a5988a0ac694ffc04d88cf939e8455bf925d4c
* AudioEffect acquires sessionJean-Michel Trivi2014-09-181-3/+10
| | | | | | | | | | | | | | | Currently, users of audio sessions, AudioTrack and AudioRecord, are acquiring and releasing audio sessions according to their life-cycle. AudioEffect instances were not counting as users of an audio session. This caused an effect used on a session to be purged by AudioFlinger::purgeStaleEffects_l() whenever the last user of that session went away. This CL makes AudioEffect acquire and release a session when created and destroyed. Bug 15432115 Change-Id: I922532150009988d43872f9b5928044a830ae0b3
* Fix unused parameter warnings in audioGlenn Kasten2014-02-031-2/+2
| | | | Change-Id: I665ba3358dd9502f0adec70d486e7bf8a2e1b0fe
* Remove unnecessary parameterGlenn Kasten2012-12-181-1/+1
| | | | | | Just get the parameter on server side Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
* Line length 100Glenn Kasten2012-11-011-7/+14
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Use struct assignment instead of explicit memcpyGlenn Kasten2012-07-171-10/+3
| | | | | | for POD structs effect_descriptor_t and effect_config_t Change-Id: Ib2fc47f85fb65ed91b0abb1f87217c49b5eb571d
* Whitespace and indentationGlenn Kasten2012-03-131-2/+1
| | | | | | | | | | | | | | Fix indentation to be multiple of 4. Make it easier to search: sp< not sp < to "switch (...)" instead of "switch(...)" (also "if" and "while") Remove redundant blank line at start or EOF. Remove whitespace at end of line. Remove extra blank lines where they don't add value. Use git diff -b or -w to verify. Change-Id: I966b7ba852faa5474be6907fb212f5e267c2874e
* Fix build warningGlenn Kasten2012-02-221-4/+4
| | | | | | | warning: pointer of type 'void *' used in arithmetic warning: enumeral and non-enumeral type in conditional expression Change-Id: I7b8d626a636145ef648e3b5d0e77068216dd012e
* Enhance Visualizer behavior in the case of mediaserver death.John Grossman2012-02-161-7/+7
| | | | | | | | | | | | | | | | | Bring the Visualizer class into line with the SDK documentation by returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when the Visualizer loses its binder connection to the mediaserver because of a mediaserver restart. Also add a new callback interface to allow clients to be asynchronously notified in the case of server death. Right now, the interface definition and the registration method are flagged as hidden pending API council review/approval. See http://b/issue?id=5717519 for details. Change-Id: Ic15856f27ed5a950a583ac11ca81f79bd7e9b1a0 Signed-off-by: John Grossman <johngro@google.com>
* No newline or space at end of ALOG format stringGlenn Kasten2012-02-081-1/+1
| | | | Change-Id: I0bef580cbc818cb7c87aea23919d26f1446cec32
* Effect UUID inputs passed by pointer are constGlenn Kasten2012-02-081-1/+1
| | | | Change-Id: I1f5c338bcb7368e3dd8cd5f804b2e6d9fbe087f8
* Declare more IAudioFlinger methods constGlenn Kasten2012-02-031-1/+2
| | | | | | | This is just documentation, as C++ method const-ness doesn't mean anything for a binder API. Instead, here const means "no side effects". Change-Id: Iaa9cd2fe477db10ae9a40cac4f79f0faa9b4e5e6
* Use NULL not 0 for raw pointersGlenn Kasten2012-02-031-4/+4
| | | | | | Use if (p != NULL) instead of if (ptr) Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-3/+3
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-3/+3
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-11/+11
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Added APIs for audio preprocessingEric Laurent2011-07-251-0/+9
| | | | | | | | | | | | | | | Added APIs to control pre processes applied on captured audio. Those APIs are still hidden until reviewed by API council. Three types of standard pre processes are supported: - Automatic Gain Control (AGC) by AutomaticGainControl class - Acoustic Echo Cancellation (AEC) by AcousticEchoCanceler class - Noise Suppression (NS) by NoiseSuppressor class A method is added to AudioEffect class to query audio pre processings applied by default by the platform on a given AudioRecord session ID. Change-Id: I0b9fceeb8c704dd06319c3b52b85c96fe871d51d
* Audio framework: support for audio pre processingEric Laurent2011-07-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Audio effect framework is extended to suport effects on output and input audio path. AudioFlinger: Support for audio effects and effect chains is moved from PlaybackThread class to ThreadBase class so that RecordThread can manage effects. Effects of type pre processing are allowed on record thread only. When a pre processing is enabled, the effect interface handle is passed down to the input stream so that the audio HAL can call the process function. The record thread loop calls the effect chain process function that will only manage the effect state and commands and skip the process function. AudioRecord: The audio session is allocated before calling getInput() into audio policy serice so that the session is known before the input theead is created and pre processings can be created on the correct session. AudioPolicyService: default pre processing for a given input source are loaded from audio_effects.conf file. When an input is created, corresponding effects are created and enabled. Change-Id: Id17119e0979b4dcf189b5c7957fec30dc3478790
* Removed interface to load audio effects librariesEric Laurent2011-05-271-14/+0
| | | | | | | Removed unused functions allowing dynamic loading of audio effects libraries from effects factory API. Change-Id: I06cc5a51dc10aca87c7a8687bbb874babd711eca
* Do not disable effect in AudioEffect destructor.Eric Laurent2011-04-071-1/+0
| | | | | | | | | | Current implementation of AudioEffect class destructor disables the effect before disconnecting from IAudioEffect interface. This is problematic when more than one client has a handle on the same effect engine as destroying one handle will disable the effect which is not the intended behavior. Change-Id: I10eacf981506469a7ef4eb9a1650813f0848de5d
* Fix issue 3157123.Eric Laurent2010-11-191-28/+27
| | | | | | | Use a Mutex wherever atomic operations were used in AudioTrack, AudioRecord, AudioFlinger and AudioEffect classes. Change-Id: I6f55b2cabdcd93d64ef19446735b8f33720f8dbc
* Fix error in AudioEffect command status reporting.Eric Laurent2010-09-241-9/+17
| | | | | | | | | | | | AudioEffect::command() should not interpret the status returned in pReplyData unless the command is ENABLE or DISABLE. Also fixed: - bug in Visualizer::getWAveForm() status reporting. - wrong initialization value for capture buffer in visualizer engine. Change-Id: I60fb0011f9dba96ee74661dec1e8ef441edcaf35
* Fixed several audio effects problems.Eric Laurent2010-08-091-3/+22
| | | | | | | | | | - Fixed constant inversions in AudioEffect.java - Do not return error when enabling an already enabled effect - Update cached effect state in native AudioEffect class when effect is enabled/disabled by command() method - Remove click when restarting effect during disable sequence - Fixed problem in master mute management when volume control is delegated to effect. Change-Id: I6df4ce9fcc54fdc7345df858f639d20d802d6712
* Audio effects: modified command() parameter types.Eric Laurent2010-07-281-6/+14
| | | | | | | The type of the cmd, cmdSize and *pReplySize parameters of the effect control interface command() function have been modified from int to uint32_t. This is more consistent with their role. Change-Id: I84d289fc262d6753747910f06f485597dfee6591
* Fix swap of sessionId and output in audio effect API.Jean-Michel Trivi2010-07-091-2/+2
| | | | Change-Id: Idc93415efef92087507401e50cfb235a6f1f7ed7
* Added Visualizer effect.Eric Laurent2010-07-071-22/+14
| | | | | | | | | | | | | | The visualizer enables application to retrieve part of the currently playing audio for visualization purpose. It is not an audio recording interface and only returns partial and low quality audio content as a waveform or a frequency representation (FFT). Removed temporary hack made in MediaPlayer for animated wall papers based on audio visualization (snoop() method. This commit also includes a change in AudioEffect class: - the enable()/disable() methods have been replaced bya more standard setEnabled() method. - some fixes in javadoc Change-Id: Id092a1340e9e38dae68646ade7be054e3a36980e
* Various fixes and improvements in audio effects implementationEric Laurent2010-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Effect API: - Use different definitions for audio device, channels, formats... in AudioSystem and EffectApi: Removed media/AudioCommon.h file created for initial version of EffectApi - Indicate audio session and output ID to effect library when calling EffectCreate(). Session ID can be useful to optimize the implementation of effect chains in the same audio session. Output ID can be used for effects implemented in audio hardware. - Renamed EffectQueryNext() function to EffectQueryEffect() and changed operating mode: now an index is passed for the queried effect instead of implicitly querying the next one. - Added CPU load and memory usage indication in effects descriptor - Added flags and commands to indicate changes in audio mode (ring tone, in call...) to effect engine - Added flag to indicate hardware accelerated effect implementation. - Renamed EffectFactoryApi.h to EffectsFactoryApi.h for consistency with EffectsFactory.c/h Effect libraries: - Reflected changes in Effect API - Several fixes in reverb implementation - Added build option TEST_EFFECT_LIBRARIES in makefile to prepare integration of actual effect library. - Replaced pointer by integer identifier for library handle returned by effects factory Audio effect framework: - Added support for audio session -1 in preparation of output stage effects configuration. - Reflected changes in Effect API - Removed volume ramp up/down when effect is inserted/removed: this has to be taken care of by effect engines. - Added some overflow verification on indexes used for deferred parameter updates via shared memory - Added hardcoded CPU and memory limit check when creating a new effect instance Change-Id: I43fee5182ee201384ea3479af6d0acb95092901d
* Issue 2667802: [Audio Effect Framework] AudioEffect base class and JNI.Eric Laurent2010-06-111-0/+462
Added AudioEffect C++ class. AudioEffect is the base class for effect specific implementations, OpenSL ES effect interfaces and audio effect JNI. Added the AudioEffect JNI and AudioEffect JAVA class. AudioEffect is the base class to implement more specific JAVA classes to control audio effects from JAVA applications. Change-Id: If300a1b708f2e6605891261e67bfb4f8330a4624