5530 Commits

Author SHA1 Message Date
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
dd3ca2e268 Merge "AudioTrack and AudioFlinger send level cleanup" 2012-01-17 07:18:26 -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
David 'Digit' Turner
d615f34b56 Merge "media/mtp: Add missing LOCAL_C_INCLUDES" 2012-01-13 14:32:50 -08:00
Jean-Baptiste Queru
134a683565 am c0ef548c: am d75961ee: am b4cee0f8: Merge "stagefright aacenc/amrwbenc: Remove trailing whitespace"
* commit 'c0ef548c748f0c3bc917eff7b50941f9cbe1df86':
  stagefright aacenc/amrwbenc: Remove trailing whitespace
2012-01-13 11:28:09 -08:00
Jean-Baptiste Queru
c0ef548c74 am d75961ee: am b4cee0f8: Merge "stagefright aacenc/amrwbenc: Remove trailing whitespace"
* commit 'd75961eecbfeb3f7e027a2a1f6011a26dd7d2d2d':
  stagefright aacenc/amrwbenc: Remove trailing whitespace
2012-01-13 11:25:09 -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
David 'Digit' Turner
3203f2af94 media/mtp: Add missing LOCAL_C_INCLUDES
One of the source files here is including <cutils/tztime.h> which
itself includes <bionic_time.h>, a private C library header used
to define the strftime_tz() extension (which used to be declared
in <time.h> but was moved there instead).

Add a missing C include path to let our code compile as usual.

Change-Id: I6aac2f1d3d15ad182679c81ff3f4febff74eb671
2012-01-13 14:21:42 +01:00
James Dong
b5c6ff5993 Merge "Separate sniffing from session initialization" 2012-01-12 16:56:58 -08:00
James Dong
d1ba6ed945 Separate sniffing from session initialization
This avoid lengthy/duplicate sniffing for drm plugins when a decrypt session is opened

o The change is backward compatibile in that no update is required
  for existing drm plug-ins if they do not plan to provide separate
  sniffer/extractor

related-to-bug: 5725548

Change-Id: I7fc4caf82d77472da4e2bc7b5d31060fb54fd84c
2012-01-12 16:25:12 -08:00
Glenn Kasten
1c66547ba2 Merge "Use audio_format_t consistently" 2012-01-12 10:30:28 -08:00
Marco Nelissen
3fbc0b2062 Merge "MediaScanner: Disable bulk insert for settings" 2012-01-12 07:49:23 -08:00
Mans Rullgard
62a62ef415 stagefright aacenc/amrwbenc: Remove trailing whitespace
This was applied in AOSP master earlier, in commit
b21611e5b0f1797e39e781d91ade023bac87637f, but when merged
into the Google internal tree in
88c2d4d26d79384f32a25bd775cf873cb678b12a, none of these
changes have been brought in. (The diff of this merge commit
and its first parent, d94b71d, is empty.)

Therefore, reapply the rest of these changes on the files
that still are present in the current version.

Change-Id: I645a9b9134769958a11808a06163123d28d83e46
2012-01-12 11:14:04 +02: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
Eric Laurent
cc598b2b8b am 05985a2e: am c15cf3d2: Merge "stagefright: limit audio gap for looped playback" into ics-mr1
* commit '05985a2e2ae5c21fbf69d2884c59ea475fce7f6d':
  stagefright: limit audio gap for looped playback
2012-01-11 11:14:30 -08:00
Glenn Kasten
f733831fc7 Merge "Declare IAudioTrack methods in binder opcode order" 2012-01-11 10:23:34 -08:00
Glenn Kasten
1ea8a35197 Merge "Fix missing tag in mediaserver ServiceManager: log" 2012-01-11 10:22:45 -08:00
Sungsoo Lim
6c4c155696 MediaScanner: Disable bulk insert for settings
Since the settings (notifications, ringtones, and alarms) request
rowId after inserting into DB, do not use bulk insert for them.
(Bulk insert does not return the rowId)

Change-Id: I8faf993f8ac2da96672594a1c92ddc917f964d6f
2012-01-11 11:34:20 +09: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
Steve Block
38e90751a2 Merge "Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE" 2012-01-10 14:08:32 -08:00
Eric Laurent
577d6ccb7b stagefright: limit audio gap for looped playback
The audio gap when looping audio is mostly due to
a delay requested by the audio player when executing
the end of stream message. This is to allow the audio
to be drained out of the pipe before actually stopping the
AudioTrack.
This delay is not needed when looping as the AudioTrack
is not stopped.

The fix consists in ignoring the requested delay when the
looping flag is set in awesome player.

Issue 5800981.

Change-Id: Ib32d2930c53ecebc21ca8440e6e054c7e20db4a5
2012-01-09 13:48:25 -08:00
Steve Block
ec193dec4d Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE
See https://android-git.corp.google.com/g/157519

Bug: 5449033
Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-09 21:36:22 +00:00
Glenn Kasten
b282e08ab6 Fix build
Change-Id: Ia140af1a61edf124ef3d48b60351f850a3475af1
2012-01-09 13:11:07 -08:00
Glenn Kasten
5c17a820f9 Audio Java doc comment typos and minor changes
Change-Id: Id6ea6dccb8054c9f05db9a9c045387ce813659e6
2012-01-09 12:15:18 -08:00
Glenn Kasten
13f94dc5bd Merge "Fix race conditions related to ringer mode" 2012-01-09 12:01:37 -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
97a2d174e6 Fix missing tag in mediaserver ServiceManager: log
Change-Id: I2d5525ffee0b66c0bc361a02b313ec4dd61e6552
2012-01-06 14:40:14 -08: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
f4c2294b01 Merge "Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE" 2012-01-06 10:30:56 -08:00
Marco Nelissen
18c6afa0c5 Merge "Also accept non-parenthesized genre numbers" 2012-01-06 08:08:15 -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
Marco Nelissen
ad35f9165e Also accept non-parenthesized genre numbers
b/5790684

Change-Id: Ia13feebeaadd45d9196486c012538c5b80840163
2012-01-05 15:15:53 -08:00
Marco Nelissen
4b4d00e714 Merge "ThumbnailUtils: To fix misuse of FileInputStream." 2012-01-05 14:11:40 -08:00
Steve Block
bd47cac4df Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE" 2012-01-05 14:07:02 -08: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
Dongwon Kang
3993818689 ThumbnailUtils: To fix misuse of FileInputStream.
We need to close it explicitly after using it. Without this, fd will be closed
non-deterministically, and that will break the decode procedure.

Bug: 5808889
Change-Id: Icf9ff9abd6e327b122c6916df9750016b3d1b616
2012-01-05 17:17:48 +09:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00: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