summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioPolicyService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Explicit routing in AudioRecordPaul McLean2015-04-281-2/+5
| | | | Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
* audio policy: add binder calls for audio source controlEric Laurent2015-04-151-0/+59
| | | | | | | Add binder methods to IAudioPolicyService to control activity of external audio sources (e.g FM tuner). Change-Id: I2008308a6a996baeae502b68a790d87281efe2ff
* Adding explicit routing API to AudioTrackPaul McLean2015-04-081-1/+4
| | | | Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
* namespace does not need a closing semicolonGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: Ie8f9d42fc061f6d558f23b98414e04eb3d14b376
* audio policy service: fix possible memory overflowEric Laurent2015-02-061-2/+20
| | | | | | | | Add limit on number of audio ports and patches requested by listaudioPorts() and listAudioPatches(). Bug: 19261727. Change-Id: I21dfdf11cf805734cc3b7b2a85762c5598f60580
* Add additional info to AudioPort for enum/selection API.Paul McLean2015-02-051-2/+6
| | | | | | | | | | Add "device name" member to AudioPort. Moved unique device ID from DevicePort to AudioPort. Straighten out confusion between "name" and "address" Created string constants for Intent "extra" data keys. Combine card/address data into "address" at sender.Add additional info to AudioPort for enum/selection API. Change-Id: I1be308e12b09cd0ead9a3e9fbc9c385462299fb5
* Merge commit 'f5a968a0' into mmGlenn Kasten2014-12-101-1/+53
|\ | | | | | | Change-Id: Ifd30546c11def40ad483f27c9d7baa4008fcbac3
| * audio policy: binder calls for dynamic audio policy mixesEric Laurent2014-12-091-1/+53
| | | | | | | | | | | | | | | | | | Add binder calls to register and unregister dynamic mixes to AudioPolicyManager. Bug: 16009464. Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
* | am 390ef843: am f20c4356: Merge "AudioRecord: use audio attributes instead ↵Eric Laurent2014-11-271-22/+40
|\ \ | |/ | | | | | | | | | | of audio source." into lmp-mr1-dev * commit '390ef84373b7edd1397381f780ca235326357094': AudioRecord: use audio attributes instead of audio source.
| * AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-251-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added AudioRecord constructor with audio attributes. Replaced AudioPolicymanager::getInput() by getInputForAttr(). No new functionality for now. Also: - Fixed warnings in AudioPolicyManager - Allocate audio session ID before calling getOutputForAttr() in AudioTrack. Bug: 16006090. Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
* | am bf14c62e: am 72bf901c: Merge "audio policy: new getOutputForAttr() ↵Eric Laurent2014-11-261-31/+82
|\ \ | |/ | | | | | | | | | | prototype." into lmp-mr1-dev * commit 'bf14c62e7973ed793a3b00c2c67beca4484c1c7a': audio policy: new getOutputForAttr() prototype.
| * audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-31/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* | resolved conflicts for merge of e78a27ca to lmp-mr1-dev-plus-aospMarco Nelissen2014-11-171-1/+1
|\ \ | |/ |/| | | Change-Id: If10a9cc17245f95d5e10b1507445abbb4020670e
| * Update calls to IInterface::asBinder()Marco Nelissen2014-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp
* | Fix memory leakGlenn Kasten2014-11-061-3/+3
| | | | | | | | Change-Id: I3f4110a88679b7e7841f40c6acdbf5dcde40fb19
* | IAudioPolicyService: bound array size in queryDefaultPreProcessingEric Laurent2014-11-051-3/+6
|/ | | | | Bug: 18226810. Change-Id: Ib8e2bfe835a8681aac50bf23161db14e50c9a124
* audio: fix stream type for accessibility usageEric Laurent2014-09-251-1/+19
| | | | | | | | | Make sure that accessibility prompts are heard when a ringtone is active by forcing stream type to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE. Bug: 17558149. Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628
* Add sound trigger control by audio policyEric Laurent2014-08-051-1/+66
| | | | | | | | | | | | | | | | | Audio policy: - Added active capture indication to sound trigger service: recognition stops if concurrent capture is not supported. - Added generation of reserved I/O handle and session ID for utterance capture. Sound trigger service - Added sound model update callback handling. - Added service state callback - Simplified callback shared memory allocation. Bug: 12378680. Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
* audio policy: pass session ID to capture activity methodsEric Laurent2014-07-281-6/+15
| | | | | | | | Indicate the audio session ID when calling getInput(), startInput(), stopInput(), releaseInput(). Bug: 12378680. Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
* Add audio_input_flags_t to IAudioPolicyService::getInputGlenn Kasten2014-07-171-2/+6
| | | | Change-Id: I9f37be05f8dc7b85a8827a94e76ca0f45453e170
* AudioPolicyManager: return output for audio attributesJean-Michel Trivi2014-06-181-1/+56
| | | | | | | | | | In AudioPolicyManager, support querying an output or playback strategy for audio attributes, instead of a stream type, In AudioTrack creation, use the output returned for the track's attributes. Change-Id: I0fef05845ba676404775e2e338c10e6a96237268
* audio policy: new setAudioPortConfig implementationEric Laurent2014-06-041-2/+0
| | | | | | | | | | | | | | | | Rewrite setAudioPortConfig() to take advantage of the new AudioPortConfig class. The configuration is now checked against AudioPort capabilities and stored in the AudioPortConfig. Fix a bug where the config mask was not set properly when calling setAudioPortConfig at the PatchPanel interface. Remove debug log in IAudioPolicyService. Bug: 14815883. Change-Id: I7eb7683a96e049581c13f2a212486507883d008d
* audio policy: add routing update client interfaceEric Laurent2014-05-291-1/+16
| | | | | | | | | | | | | Added IAudioPolicyServiceClient client binder interface for client process to receive notifications from AudioPolicyService when audio ports are added/removed or audio patches created/released. The audio patches owned by a given client are automatically released when this client binder dies. Bug: 14815883. Change-Id: I6013f6aec03b50565cffb1ad2cd1f0f8852032c5
* DO NOT MERGE - IAudioPolicyService interface extension for patch panelEric Laurent2014-05-281-2/+226
| | | | Change-Id: I0a62e5416edc41c3a0e816275085ab18a23066f1
* Update commentsGlenn Kasten2014-03-261-0/+1
| | | | Change-Id: I5776313b9b49072cd666d28880f0d07cc73f827b
* audio policy service: clean up type casting.Eric Laurent2014-03-051-6/+8
| | | | Change-Id: If16d6495c16e0d61a221f81bfd49e7d14bbfdc12
* libmedia: offloaded playback supportRichard Fitzgerald2013-07-251-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | - start() returns a status so that upper layers can recreate a non offloaded track in case of error. - Added states to handle offloaded tracks specific: - waiting for stream end (drain) notification by audio flinger - allow pause while waiting for stream end notification - getPosition() queries the render position directly from audio HAL. - disable APIs not applicable to offloaded tracks - Modified track restoring behavior for invalidated offloaded tracks: just send the callback and wait for upper layers to create a new track. - Added wait for stream end management in audio track client proxy. Similar to obtainBuffer and should be factored in. Change-Id: I0fc48117946364cb255afd653195498891f622bd Signed-off-by: Eric Laurent <elaurent@google.com>
* Public API changes for audio offload support.Richard Fitzgerald2013-06-271-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: this does _not_ include all private member variables added to classes as part of offload support. Only public/protected functions and stubs functions/variables needed to make the changes buildable. - isOffloadSupported() added to audio policy service A stub implementation is required to build, this always returns false - setParameters() added to IAudioTrack A stub implementation is required to build, this always returns INVALID_OPERATION - CBlk flag for stream end - Change AudioSystem::getRenderPosition() to take an audio_output_t so caller can specify which output to query - Add AudioSystem::isOffloadSupported() This is fully implemented down to the AudioFlinger function AudioPolicyServer::isOffloadSupported() which is just a stub that always returns false. - Add EVENT_STREAM_END to AudioTrack interface. STREAM_END is used to signal when the hardware has actually finished playing all the data it was sent. - Add event type enumeration to media player interface AudioSink callbacks so that the same callback can be used to handle multiple types of event. For offloaded tracks we also have to handle STREAM_END and TEAR_DOWN events - Pass audio_offload_info_t to various functions used for opening outputs, tracks and audio players. This passes additional information about the compressed stream down to the HAL when using offload. For publicly-available APIs this is an optional parameter (for some of the internal and low-level APIs around the HAL interface it is mandatory) - Add getParameters() and setParameters() API to AudioTrack Currently dummy implementations. - Change AudioPlayer contructor so that it takes a set of bitflags defining what options are required. This replaces the original bool which only specified whether to use deep buffering. - Changes to StageFright class definition related to handling tearing-down of an offloaded track when we need to switch back to software decode - Define new StageFright utility functions used for offloaded tracks Currently dummy implementations. - AudioFlinger changes to use extended audio_config_t. Fills in audio_offload_info_t member if this info is passed in when opening an output. - libvideoeditor changes required to add the new event type parameter to AudioSink callback functions - libmediaplayerservice changes required to add the new event type parameter to AudioSink callback functions Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
* Add support for querying if a stream is active remotelyJean-Michel Trivi2013-02-111-1/+20
| | | | | | Bug 7485803 Change-Id: I0744374f130fd2dd0714102354cffed2fa915361
* Line length 100Glenn Kasten2012-11-011-3/+6
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Support querying active record sourcesJean-Michel Trivi2012-10-101-0/+17
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
* effect_descriptor_t const correctnessGlenn Kasten2012-07-251-2/+2
| | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* Use audio_channel_mask_t more placesGlenn Kasten2012-07-101-8/+8
| | | | | | | | | | Use it in AudioSystem::getOutput(), AudioSystem::getInput(), IAudioPolicyService::getOutput(), IAudioPolicyService::getInput(), and various other places in AudioFlinger. Not done: AudioTrack and OutputDescriptor. Change-Id: I70e83455820bd8f05dafd30c63d636c6a47cd172
* Remove acoustics from AudioSystem::getInput()Glenn Kasten2012-06-251-5/+0
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* rename audio policy output flagsEric Laurent2012-04-181-3/+3
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* Whitespace and indentationGlenn Kasten2012-03-131-1/+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
* audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-2/+2
| | | | Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
* Use audio_source_t consistentlyGlenn Kasten2012-01-261-3/+3
| | | | | | | | | | | | | | | | Was a mix of audio_source_t, uint8_t, and int. Related fixes: - fix comments in MediaRecorder.java - AudioPolicyService server side was not checking source parameter at all, so if the client wrapper was bypassed, invalid values could be passed into audio HAL - JNI android_media_AudioRecord_setup was checking source for positive values, but not negative values. This test is redundant, since already checked at Java and now checked by AudioPolicyService also, but might as well make it correct. Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
* Use audio_format_t consistently, continuedGlenn Kasten2012-01-201-4/+4
| | | | | | | | | | | | Was int or uint32_t. When AudioFlinger::format can't determine the correct format, return INVALID rather than DEFAULT. Init mFormat to INVALID rather than DEFAULT in the constructor. Subclass constructors will set mFormat to the correct value. Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
* Remove dead setRingerMode(mode, mask)Glenn Kasten2012-01-181-19/+1
| | | | Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
* Merge "audio framework: manage stream volume per device"Eric Laurent2012-01-171-4/+15
|\
| * audio framework: manage stream volume per deviceEric Laurent2012-01-171-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve volume management by keeping track of volume for each type of device independently. Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained per device. The main changes are: - AudioService now keeps tracks of stream volumes per device: volume indexes are kept in a HashMap < device , index>. active device is queried from policy manager when a volume change request is received initalization, mute and unmute happen on all device simultaneously - Settings: suffixes is added to volume keys to store each device volume independently. - AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument to setStreamVolumeIndex() and getStreamVolumeIndex() to address each device independently. - AudioPolicyManagerBase: keep track of stream volumes for each device and apply volume according to current device selection. Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
* | Merge "Use audio_mode_t consistently"Glenn Kasten2012-01-171-2/+2
|\ \ | |/ |/|
| * Use audio_mode_t consistentlyGlenn Kasten2012-01-121-2/+2
| | | | | | | | | | | | | | It was int or uint32_t. Also make getMode() const. Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
* | Use audio_stream_type_t consistentlyGlenn Kasten2012-01-131-6/+6
|/ | | | | | | | | At native level it was a mixture of audio_stream_type_t, int, uint32_t, and uint8_t. Java is still int. Also fixed a couple of hard-coded -1 instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0 instead of AUDIO_STREAM_VOICE_CALL. Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
* Audio effects: track CPU and memory use separatelyEric Laurent2011-08-111-1/+20
| | | | | | | | | | | | | | | | | | | | | | Before this change, CPU and memory usage for an audio effect were registered and checked against the limit by audio policy manager upon effect instantiation. Even if an effect was not enabled it would prevent another effect to be created if the CPU load budget was exceeded, which was too restrictive. This change adds a method to register/unregister CPU load only when an effect is enabled or disabled. It also adds a mechanism to place all effects on the global output mix in suspend state (disabled) when an effect is enabled on a specific session. This will allow applications using session effects to have the priority over others using global effects. Also fixes some issues with suspend/restore mechanism: - avoid taking actions when an effect is disconnected and was not enabled. - do not remove a session from the suspended sessions list when corresponding effect chain is destroyed. Change-Id: I5225278aba1ae13d0d0997bfe26a0c9fb46b17d3
* Added APIs for audio preprocessingEric Laurent2011-07-251-0/+49
| | | | | | | | | | | | | | | 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-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* update for new audio.h header locationDima Zavin2011-05-121-1/+1
| | | | | Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876 Signed-off-by: Dima Zavin <dima@android.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-46/+48
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>