summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-2/+2
| | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* AudioSystem: new audioflinger restart detectionEric Laurent2013-08-191-0/+8
| | | | | | | | | Add a specific method to AudioSystem for AudioService to poll for AudioFlinger service restart instead of relying on current callback mechanism which is flaky. Bug: 9693068. Change-Id: Ie88bc9d25033503bc5cd2fa9d8c754d0f8045b8f
* Use standard name and type for channel maskGlenn Kasten2013-07-241-4/+4
| | | | | | Former name 'channels' was ambiguous with respect to channel count. Change-Id: I716f792d95a7e0c787d27514ad6e93dbcef8a415
* Use AudioSystem::setLowRamDevice() to configure memoryGlenn Kasten2013-07-191-0/+7
| | | | | Bug: 9798886 Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
* Merge "Add comments"Glenn Kasten2013-07-171-0/+2
|\
| * Add commentsGlenn Kasten2013-07-101-0/+2
| | | | | | | | Change-Id: Ifbf3a46a4183c8abc0feee1c588953ab10303cc1
* | Merge "Fix typo in logs"Glenn Kasten2013-07-171-2/+2
|\ \ | |/ |/|
| * Fix typo in logsGlenn Kasten2013-07-021-2/+2
| | | | | | | | Change-Id: I889e31ea3a45a3d8d34fdfb54ebc3947de51d2be
* | Include what is neededGlenn Kasten2013-07-021-0/+1
|/ | | | | | | Remove old includes. Header files only include other header files that they directly need themselves. Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
* Public API changes for audio offload support.Richard Fitzgerald2013-06-271-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+10
| | | | | | Bug 7485803 Change-Id: I0744374f130fd2dd0714102354cffed2fa915361
* Use size_t for frame countsGlenn Kasten2012-11-151-6/+6
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* Use uint32_t for sample rateGlenn Kasten2012-11-141-6/+6
| | | | Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
* Remove deprecated AudioSystem methodsGlenn Kasten2012-11-131-10/+0
| | | | Change-Id: I952d504e03af9a1d3e1e0aa379c82dfb00197d9f
* Line length 100Glenn Kasten2012-11-011-6/+12
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Fix typoGlenn Kasten2012-10-261-1/+1
| | | | Change-Id: I8cc2969eb329a830ee866622a8633adcb4e967cc
* Support querying active record sourcesJean-Michel Trivi2012-10-101-0/+9
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
* Implement android.media.AudioManager.getProperty()Glenn Kasten2012-09-251-0/+13
| | | | | Bug: 6635041 Change-Id: I3386a4a6c226bc4eceaf65556119e4fb15f73224
* effect_descriptor_t const correctnessGlenn Kasten2012-07-251-2/+2
| | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* Use audio_channel_mask_t more placesGlenn Kasten2012-07-101-6/+6
| | | | | | | | | | 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
* Use audio_channel_mask_t more consistentlyGlenn Kasten2012-07-031-6/+6
| | | | | | | | | | | | | | | In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(), declare input parameter to use correct type audio_channel_mask_t. In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask instead of channel count. Remove unused IAudioFlinger::channelCount(audio_io_handle_t). In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(), input parameter is channel mask instead of channel count. Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
* Remove acoustics from AudioSystem::getInput()Glenn Kasten2012-06-251-2/+1
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* rename audio policy output flagsEric Laurent2012-04-181-1/+1
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* audio policy: add configuration fileEric Laurent2012-04-031-47/+33
| | | | | | | | | | | removed outputs to stream mapping cache in audio system: the output for a given stream type must always be queried from audio policy manager as the cache is not always updated fast enough by audioflinger callback. removed AudioFlinger::PlaybackThread::setStreamValid() not used anymore if stream to output mapping is not cached. Change-Id: Ieca720c0b292181f81247259c8a44359bc74c66b
* Whitespace and indentationGlenn Kasten2012-03-131-5/+4
| | | | | | | | | | | | | | 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
* Merge "audio policy: use audio_devices_t when appropriate"Eric Laurent2012-03-081-2/+2
|\
| * audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-2/+2
| | | | | | | | Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
* | IAudioFlingerClient::ioConfigChanged param2 constGlenn Kasten2012-03-061-5/+5
|/ | | | | | | | | The 3rd parameter (param2) to AudioFlingerClient::ioConfigChanged is used as an input. So changed it from void * to const void *. It is then cast to const OutputDescriptor * or const audio_stream_type_t * depending on the event. Change-Id: Ieec0d284f139b74b3389b5ef69c7935a8e5650ee
* Use audio_io_handle_t consistently instead of intGlenn Kasten2012-02-081-3/+6
| | | | | | | | Other: - add a comment to nextUniqueId - made ThreadBase::mId const, since it is only assigned in constructor. Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837
* Use NULL not 0 for raw pointersGlenn Kasten2012-02-031-6/+6
| | | | | | Use if (p != NULL) instead of if (ptr) Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
* More audio_stream_type_tGlenn Kasten2012-01-271-3/+4
| | | | Change-Id: I1260259efe0aa3fc1ef13de69758aaa592e1f815
* Use audio_source_t consistentlyGlenn Kasten2012-01-261-1/+1
| | | | | | | | | | | | | | | | 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
* Merge "Remove redundant get()"Glenn Kasten2012-01-201-2/+2
|\
| * Remove redundant get()Glenn Kasten2012-01-201-2/+2
| | | | | | | | | | | | | | get() is almost always unnecessary, except in a LOG. Also no need to check for != 0 before calling get(). Change-Id: Ib06e7a503f86cf102f09acc1ffb2ad085025516d
* | Merge "Remove dead setRingerMode(mode, mask)"Glenn Kasten2012-01-201-7/+0
|\ \ | |/ |/|
| * Remove dead setRingerMode(mode, mask)Glenn Kasten2012-01-181-7/+0
| | | | | | | | Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
* | Merge "Simplify range check for audio_mode_t (continued)"Glenn Kasten2012-01-191-0/+1
|\ \
| * | Simplify range check for audio_mode_t (continued)Glenn Kasten2012-01-181-0/+1
| |/ | | | | | | | | | | Missed one place in earlier CL of same name Change-Id: I0dd25364d0b8d5d731c02d352f139a0c8d4df1a8
* | Temporarily restore AudioSystem/AudioTrack APIs with their former signaturesAndreas Huber2012-01-181-0/+10
|/ | | | | | until we get updated prebuilts from vendor. Change-Id: I8aae81d2513edca0ab268053a11c8c4206879e61
* Merge "audio framework: manage stream volume per device"Eric Laurent2012-01-171-4/+8
|\
| * audio framework: manage stream volume per deviceEric Laurent2012-01-171-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14/+14
|/ | | | | | | | | 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
* Merge "Fix race in AudioSystem::getInputBufferSize"Glenn Kasten2012-01-111-9/+14
|\
| * Fix race in AudioSystem::getInputBufferSizeGlenn Kasten2012-01-101-9/+14
| | | | | | | | | | | | It was caching the recording parameters without a mutex. Change-Id: Ic4b9f621cbc080d224c2233cf3ca3454fc0f19bd
* | Simplify range check for audio_mode_tGlenn Kasten2012-01-101-1/+1
|/ | | | | | | | | | AudioSystem::setMode previously allowed negative modes, but these were then rejected by AudioFlinger. Now negative modes (including AUDIO_MODE_INVALID and AUDIO_MODE_CURRENT) are explicitly disallowed. Change-Id: I0bac8fea737c8eb1f5b6afbb893e48739f88d745
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-1/+1
| | | | | | | 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-6/+6
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69