395 Commits

Author SHA1 Message Date
Glenn Kasten
aa967521c3 Move fixed_fft to system/media/audio_utils
Change-Id: If8a03911434862a872539c313f54825ffb2cc672
2012-01-17 11:59:35 -08:00
Glenn Kasten
fb6b5bdcea Merge "Use audio_mode_t consistently" 2012-01-17 11:32:53 -08:00
Glenn Kasten
55fa4fb4a7 Rename Visualizer::mLock
This avoids confusion with parent class AudioEffect's mLock which is
protected.

Change-Id: I2ae0b0869fe3c606f682252973795b34477951d0
2012-01-17 10:06:38 -08:00
Glenn Kasten
8c17a2f088 Merge "Use size_t for frame size" 2012-01-17 07:27:46 -08:00
Glenn Kasten
3c6b9cca79 Merge "Use audio_stream_type_t consistently" 2012-01-17 07:25:36 -08:00
Glenn Kasten
4790bd8be8 AudioTrack and AudioFlinger send level cleanup
Add an API to control block for getting/setting send level.
This allow us to make the mSendLevel field private.

Document the lack of barriers.

Use 0.0f to initialize floating-point values (for doc only).

Change-Id: I59f83b00adeb89eeee227e7648625d9a835be7a4
2012-01-13 15:25:14 -08:00
Glenn Kasten
faf354dc7f Use size_t for frame size
except in the control block, where we don't have room.

In AudioFlinger::ThreadBase::TrackBase::getBuffer,
read the frame size from control block only once.

Change-Id: Id6c4bccd4ed3e07d91df6bbea43bae45524f9f4e
2012-01-13 14:58:44 -08:00
Glenn Kasten
bc1d77b6cb Use audio_stream_type_t consistently
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
2012-01-13 10:20:14 -08:00
Glenn Kasten
1c66547ba2 Merge "Use audio_format_t consistently" 2012-01-12 10:30:28 -08:00
Glenn Kasten
accb114e59 Use audio_mode_t consistently
It was int or uint32_t.
Also make getMode() const.

Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
2012-01-12 09:52:37 -08:00
Glenn Kasten
80f3fc2cb6 libmedia new can't fail on Android
Change-Id: Ie79dd5abb8078b35474bf0f1b3a6ff994a3a3360
2012-01-11 12:27:41 -08:00
Glenn Kasten
a89226c786 Merge "Fix race in AudioSystem::getInputBufferSize" 2012-01-11 11:40:27 -08:00
Glenn Kasten
c57b063192 Merge "Fix bug in JetPlayer::loadFromFile" 2012-01-11 11:39:06 -08:00
Glenn Kasten
1eac460122 Merge "Simplify range check for audio_mode_t" 2012-01-11 11:38:21 -08:00
Glenn Kasten
f733831fc7 Merge "Declare IAudioTrack methods in binder opcode order" 2012-01-11 10:23:34 -08:00
Glenn Kasten
81801adc14 Fix race in AudioSystem::getInputBufferSize
It was caching the recording parameters without a mutex.

Change-Id: Ic4b9f621cbc080d224c2233cf3ca3454fc0f19bd
2012-01-10 15:43:48 -08:00
Glenn Kasten
77b6aaf62d Fix bug in JetPlayer::loadFromFile
A long pathname would corrupt the heap due to incorrect use of strncpy.

Also was using hard-coded constant 256 instead of PATH_MAX.

Change-Id: Iba382bbb38624fbc41fec91449f9814f77d4ac0d
2012-01-10 15:43:24 -08:00
Glenn Kasten
01aaf2c401 Simplify range check for audio_mode_t
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
2012-01-10 15:42:32 -08:00
Glenn Kasten
8cf6d6f148 Merge "Clean up AudioTrack::mActive and stopped()" 2012-01-09 10:24:40 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Glenn Kasten
798ef8e882 Declare IAudioTrack methods in binder opcode order
This makes it easier to match up the declarations.

Change-Id: I0996c20b2903b778b356dfe52b07b0ec634855dd
2012-01-06 13:35:57 -08:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Glenn Kasten
1c5a89d4af Use audio_format_t consistently
Was int, uint32_t, uint16_t, and uint8_t with 2-bit bitfield.
Also replace 0 by AUDIO_FORMAT_DEFAULT and replace 1 by
AUDIO_FORMAT_PCM_16_BIT.

Change-Id: Ia8804f53f1725669e368857d5bb2044917e17975
2012-01-05 13:34:54 -08:00
Glenn Kasten
e6810ffaa1 Clean up AudioTrack::mActive and stopped()
mActive is protected by mLock; volatile is meaningless on SMP.

Fixed a couple of places where mActive was accessed without a lock:
 - stopped()
 - processAudioBuffer()

Added stopped_l() for cases where we already hold the lock.

Made mActive a bool not int.

Moved down a lock in setPosition that was being acquired too early.

Change-Id: I73ff368e991c0db9f9472df0b3f96fd33fcc7311
2012-01-05 11:55:24 -08:00
Glenn Kasten
a8719ad9d5 Merge "Use the standard CC_LIKELY and CC_UNLIKELY macros" 2012-01-05 07:38:29 -08:00
Glenn Kasten
e80a4ccd2b Use the standard CC_LIKELY and CC_UNLIKELY macros
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
2012-01-05 07:33:45 -08:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Glenn Kasten
25adf47477 Merge "Fix indentation and whitespace" 2011-12-14 17:35:36 -08:00
Glenn Kasten
da7923ac29 Merge "Audio C++ comments" 2011-12-14 16:56:31 -08:00
Glenn Kasten
fb2ab9efc3 Fix indentation and whitespace
Use git diff -w to verify.

