summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | AudioRecord::getInputFramesLost() cleanupGlenn Kasten2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug that if the binder call failed (for example if the IAudioFlinger binder is dead), then getInputFramesLost was returning garbage. Now it correctly returns zero, which is the error value for this method. The type declarations for getInputFramesLost were inconsistent: a mixture of unsigned int, size_t, and uint32_t. Now it returns uint32_t everywhere, which is what the underlying HAL API returns. Added a FIXME about the side effect behavior. This will need review for multi-client. Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
* | | Merge "Fix error handling in AudioSystem::getOutputForEffect"Glenn Kasten2014-01-151-1/+2
|\ \ \ | |/ / |/| |
| * | Fix error handling in AudioSystem::getOutputForEffectGlenn Kasten2014-01-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | and AudioPolicyService::getOutputForEffect. The conventional error value for audio_io_handle_t is 0, not a status_t cast to audio_io_handle_t. Change-Id: I34b3fd1a50f3fa1cbf39f32eea1911112a4e094a
* | | Merge "Cleanup AudioSystem::getInputBufferSize error handling and caching"Glenn Kasten2014-01-091-4/+10
|\ \ \
| * | | Cleanup AudioSystem::getInputBufferSize error handling and cachingGlenn Kasten2014-01-081-4/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if the IAudioFlinger::getInputBufferSize failed, it would return NO_ERROR but a zero buffer size value, which could confuse the caller. Now it returns BAD_VALUE in this case. Also it would still cache the zero buffer size. Now it does not cache on failure. Removed over-initialization of the cache globals. Change-Id: I6835fcb56fe52535e018fc8c0c242115221b5d85
* | | Cleanup error handling in AudioSystem get methodsGlenn Kasten2014-01-081-0/+10
|/ / | | | | | | | | | | Don't return zero sample rate or frame count without an error. Change-Id: I052d841080ed33e4f081ae9825a2f33dff444fb9
* | Merge "Fix some (but not all) unused parameter warnings"Glenn Kasten2013-12-201-2/+2
|\ \
| * | Fix some (but not all) unused parameter warningsGlenn Kasten2013-12-191-2/+2
| |/ | | | | | | Change-Id: Ia99e23a0b46db3f3e6aa46f9018e63c14f4af369
* | Add versions of get/SetParameters without I/O handleGlenn Kasten2013-12-191-0/+10
|/ | | | | | | This is a step towards hiding I/O handles from application level, as much as possible. Change-Id: I30f4171d5dcf77f8e8eb332ce2e9245b30f5f2e1
* 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