summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge "AudioMixer can be configured for fewer max tracks"Glenn Kasten2012-03-211-3/+6
|\
| * AudioMixer can be configured for fewer max tracksGlenn Kasten2012-03-201-3/+6
| | | | | | | | Change-Id: I371b17cef071d083eecf35cd3627a3adff907a33
* | Merge "Update comments"Glenn Kasten2012-03-211-0/+4
|\ \
| * | Update commentsGlenn Kasten2012-03-191-0/+4
| |/ | | | | | | Change-Id: I327663a020670d0a72ff57bd0b682e2ce0528650
* | WhitespaceGlenn Kasten2012-03-191-1/+1
|/ | | | | | Fix indentation, and add blank lines in key places for clarity Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
* Clean up assertion checksGlenn Kasten2012-03-121-21/+18
| | | | | | | | Use ALOG_ASSERT instead of assert. Use compile-time asserts where appropriate. Fix typo in an ALOGV. Change-Id: I58f1c1ffc14319a022c88b5a88b8d0368660da8b
* AudioBufferProvider comments and cleanupGlenn Kasten2012-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | Add comments about which methods implement the AudioBufferProvider interface. Simplified the definition of kInvalidPts. <stdint.h> is very hard to work with, there seems to be no way to use it reliably to get INT64_MAX without having a separate source file, which is ugly because it means kInvalidPts is not a compile-time constant. So I just deleted AudioBufferProvider.cpp and used a hard-coded constant instead. Added a default constructor for Buffer so that the fields aren't random (especially .raw which is used to determine if the buffer is valid). Make the pts for getNextBuffer default to kInvalidPTS so code that doesn't need a pts doesn't have to specify a value. Rename the parameter to AudioMixer::setBufferProvider to make it clearer. Change-Id: I87e7290884d4ed975b019f62d1ab6ae2bc5065a5
* Remove bit fields to improve performanceGlenn Kasten2012-02-171-1/+2
| | | | | | uint16_t enabled is (mostly) changed to bool in a separate CL Change-Id: Ied9f8c034b2479cee9a8778cee7b8ff92ae75b7b
* Simplify codeGlenn Kasten2012-02-171-4/+4
| | | | | | | | | | | | | | | Use DefaultKeyedVector::valueFor to avoid extra test Make local variables as local as possible No double parentheses No typedef for single use No parentheses around indirect function call No AudioFlinger:: prefix when not needed Remove unnecessary casts Remove block with only one line Saves 128 bytes Change-Id: I3a87430eeb01b81e7b81a1c38f6fdd3274ec48f3
* Upintegrate Audio Flinger changes from ICS_AAHJohn Grossman2012-02-161-16/+45
| | | | | | | | Bring in changes to audio flinger made to support timed audio tracks and HW master volume control. Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae Signed-off-by: John Grossman <johngro@google.com>
* Update commentsGlenn Kasten2012-02-141-1/+6
| | | | | | We no longer put the filename at start of file. Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
* Merge "AudioFlinger methods const and inline"Glenn Kasten2012-02-081-23/+2
|\
| * AudioFlinger methods const and inlineGlenn Kasten2012-02-031-23/+2
| | | | | | | | | | | | This saves 1063 bytes and probably improves performance. Change-Id: I11cf0dfd925fbaec75e3d1b806852a538eae5518
* | Use bool instead of intGlenn Kasten2012-02-031-17/+17
|/ | | | | | The .h is not modified to avoid increasing data size. Change-Id: Ide4a821a5b16424ffa03471dfff98dc3e9b5f751
* Use NULL not 0 for raw pointersGlenn Kasten2012-02-031-2/+2
| | | | | | Use if (p != NULL) instead of if (ptr) Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
* Constructor initialization and const fieldsGlenn Kasten2012-02-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In constructors, initialize member fields in the initialization list rather than constructor body where possible. This allows more fields to be const, provided they are never modified. Also initialize POD fields in constructor, unless it's obvious they don't need to be initialized. In that case, put a comment instead. Remove explicit clear() in destructors on fields that are now const. Give AudioSessionRef a default constructor, so it's immutable fields can be marked const. Add comment about ~TrackBase() trick. Initialize fields in declaration order to make it easier to confirm that all fields are set. Move initialization of mHardwareStatus from onFirstRef() to constructor. Use NULL not 0 to initialize raw pointers in initialization list. Rename field mClient to mAudioFlingerClient, and getter from client() to audioFlingerClient(). Change-Id: Ib36cf6ed32f3cd19003f40a5d84046eb4c122052
* Unconditional deleteGlenn Kasten2012-01-271-3/+1
| | | | | | | | | Don't check that pointer is non-NULL before delete. Don't leave deleted member fields non-NULL, except in a destructor, since it could be misleading in a dump or debugger. (mRsmpOutBuffer) Change-Id: Ic0492a6b752f74a67f4c96dfb89ca2de4e69eecf
* Merge "Fix build warning"Glenn Kasten2012-01-111-1/+1
|\
| * Fix build warningGlenn Kasten2012-01-061-1/+1
| | | | | | | | Change-Id: Ic99608d0c14ed56c02f036e0bbaaae1b16bab8ba
* | Merge "By convention const goes before the type specifier"Glenn Kasten2012-01-091-10/+11
|\ \
| * | By convention const goes before the type specifierGlenn Kasten2012-01-061-10/+11
| |/ | | | | | | Change-Id: I70203abd6a6f54e5bd9f1412800cc01212157e58
* | Merge "Replace loop by __builtin_ctz"Glenn Kasten2012-01-091-9/+4
|\ \
| * | Replace loop by __builtin_ctzGlenn Kasten2012-01-051-9/+4
| |/ | | | | | | | | | | | | | | | | | | Using the builtin is faster on some platforms, for example on ARM it's 19 instructions instead of 13, and is O(1) instead of O(n). Of course, track creation is an inherently slow operation, so this doesn't matter much now. But if we add support for virtual tracks, then physical tracks will be allocated/freed more frequently. Also just on principle ... Change-Id: I3f590934092bd7a1869cbedbc7357928aa5cc8ff
* | 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-1/+1
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* | Merge "Remove the notion of "active track" from mixer"Glenn Kasten2012-01-051-61/+63
|\ \ | |/ |/|
| * Remove the notion of "active track" from mixerGlenn Kasten2011-12-201-61/+63
| | | | | | | | | | | | This is a first step towards making the mixer more object-oriented. Change-Id: Ifd445d0e471023a7f5c82e934736ffc95ba1b05b
* | Merge "Use the standard CC_LIKELY and CC_UNLIKELY macros"Glenn Kasten2012-01-051-18/+19
|\ \
| * | Use the standard CC_LIKELY and CC_UNLIKELY macrosGlenn Kasten2012-01-051-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several source files privately defined macros LIKELY and UNLIKELY in terms of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and CC_UNLIKELY which are intended for this purpose. So rename the private uses to use the standard names. In addition, AudioFlinger was relying on the macro expanding to extra ( ). Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
* | | resolved conflicts for merge of 1a4b9939 to masterEric Laurent2012-01-041-0/+17
|\ \ \ | | | | | | | | | | | | Change-Id: I0c910d391a38a916d8431f7d1f5b82e39e1a66c2
| * | | audioflinger: fix clicks on 48kHz audio.Eric Laurent2011-12-221-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calculation done in prepareTracks_l() for the minimum amount off frames needed to mix one output buffer had 2 issues: - the additional sample needed for interpolation was not included - the fact that the resampler does not acknowledge the frames consumed immediately after each mixing round but only once all frames requested have been used was not taken into account. Thus the number of frames available in track buffer could be considered sufficient although it was not and the resampler would abort producing a short silence perceived as a click. Issue 5727099. Change-Id: I7419847a7474c7d9f9170bedd0a636132262142c
* | | | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-5/+5
| |/ / |/| | | | | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* | | Merge "Remove dead code"Glenn Kasten2011-12-201-0/+2
|\ \ \ | |_|/ |/| |
| * | Remove dead codeGlenn Kasten2011-12-191-1/+2
| | | | | | | | | | | | Change-Id: Icf23f7f90fdeb660f4015f22cf239e6d05f5d03c
* | | Merge "Use constants for 2 and 32"Glenn Kasten2011-12-161-3/+3
|\ \ \
| * | | Use constants for 2 and 32Glenn Kasten2011-12-161-3/+3
| | | | | | | | | | | | | | | | Change-Id: If820dfd58b6df258570750610a07af99598d9e53
* | | | Merge "Extract out audio DSP code to utility library"Glenn Kasten2011-12-161-103/+2
|\ \ \ \ | |/ / / |/| | |
| * | | Extract out audio DSP code to utility libraryGlenn Kasten2011-12-161-103/+2
| |/ / | | | | | | | | | Change-Id: Ib8ce72028a7ea30e82baa518e381370e820ebbd0
* | | Merge "Use switch in AudioMixer::setParameter"Glenn Kasten2011-12-161-35/+48
|\ \ \
| * | | Use switch in AudioMixer::setParameterGlenn Kasten2011-12-161-35/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace series of if/then/elses by easier-to-read switch. Also return void instead of status_t, since callers weren't checking it. Assert on bad input parameters. Change-Id: Ie1f0a297977b28501d20e1af819afed9b4750616
* | | | deleteTrackName now asserts on bad input parameterGlenn Kasten2011-12-161-17/+16
|/ / / | | | | | | | | | | | | | | | | | | This is safe, as the input parameter is always track->name(), which must be valid. Change-Id: Iea8ea3a5706c27026335526ba8851030d00681f8
* | | Merge "setActiveTrack and setBufferProvider can't fail"Glenn Kasten2011-12-161-8/+7
|\ \ \
| * | | setActiveTrack and setBufferProvider can't failGlenn Kasten2011-12-151-8/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Return void, not status_t, from setActiveTrack and setBufferProvider. These methods returned status_t, but the callers never checked the return value. Since these aren't externally visible APIs, they now return void, and assert on bad input parameters. Change-Id: I530ed29484596ae41e8659826ca425149c51c2a1
* | | Merge "Simplify enable/disable mixing"Glenn Kasten2011-12-161-24/+10
|\ \ \
| * | | Simplify enable/disable mixingGlenn Kasten2011-12-151-24/+10
| |/ / | | | | | | | | | | | | | | | The MIXING enum isn't needed, and now returns void instead of status_t. Change-Id: Ibe4ec24081d75ad4ab78b9c7191fc9077959c4e9
* | | Merge "Use NULL not 0 for pointers"Glenn Kasten2011-12-151-12/+12
|\ \ \
| * | | Use NULL not 0 for pointersGlenn Kasten2011-12-151-12/+12
| |/ / | | | | | | | | | Change-Id: Iab3f9abbdab617dc5a599e657ec46a0b0a002eef
* | | Merge "Fix indentation and whitespace"Glenn Kasten2011-12-141-48/+47
|\ \ \
| * | | Fix indentation and whitespaceGlenn Kasten2011-12-141-48/+47
| |/ / | | | | | | | | | | | | | | | Use git diff -w to verify. Change-Id: Ib65be0a1ecf65d6cad516110604e3855bf68a638
* | | AudioMixer uninitialized simple fieldsGlenn Kasten2011-12-141-0/+6
|/ / | | | | | | Change-Id: I47e3849f048d4d990c9634f9c8a2ca2de0339e93