Change-Id: Ib65be0a1ecf65d6cad516110604e3855bf68a638
2011-12-14 16:54:05 -08:00
Glenn Kasten
ad2ac95d06 Merge "Remove unnecessary this->" 2011-12-14 15:40:43 -08:00
Glenn Kasten
46f54359b6 Merge "Remove redundant clear()" 2011-12-14 15:40:01 -08:00
Glenn Kasten
e5fb263a36 Audio C++ comments
Change-Id: I84906ebb9dfcfa5b96b287d18364b407f02a30c1
2011-12-14 14:38:26 -08:00
Glenn Kasten
51e445f701 Remove redundant clear()
Change-Id: Ie5e4e63cbc8fa85ef50451dddf8f149fa864b132
2011-12-14 13:31:40 -08:00
Glenn Kasten
db298a4c66 Remove unnecessary this->
Change-Id: I72038f5d4568f0633d3e4ab90f4b67e2dd22c332
2011-12-14 13:09:08 -08:00
Glenn Kasten
1c50a789ca AudioTrack::setVolume check range
Change-Id: Ie182bf0f741f1f49f68c02a1e7437a2a34d34fc5
2011-12-14 13:06:57 -08:00
Andreas Huber
848bffd8fa am 074133b2: am 351143fb: Merge "Updated (internal) API for IStreamSource to signal discontinuities" into ics-mr1
* commit '074133b260f8d12e484e93b9aa5a33a4983b7349':
  Updated (internal) API for IStreamSource to signal discontinuities
2011-11-29 16:33:02 -08:00
Andreas Huber
a10613fea8 Updated (internal) API for IStreamSource to signal discontinuities
Change-Id: Idd4b9d8e7cec16b3e3c91c70e75144d42be30f96
related-to-bug: 5553055
2011-11-29 11:59:10 -08:00
Marco Nelissen
7ff7821a60 am d4b22ab4: status_t != bool
* commit 'd4b22ab4889f9b1885bfc0dc45667c846a171a98':
  status_t != bool
2011-11-18 15:07:21 -08:00
Marco Nelissen
d4b22ab488 status_t != bool
b/5567433

Change-Id: I255ab8c3b0b5e0ea6a5cc7c05df757c667f3855e
2011-11-18 14:21:34 -08:00
Marco Nelissen
1cad15207d status_t != bool
b/5567433

Change-Id: I255ab8c3b0b5e0ea6a5cc7c05df757c667f3855e
2011-11-18 13:10:56 -08:00
Glenn Kasten
b447e9ce1d Merge "JetPlayer uses C++ Thread not createThreadEtc" 2011-11-17 07:14:29 -08:00
Glenn Kasten
9c0227a63c JetPlayer uses C++ Thread not createThreadEtc
This permits leveraging future improvements to Thread.

Change-Id: I60deed8565ed54f13d9f770c76504e411b154276
2011-11-16 15:25:30 -08:00
Glenn Kasten
99d544332a Bug 4903178 Restore priority and cgroup on stop
On AudioTrack and AudioRecord stop or failed start, restore the priority
and cgroup of the caller to their previous values, rather than forcing
to NORMAL.  Dependent on new thread APIs.

Also fixes bug where priority was set to AUDIO but cgroup not set.

Change-Id: Ib83893918fb4fdf57c6b87884b51038997a631d8
2011-11-16 14:52:55 -08:00
Hong Teng
cc6c20f532 am 716747f7: am 481ffa50: Merge "Fix for issue 5309336 -add videoeditor maximum prefetch YUV frames in media_profiles.xml to limit the total memory usage." into ics-mr1
* commit '716747f7cb29b45e41c2870f12d39095f4ed80c8':
  Fix for issue  5309336 -add videoeditor maximum prefetch YUV frames in media_profiles.xml to limit the total memory usage.
2011-11-15 13:07:07 -08:00
Hong Teng
7eb5319703 Fix for issue 5309336
-add videoeditor maximum prefetch YUV frames in media_profiles.xml to limit the total memory usage.

Change-Id: I41ffbc192fcce4c7635e5b0a1f2835852e5ee509
2011-11-14 13:02:59 -08:00
Andreas Huber
ea427b0c87 resolved conflicts for merge of 26f70db9 to master
Change-Id: Ib1536b1a4c9eeff80e0726b3e61cee12057cd120
2011-11-08 10:40:20 -08:00
Andreas Huber
95be24585f Remove surface legacy APIs and code.
All surfaces are now supported through surface textures.

Change-Id: I95dd823e7099c0c32a48a1121624149dcc29d9c6
2011-10-28 09:39:23 -07:00
Jamie Gennis
e396e993a5 am fc9592f8: am 08479cee: Merge "Stagefright: ANW::connect in MediaPlayerService" into ics-mr0
* commit 'fc9592f8a5f2f75207e5e532655ac294eb2b334b':
  Stagefright: ANW::connect in MediaPlayerService
2011-10-28 02:53:20 +00:00
Jamie Gennis
2fa0ac2e44 Stagefright: ANW::connect in MediaPlayerService
This change moves the ANativeWindow connect and disconnect logic from
MediaPlayer to MediaPlayerService::Client.

Bug: 5502654
Change-Id: Ifc43b98b01ad8f35d62d7ece43110724ec7fda3d
2011-10-26 18:40:00 -07:00