OSDN Git Service

android-x86/frameworks-av.git
12 years agolibagl shouldn't export anything
Mathias Agopian [Sun, 26 Feb 2012 03:52:53 +0000 (19:52 -0800)]
libagl shouldn't export anything

Change-Id: Ia823dbc56aab2a0b8a6063df4348fe6baac124c6

12 years agoMerge "Make threadLoop() logs identical"
Glenn Kasten [Mon, 27 Feb 2012 15:24:46 +0000 (07:24 -0800)]
Merge "Make threadLoop() logs identical"

12 years agoMerge "Move declaration of mixerStatus to inner block"
Glenn Kasten [Mon, 27 Feb 2012 15:21:00 +0000 (07:21 -0800)]
Merge "Move declaration of mixerStatus to inner block"

12 years agoMerge "remove dependency on android_native{s_priv|buffer}.h"
Mathias Agopian [Sat, 25 Feb 2012 03:08:12 +0000 (19:08 -0800)]
Merge "remove dependency on android_native{s_priv|buffer}.h"

12 years agoremove dependency on android_native{s_priv|buffer}.h
Mathias Agopian [Sat, 25 Feb 2012 02:25:41 +0000 (18:25 -0800)]
remove dependency on android_native{s_priv|buffer}.h

Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89

12 years agoMake threadLoop() logs identical
Glenn Kasten [Fri, 24 Feb 2012 19:18:09 +0000 (11:18 -0800)]
Make threadLoop() logs identical

Change the wording of the logs in the various copies of threadLoop()
to be identical.  This will make it easier to merge them soon.

Change-Id: Idfa181e437738712c784dc7f746cac79f83d2931

12 years agoMove declaration of mixerStatus to inner block
Glenn Kasten [Fri, 24 Feb 2012 15:25:40 +0000 (07:25 -0800)]
Move declaration of mixerStatus to inner block

mixerStatus was being declared (and initialized) too early,
which also resulted in a duplicate initialization.  Moved
the declaration into the block where it is actually used.

Change-Id: Ifdcfefe362a5efe3493dd616cdb44645c6f9aed5

12 years agoPull out duplicated copies of silent mode check
Glenn Kasten [Fri, 24 Feb 2012 15:21:48 +0000 (07:21 -0800)]
Pull out duplicated copies of silent mode check

Also fix the error handling for the property_get.

This is part of preparation for the threadLoop() merge.

Change-Id: I6405190ea18146d1271575e1dfe9f279e8f36b17

12 years agoMerge "Pull CPU statistics code out of threadLoop()"
Glenn Kasten [Fri, 24 Feb 2012 22:25:15 +0000 (14:25 -0800)]
Merge "Pull CPU statistics code out of threadLoop()"

12 years agoMerge "Make sure we return input/output buffers to the codec not just while"
Andreas Huber [Fri, 24 Feb 2012 22:03:27 +0000 (14:03 -0800)]
Merge "Make sure we return input/output buffers to the codec not just while"

12 years agoMerge "Fix two more locations that use the old setObject("buffer", ...) paradigm"
Andreas Huber [Fri, 24 Feb 2012 22:02:52 +0000 (14:02 -0800)]
Merge "Fix two more locations that use the old setObject("buffer", ...) paradigm"

12 years agoMake sure we return input/output buffers to the codec not just while
Andreas Huber [Fri, 24 Feb 2012 21:58:09 +0000 (13:58 -0800)]
Make sure we return input/output buffers to the codec not just while

flushing but also while stopping.

Change-Id: I23534008b93654c9b9c022c0b1d204c2b546d566

12 years agoPull CPU statistics code out of threadLoop()
Glenn Kasten [Fri, 24 Feb 2012 15:21:32 +0000 (07:21 -0800)]
Pull CPU statistics code out of threadLoop()

This is to prepare for the threadLoop() merge

Change-Id: I118c7d5c6b011b5d5b95ec7d63fb03feb166a9cf

12 years agoFix two more locations that use the old setObject("buffer", ...) paradigm
Andreas Huber [Fri, 24 Feb 2012 21:42:47 +0000 (13:42 -0800)]
Fix two more locations that use the old setObject("buffer", ...) paradigm

that I'd previously missed.

Change-Id: Ifbdbfb94d1bc1cbe8c0a403fed05ce99fca8397b

12 years agoMerge "Remove TrackBase::mFlags"
Glenn Kasten [Fri, 24 Feb 2012 21:17:36 +0000 (13:17 -0800)]
Merge "Remove TrackBase::mFlags"

12 years agoRemove TrackBase::mFlags
Glenn Kasten [Tue, 21 Feb 2012 18:35:56 +0000 (10:35 -0800)]
Remove TrackBase::mFlags

The bit-field TrackBase::mFlags was supposed to have track-specific
flags in the upper 16 bits, and system flags in the lower 16 bits.

The upper 16 bits of mFlags were initialized in the TrackBase
constructor from the flags parameter of IAudioFlinger::createTrack()
and IAudioFlinger::openRecord(), and the lower 16 bits were cleared.

However, the upper 16 bits of mFlags were never acccessed again.
So really there are no track-specific flags.  I left the flags
in the parameter list of createTrack() and openRecord() but made a
note that these should be removed eventually as they are dead.

This leaves only the one system flag "step server failed".  I replaced
the bit-field mFlags by bool mStepServerFailed, which is simpler and
slightly faster.

Change-Id: I6650f5487be72791b4a67d73adcd10ffa04e2aa5

12 years agoam ed7e1e83: am 47023027: am 26d9944e: am 6a300a54: Merge "stagefright aacenc: Make...
Jean-Baptiste Queru [Fri, 24 Feb 2012 19:11:10 +0000 (11:11 -0800)]
am ed7e1e83: am 47023027: am 26d9944e: am 6a300a54: Merge "stagefright aacenc: Make the bits to write in WriteBits unsigned"

* commit 'ed7e1e830165678421ee7d1b3dac044214a6e635':
  stagefright aacenc: Make the bits to write in WriteBits unsigned

12 years agoam 6a300a54: Merge "stagefright aacenc: Make the bits to write in WriteBits unsigned"
Jean-Baptiste Queru [Fri, 24 Feb 2012 19:02:29 +0000 (11:02 -0800)]
am 6a300a54: Merge "stagefright aacenc: Make the bits to write in WriteBits unsigned"

* commit '6a300a5413898ff8b728e77c5a23290cae60e9b5':
  stagefright aacenc: Make the bits to write in WriteBits unsigned

12 years agoam 70450553: am 14c6e272: am 2accfc11: am d6a25154: Merge "stagefright aacenc: Fix...
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:35:47 +0000 (10:35 -0800)]
am 70450553: am 14c6e272: am 2accfc11: am d6a25154: Merge "stagefright aacenc: Fix an inline asm constraint"

* commit '70450553f8f1e6ec4967f86a4b811db2940e8772':
  stagefright aacenc: Fix an inline asm constraint

12 years agoam 78fc0c0b: am 428ece23: am c4aa19a5: am ea227787: Merge changes I903353c5,I822dcc74
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:33:05 +0000 (10:33 -0800)]
am 78fc0c0b: am 428ece23: am c4aa19a5: am ea227787: Merge changes I903353c5,I822dcc74

* commit '78fc0c0bfae913a4a44011225396ae525b335fb1':
  stagefright amrnb: Properly negate all values
  stagefright amrnb: Fix a bug on architectures where long is 64 bit

12 years agoMerge "stagefright aacenc: Make the bits to write in WriteBits unsigned"
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:28:00 +0000 (10:28 -0800)]
Merge "stagefright aacenc: Make the bits to write in WriteBits unsigned"

12 years agoam d6a25154: Merge "stagefright aacenc: Fix an inline asm constraint"
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:26:53 +0000 (10:26 -0800)]
am d6a25154: Merge "stagefright aacenc: Fix an inline asm constraint"

* commit 'd6a25154d94c48ab2ef12641c789458ab14ca94f':
  stagefright aacenc: Fix an inline asm constraint

12 years agoam ea227787: Merge changes I903353c5,I822dcc74
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:24:34 +0000 (10:24 -0800)]
am ea227787: Merge changes I903353c5,I822dcc74

* commit 'ea227787253e29da2d688399b097e05708d3bf73':
  stagefright amrnb: Properly negate all values
  stagefright amrnb: Fix a bug on architectures where long is 64 bit

12 years agoMerge "stagefright aacenc: Fix an inline asm constraint"
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:22:33 +0000 (10:22 -0800)]
Merge "stagefright aacenc: Fix an inline asm constraint"

12 years agoMerge "Small fix to MediaCodec"
Andreas Huber [Fri, 24 Feb 2012 18:16:28 +0000 (10:16 -0800)]
Merge "Small fix to MediaCodec"

12 years agoMerge changes I903353c5,I822dcc74
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:07:47 +0000 (10:07 -0800)]
Merge changes I903353c5,I822dcc74

* changes:
  stagefright amrnb: Properly negate all values
  stagefright amrnb: Fix a bug on architectures where long is 64 bit

12 years agoam 15278119: am 61022b06: am 5f83b957: am bf45bbf3: Merge "stagefright aacenc: Zero...
Jean-Baptiste Queru [Fri, 24 Feb 2012 18:03:47 +0000 (10:03 -0800)]
am 15278119: am 61022b06: am 5f83b957: am bf45bbf3: Merge "stagefright aacenc: Zero-initialize a struct"

* commit '1527811984557ee0b5d6e476e84ed147e073cb45':
  stagefright aacenc: Zero-initialize a struct

12 years agoam bf45bbf3: Merge "stagefright aacenc: Zero-initialize a struct"
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:54:58 +0000 (09:54 -0800)]
am bf45bbf3: Merge "stagefright aacenc: Zero-initialize a struct"

* commit 'bf45bbf3b4a54976b81234ffc8ac41520bc052fc':
  stagefright aacenc: Zero-initialize a struct

12 years agoam 4de803c7: am 459df4ef: am e7650c32: am e5bdd24b: Merge "stagefright aacenc: Avoid...
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:52:54 +0000 (09:52 -0800)]
am 4de803c7: am 459df4ef: am e7650c32: am e5bdd24b: Merge "stagefright aacenc: Avoid warnings about incompatible pointer types"

* commit '4de803c76d4afd0f542c086b555b71729b3c5796':
  stagefright aacenc: Avoid warnings about incompatible pointer types

12 years agoMerge "stagefright aacenc: Zero-initialize a struct"
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:47:22 +0000 (09:47 -0800)]
Merge "stagefright aacenc: Zero-initialize a struct"

12 years agoam e5bdd24b: Merge "stagefright aacenc: Avoid warnings about incompatible pointer...
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:45:40 +0000 (09:45 -0800)]
am e5bdd24b: Merge "stagefright aacenc: Avoid warnings about incompatible pointer types"

* commit 'e5bdd24b69c4033163d478d721247691e11cea36':
  stagefright aacenc: Avoid warnings about incompatible pointer types

12 years agoam 307f47aa: am 7e8b65df: am 7ffa4546: am 47b56c5a: Merge "stagefright aacenc: Add...
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:28:09 +0000 (09:28 -0800)]
am 307f47aa: am 7e8b65df: am 7ffa4546: am 47b56c5a: Merge "stagefright aacenc: Add const declarations to some pointers"

* commit '307f47aa5def85d0c0bb4af725ff557707c5be86':
  stagefright aacenc: Add const declarations to some pointers

12 years agoam 47b56c5a: Merge "stagefright aacenc: Add const declarations to some pointers"
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:20:44 +0000 (09:20 -0800)]
am 47b56c5a: Merge "stagefright aacenc: Add const declarations to some pointers"

* commit '47b56c5a46287ea226c05e3c0238a91f4702491a':
  stagefright aacenc: Add const declarations to some pointers

12 years agoMerge "stagefright aacenc: Avoid warnings about incompatible pointer types"
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:20:36 +0000 (09:20 -0800)]
Merge "stagefright aacenc: Avoid warnings about incompatible pointer types"

12 years agoam 5c2f1220: am 901b8bb0: am aa86aa60: am 1b704610: Merge "stagefright aacenc: Fix...
Jean-Baptiste Queru [Fri, 24 Feb 2012 17:12:17 +0000 (09:12 -0800)]
am 5c2f1220: am 901b8bb0: am aa86aa60: am 1b704610: Merge "stagefright aacenc: Fix inline asm"

* commit '5c2f1220f90ae68a064195ba3c94f1319813f32c':
  stagefright aacenc: Fix inline asm

12 years agoSmall fix to MediaCodec
Andreas Huber [Fri, 24 Feb 2012 16:41:46 +0000 (08:41 -0800)]
Small fix to MediaCodec

Change-Id: I6bcbfd35fdf5a2b0260b8f07a630a5b380e139a0

12 years agoMerge "stagefright aacenc: Add const declarations to some pointers"
Jean-Baptiste Queru [Fri, 24 Feb 2012 16:53:24 +0000 (08:53 -0800)]
Merge "stagefright aacenc: Add const declarations to some pointers"

12 years agoam 1b704610: Merge "stagefright aacenc: Fix inline asm"
Jean-Baptiste Queru [Fri, 24 Feb 2012 16:50:32 +0000 (08:50 -0800)]
am 1b704610: Merge "stagefright aacenc: Fix inline asm"

* commit '1b7046108c0f381fa8b7efaebae02c1a2b3099b3':
  stagefright aacenc: Fix inline asm

12 years agoMerge "stagefright aacenc: Fix inline asm"
Jean-Baptiste Queru [Fri, 24 Feb 2012 16:38:22 +0000 (08:38 -0800)]
Merge "stagefright aacenc: Fix inline asm"

12 years agoam 0c96e869: am 41087f79: am d7ab4e0c: am bf1e85bf: Merge "stagefright aacenc: Fix...
Jean-Baptiste Queru [Fri, 24 Feb 2012 16:01:10 +0000 (08:01 -0800)]
am 0c96e869: am 41087f79: am d7ab4e0c: am bf1e85bf: Merge "stagefright aacenc: Fix inline asm constraints"

* commit '0c96e8690408e3cfc12eee521a442c52f1c10b27':
  stagefright aacenc: Fix inline asm constraints

12 years agoam bf1e85bf: Merge "stagefright aacenc: Fix inline asm constraints"
Jean-Baptiste Queru [Fri, 24 Feb 2012 15:53:43 +0000 (07:53 -0800)]
am bf1e85bf: Merge "stagefright aacenc: Fix inline asm constraints"

* commit 'bf1e85bfc8293646d57f0017afbfb0e09a1a41d7':
  stagefright aacenc: Fix inline asm constraints

12 years agoMerge "stagefright aacenc: Fix inline asm constraints"
Jean-Baptiste Queru [Fri, 24 Feb 2012 15:39:02 +0000 (07:39 -0800)]
Merge "stagefright aacenc: Fix inline asm constraints"

12 years agoMerge "Changed TimedTextInBandSource to TimedText3GPPSource."
James Dong [Fri, 24 Feb 2012 05:00:59 +0000 (21:00 -0800)]
Merge "Changed TimedTextInBandSource to TimedText3GPPSource."

12 years agoFix memory leakage due to unreleased MuxOMX objects after disconnection
James Dong [Thu, 23 Feb 2012 20:23:57 +0000 (12:23 -0800)]
Fix memory leakage due to unreleased MuxOMX objects after disconnection

o related-to-bug: 5984232

Change-Id: I20cbeff6ae865e995d02342549f1e09320543740

12 years agoBe more greedy when it comes to gathering input and output buffers.
Andreas Huber [Thu, 23 Feb 2012 19:21:43 +0000 (11:21 -0800)]
Be more greedy when it comes to gathering input and output buffers.

Change-Id: I54c4f608e5155917ca35eba5655b4c06357fb112

12 years agoMerge "Add new APIs AMessage::(set|find)Buffer to make it safer to pass"
Andreas Huber [Thu, 23 Feb 2012 17:13:45 +0000 (09:13 -0800)]
Merge "Add new APIs AMessage::(set|find)Buffer to make it safer to pass"

12 years agoMerge "Drop support for Android HTTP stack"
Steve Block [Thu, 23 Feb 2012 12:29:30 +0000 (04:29 -0800)]
Merge "Drop support for Android HTTP stack"

12 years agoChanged TimedTextInBandSource to TimedText3GPPSource.
Insun Kang [Thu, 23 Feb 2012 05:03:23 +0000 (14:03 +0900)]
Changed TimedTextInBandSource to TimedText3GPPSource.

Change-Id: I820adffbf9b4012f25ab45e9624ae2c35fc5af94

12 years agoAdd new APIs AMessage::(set|find)Buffer to make it safer to pass
Andreas Huber [Tue, 21 Feb 2012 22:38:23 +0000 (14:38 -0800)]
Add new APIs AMessage::(set|find)Buffer to make it safer to pass

ABuffer objects through messages.

Change-Id: I9f8b4e4c4767d0d70a0105e0c0813b754379b49d

12 years agoMerge "Implementation of a java media codec interface and associated tools."
Andreas Huber [Wed, 22 Feb 2012 23:13:44 +0000 (15:13 -0800)]
Merge "Implementation of a java media codec interface and associated tools."

12 years agoImplementation of a java media codec interface and associated tools.
Andreas Huber [Tue, 21 Feb 2012 19:47:18 +0000 (11:47 -0800)]
Implementation of a java media codec interface and associated tools.

Change-Id: I13e54062d4de584355c5d82bb027a68aeaf2923b

12 years agoMerge "Avoid wp<>::unsafe_get() with a few exceptions"
Glenn Kasten [Wed, 22 Feb 2012 21:22:13 +0000 (13:22 -0800)]
Merge "Avoid wp<>::unsafe_get() with a few exceptions"

12 years agoAvoid wp<>::unsafe_get() with a few exceptions
Glenn Kasten [Fri, 20 Jan 2012 21:32:16 +0000 (13:32 -0800)]
Avoid wp<>::unsafe_get() with a few exceptions

Avoid using wp<>::unsafe_get() except in a log, and other specific cases
when it's known to be safe.

Use more specific subclass types for parameters to avoid down-casts.

When a constructor or method parameter is "this" of an object that is
currently being constructed, it's better to use a raw pointer rather
than either sp<> or wp<>.

Using the raw pointer is safe, provided either:
 - it is "this" of an object being constructed (which has sp<> refcount of 0),
 - or the caller already holds an sp<>

The raw pointer is simpler and faster, and it avoids the problem of the
sp<> reference count being incremented and then decremented to zero on
scope exit, which would cause the object's destructor to run while the
object is still being constructed.

Also removed some dead code per a review comment.

Change-Id: I7375f64da3aec11b928c33cb01faff186252ef5e

12 years agoMerge "Fix build warning"
Glenn Kasten [Wed, 22 Feb 2012 21:14:50 +0000 (13:14 -0800)]
Merge "Fix build warning"

12 years agoFix build warning
Glenn Kasten [Sat, 18 Feb 2012 00:24:10 +0000 (16:24 -0800)]
Fix build warning

warning: pointer of type 'void *' used in arithmetic
warning: enumeral and non-enumeral type in conditional expression

Change-Id: I7b8d626a636145ef648e3b5d0e77068216dd012e

12 years agoAllow to record time lapse videos without using setProfile()
James Dong [Wed, 22 Feb 2012 01:16:25 +0000 (17:16 -0800)]
Allow to record time lapse videos without using setProfile()

o also added a check on whether capture rate was set before starting time lapse video recording.

o related-to-bug: 6045507

Change-Id: I8e1fdc8e8931e2684ab3822dc6260db44658e87d

12 years agoDrop support for Android HTTP stack
Steve Block [Thu, 16 Feb 2012 17:49:31 +0000 (17:49 +0000)]
Drop support for Android HTTP stack

All future releases will use the Chromium HTTP stack and maintaining two HTTP
    stacks adds maintenance overhead. The Chromium HTTP stack requires V8, but we
    now use V8 in all build targets (b/5495373), so we can safely drop the Android
    HTTP stack.

LoadListener, HttpAuthHandlerImpl, Network, SslErrorHandlerImpl, WebViewWorker
- Android-stack specific, removed
StreamLoader, FrameLoader
- Require LoadListener, removed
CacheLoader, ContentLoader, DataLoader, FileLoader
- Extend StreamLoader, removed

BrowserFrame
- Removed methods that create LoadListener
- BrowserFrame.startLoadingResource() is called from native
CallbackProxy, WebView
- Removed calls to Network methods
CacheManager, CookieManager, CookieSyncManager, WebViewCore, WebResourceResponse
- Removed other Android-stack specific code
JniUtlil
- Removed useChromiumHttpStack()
WebViewDatabase
- Removed all code to create cookies and cache databases for Android HTTP stack

See corresponding WebKit change https://android-git.corp.google.com/g/166327.

Bug: 5495616
Change-Id: If491675516f6eb187077af4220214bb6e6a8d045

12 years agoMerge "Limit the amount of audio record data in each buffer"
James Dong [Tue, 21 Feb 2012 19:10:35 +0000 (11:10 -0800)]
Merge "Limit the amount of audio record data in each buffer"

12 years agoUpdate stagefright makefile after dropping support for JSC
Steve Block [Fri, 17 Feb 2012 17:45:42 +0000 (17:45 +0000)]
Update stagefright makefile after dropping support for JSC

Bug: 5495373
Change-Id: Ibb81196edd3a6eaa4999cf0e30a78368afb66360

12 years agoRemove bit fields to improve performance
Glenn Kasten [Fri, 27 Jan 2012 23:26:23 +0000 (15:26 -0800)]
Remove bit fields to improve performance

uint16_t enabled is (mostly) changed to bool in a separate CL

Change-Id: Ied9f8c034b2479cee9a8778cee7b8ff92ae75b7b

12 years agoMerge "Simplify code"
Glenn Kasten [Fri, 17 Feb 2012 17:40:43 +0000 (09:40 -0800)]
Merge "Simplify code"

12 years agoSimplify code
Glenn Kasten [Thu, 26 Jan 2012 18:53:32 +0000 (10:53 -0800)]
Simplify code

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

12 years agoMerge "Put a bandaid on a segfault in timed audio track handling."
Mike Lockwood [Fri, 17 Feb 2012 17:20:43 +0000 (09:20 -0800)]
Merge "Put a bandaid on a segfault in timed audio track handling."

12 years agoPut a bandaid on a segfault in timed audio track handling.
John Grossman [Mon, 13 Feb 2012 01:51:21 +0000 (17:51 -0800)]
Put a bandaid on a segfault in timed audio track handling.

Add a bandaid to prevent a segfault which can occur while handling
timed audio buffers.  There is a deeper problem which should
eventually be addressed, but for now this fix should prevent any
crashing.

The deeper problem is as follows.

When the AudioFlinger mixer gets data to mix from an AudioTrack, it
ends up getting a structure filled out which points into an IMemory
region owned by the AudioTrack.  Unfortunately, this structure is not
holding a refcount on the IMemory which it points into.  If the
IMemory refcount hits 0 and the chunk of RAM is retuned to the binder
heap it came from, there can still be a Buffer object being held by
the AudioFlinger mixer which points into the region of memory which
was retuned to the binfer heap.  If AF reads from this buffer, it
could read corrupt data (if the region of memory gets handed back out
to a writer), or it could segfault (if the heap has been freed and the
pages unmapped).  Similar problems could happen if AF attempts to
write to the buffer, heap corruption in one case, segfaulting in the
other.

In the past, this has not been an issue for AF, because tracks
allocate a single IMemory (which serves as a ring buffer) and the
IMemory lives for as long as the track lives.  As an artifact of the
way the code came out, the mixer cannot be holding a Buffer structure
pointing into the IMemory which used to be owned by a track if the
track no longer exists.  Tracks cannot come into or out of existence
during a mix operation, which is the only thing which makes this safe.

TimedTracks work differently, however.  Timed tracks each allocate a
small binder heap, and then hand out IMemory instances  broken out of
this heap.  The heap lives as long as the track, so the worst which
could happen here is that a TimedTrack's IMemory gets returned to the
heap while there is still a buffer structure in flight pointing into
the memory region, then the region gets handed out again and
overwritten by new data causing the mixer to mix the wrong audio.  The
timing to cause this to happen is very difficult to encounter, and you
to generate the timing conditions required, you need to be in a pretty
bad failure state where audio is already breaking up and skipping, so
its unlikely that anyone would notice (which is why I'm band-aiding
the segfault and letting the deeper issue slide for now).

In general, however, it might be a good idea to revisit this buffering
design.  On principal, if someone is going to hold pointers into a
refcounted object, they should be holding a ref on the object at the
same time.  Failure to do this will usually lead to a situation where
there are corruption or segfault issues, or to a system where the
refcounted object's lifetime must be implicitly managed very carefully
in ways which are usually non-obvious and are easy to break by new
engineers on a project.

Change-Id: Ib391075395ed0ef46a03c37aa38a82d09e88abeb

12 years agoFixed possible heap corruption in EffectDesc
Glenn Kasten [Thu, 2 Feb 2012 22:04:37 +0000 (14:04 -0800)]
Fixed possible heap corruption in EffectDesc

"EffectDesc *effect = new EffectDesc(*effects[i]);" was relying on the
default copy constructor for EffectDesc, but the default copy constructor
does a member-by-member copy.  This works OK for mUuid, but a member
copy of mName and mParams shares pointers.  This could result in heap
corruption later on due to a double free.  Changed to add an explicit
copy constructor that does a deep copy of both mName and mParams.

A malloc() and strdup() were being freed by delete, but the correct
matching API for these is free().  Fortunately our current memory runtime
implementation ignores the difference. Changed to use free().

EffectDesc and InputSourceDesc member fields were being torn down by
the code that does delete.  Changed to do the tear-down in ~EffectDesc()
and ~InputSourceDesc().

Added constructor EffectDesc() with name and UUID parameters, rather
than having caller fill in the object after construction.

Made ~EffectDesc() and ~InputSourceDesc() non-virtual to save memory,
since they have no subclasses.

Change-Id: Ibb5cc2e6760d72e0c4cf537068ac4432c717bafd

12 years agoUpintegreate AAH TX and RX players from ICS_AAH
John Grossman [Thu, 9 Feb 2012 23:09:05 +0000 (15:09 -0800)]
Upintegreate AAH TX and RX players from ICS_AAH

Upintegrate the android at home TX and RX players developed in the
ICS_AAH branch.

Change-Id: I8247d3702e30d8b0e215b31a92675d8ab28dccbb
Signed-off-by: John Grossman <johngro@google.com>
12 years agoFix a segfault in AudioFlinger.
John Grossman [Thu, 9 Feb 2012 19:28:36 +0000 (11:28 -0800)]
Fix a segfault in AudioFlinger.

Check the string returned by a HAL's implementation of get_parameters
for NULL before attempting to make use of it.  That way, we won't
bring down the mediaserver because of a poorly written HAL.

Change-Id: Ic99d7b004520d7d6347842a681c0595e889b68ea
Signed-off-by: John Grossman <johngro@google.com>
12 years agoEnhance Visualizer behavior in the case of mediaserver death.
John Grossman [Wed, 11 Jan 2012 20:23:42 +0000 (12:23 -0800)]
Enhance Visualizer behavior in the case of mediaserver death.

Bring the Visualizer class into line with the SDK documentation by
returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when
the Visualizer loses its binder connection to the mediaserver because
of a mediaserver restart.

Also add a new callback interface to allow clients to be
asynchronously notified in the case of server death.  Right now, the
interface definition and the registration method are flagged as hidden
pending API council review/approval.

See http://b/issue?id=5717519 for details.

Change-Id: Ic15856f27ed5a950a583ac11ca81f79bd7e9b1a0
Signed-off-by: John Grossman <johngro@google.com>
12 years agoUpintegrate Audio Flinger changes from ICS_AAH
John Grossman [Thu, 9 Feb 2012 00:37:41 +0000 (16:37 -0800)]
Upintegrate Audio Flinger changes from ICS_AAH

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>
12 years agoUpintegrate the common_time service from ics-aah.
Mike J. Chen [Mon, 15 Aug 2011 18:59:47 +0000 (11:59 -0700)]
Upintegrate the common_time service from ics-aah.

Move the common_time service developed in the ics-aah branch back into
master.

The common_time service is a small service build to synchronize an
arbitrary timeline amongst peers on a local sub-net.  While running
and configured, the service will elect a master from the set of
available devices within the subnet, define a relationship between the
common_time timeline the local time timeline (provided by the local
time HAL), and then attempt to maintain synchronization between common
and local time by controlling the frequency of the local time clock
via the HAL, or by disciplining local time in the digital domain if
the local time HAL implementation does not support HW slewing.

On its own, the native common time service will do nothing until it is
configured.  The CommonTimeManagementService (running out of the
system server process) is responsible for implementing policy
regarding configuration and operation of the common_time service and
will be added in a subsequent CL.

Change-Id: I71292f9b9b1797665865689c4572c9d3a0552f64
Signed-off-by: John Grossman <johngro@google.com>
12 years agoLimit the amount of audio record data in each buffer
James Dong [Tue, 14 Feb 2012 22:58:20 +0000 (14:58 -0800)]
Limit the amount of audio record data in each buffer

o The size of each input buffer should be less than or equal to kMaxBufferSize
o related-to-bug: 5977032

Change-Id: I04343169aac3df56694aad4ba7967ec45337ad7e

12 years agoMerge "Fix races related to volume and mute"
Glenn Kasten [Tue, 14 Feb 2012 17:44:47 +0000 (09:44 -0800)]
Merge "Fix races related to volume and mute"

12 years agoMerge "Update comments"
Glenn Kasten [Tue, 14 Feb 2012 17:42:32 +0000 (09:42 -0800)]
Merge "Update comments"

12 years agoUpdate comments
Glenn Kasten [Thu, 19 Jan 2012 16:59:58 +0000 (08:59 -0800)]
Update comments

We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e

12 years agoMerge "Remove dead code AudioTrack::getLoop"
Glenn Kasten [Tue, 14 Feb 2012 17:09:03 +0000 (09:09 -0800)]
Merge "Remove dead code AudioTrack::getLoop"

12 years agoUse size_t and ssize_t with Vector
Glenn Kasten [Wed, 8 Feb 2012 22:04:28 +0000 (14:04 -0800)]
Use size_t and ssize_t with Vector

Use size_t with size() and ssize_t with indexOfKey().  Exception:
use ssize_t for backwards loops, and indices that are overloaded as a
marker or error code.

Change-Id: Ibf2a360af4539b72b09c818dda22ea2a0de92431

12 years agoAudioRecord and AudioTrack client tid
Glenn Kasten [Thu, 2 Feb 2012 18:56:47 +0000 (10:56 -0800)]
AudioRecord and AudioTrack client tid

Inform AudioFlinger of the tid of the callback thread.

Change-Id: I670df92dd06749b057238b48ed1094b13aab720b

12 years agoPlayback rate on MediaPlayer
Jean-Michel Trivi [Thu, 2 Feb 2012 17:06:31 +0000 (09:06 -0800)]
Playback rate on MediaPlayer

Add support for modifying the playback rate of a MediaPlayer
 by altering the sample rate of its AudioTrack.
The playback rate is expressed in permille, where 1000 is the
 playback at normal speed.

Change-Id: I981d060ab32f7bae7a767e82c60c88ae635dceed

12 years agoMerge "Fix audio preprocessing library wrapper"
Eric Laurent [Mon, 13 Feb 2012 20:27:27 +0000 (12:27 -0800)]
Merge "Fix audio preprocessing library wrapper"

12 years agoFactor out and speed up permission-checking code
Glenn Kasten [Mon, 6 Feb 2012 02:09:08 +0000 (18:09 -0800)]
Factor out and speed up permission-checking code

Use the caching permission check for dump to save IPC.

Cache getpid() to save kernel call for other permission checks.

The C runtime library getpid() can't cache due to a fork
race condition, but we know that mediaserver doesn't fork.

Don't construct String16 on the stack.

Change-Id: I6be6161dae5155d39ba6ed6228e7683e67be34ed

12 years agoMerge "Change the signature of method addTextSource() in AwesomePlayer"
James Dong [Sat, 11 Feb 2012 01:57:16 +0000 (17:57 -0800)]
Merge "Change the signature of method addTextSource() in AwesomePlayer"

12 years agomAudioHwDevs and related cleanup
Glenn Kasten [Thu, 2 Feb 2012 22:05:20 +0000 (14:05 -0800)]
mAudioHwDevs and related cleanup

Inline AudioFlinger::initCheck and remove unnecessary lock.

Remove redundant check of mAudioHwDevs.size().

No need to lock mHardwareLock for each device separately
during initialization.

Use size_t not int to loop through Vector, since size() returns size_t.

Add missing hardware lock for get_mic_mute() and get_input_buffer_size().

Add comments.

Change-Id: Iafae78ef78bbf65f703d99fcc27c2f4ff221aedc

12 years agoMerge "Simplify ThreadBase::exit() aka requestExitAndWait"
Glenn Kasten [Fri, 10 Feb 2012 23:32:16 +0000 (15:32 -0800)]
Merge "Simplify ThreadBase::exit() aka requestExitAndWait"

12 years agoMerge "Disable HQ resamplers for now until qualified"
Glenn Kasten [Fri, 10 Feb 2012 23:31:54 +0000 (15:31 -0800)]
Merge "Disable HQ resamplers for now until qualified"

12 years agoMerge "Move header declarations around for clarity"
Glenn Kasten [Fri, 10 Feb 2012 23:31:07 +0000 (15:31 -0800)]
Merge "Move header declarations around for clarity"

12 years agoMerge "Camel case readability & private disconnect(bool)"
Glenn Kasten [Fri, 10 Feb 2012 23:30:15 +0000 (15:30 -0800)]
Merge "Camel case readability & private disconnect(bool)"

12 years agoMerge "Remove aliasing"
Glenn Kasten [Fri, 10 Feb 2012 23:29:35 +0000 (15:29 -0800)]
Merge "Remove aliasing"

12 years agoMerge "Use mul from audioutils"
Glenn Kasten [Fri, 10 Feb 2012 23:28:57 +0000 (15:28 -0800)]
Merge "Use mul from audioutils"

12 years agoMerge "Mark fields const if only set in constructor"
Glenn Kasten [Fri, 10 Feb 2012 23:28:45 +0000 (15:28 -0800)]
Merge "Mark fields const if only set in constructor"

12 years agoSimplify ThreadBase::exit() aka requestExitAndWait
Glenn Kasten [Fri, 6 Jan 2012 16:39:38 +0000 (08:39 -0800)]
Simplify ThreadBase::exit() aka requestExitAndWait

We can remove mExiting and use Thread::exitPending() instead.

The local sp<> on "this" in exit() is not needed, since the caller must
also hold an sp<> in order to be calling us. (Unless it was using a raw
pointer, but that would be dangerous for other reasons.)

Add comment explaining the mLock in exit().

Change-Id: I319e5107533a1a7cdbd13c292685f3e2be60f6c4

12 years agoMerge "Move away from MediaDebug and use ADebug instead"
James Dong [Fri, 10 Feb 2012 22:17:06 +0000 (14:17 -0800)]
Merge "Move away from MediaDebug and use ADebug instead"

12 years agoFollow raw pointer and sp<> conventions
Glenn Kasten [Thu, 9 Feb 2012 01:47:58 +0000 (17:47 -0800)]
Follow raw pointer and sp<> conventions

Unconditional delete for raw pointers.
Use "if (sp != 0)" not "if (sp.get() != 0)" or "if (sp != NULL)".
Use "if (raw != NULL)" not "if (raw)".

Change-Id: I531a8da7c37149261ed2f34b862ec4896a4b785b

12 years agoMerge "No newline or space at end of ALOG format string"
Glenn Kasten [Fri, 10 Feb 2012 21:36:24 +0000 (13:36 -0800)]
Merge "No newline or space at end of ALOG format string"

12 years agoMerge "Move declaration of stream_type_t up earlier"
Glenn Kasten [Fri, 10 Feb 2012 21:33:31 +0000 (13:33 -0800)]
Merge "Move declaration of stream_type_t up earlier"

12 years agoMerge "Fix typos in ALOG for pid vs tid"
Glenn Kasten [Fri, 10 Feb 2012 21:33:02 +0000 (13:33 -0800)]
Merge "Fix typos in ALOG for pid vs tid"

12 years agoMerge "Rename type() to streamType()"
Glenn Kasten [Fri, 10 Feb 2012 21:30:24 +0000 (13:30 -0800)]
Merge "Rename type() to streamType()"

12 years agoMove away from MediaDebug and use ADebug instead
James Dong [Tue, 7 Feb 2012 07:46:37 +0000 (23:46 -0800)]
Move away from MediaDebug and use ADebug instead

Change-Id: I963a3b6f79a7292891973cbeeaf3378b38629f08

12 years agoDisable HQ resamplers for now until qualified
Glenn Kasten [Thu, 2 Feb 2012 22:01:58 +0000 (14:01 -0800)]
Disable HQ resamplers for now until qualified

This saves about 6500 bytes.

Change-Id: I87102fe561c95c19c9e615dea3de914f96639257

12 years agoChange the signature of method addTextSource() in AwesomePlayer
James Dong [Fri, 10 Feb 2012 01:32:57 +0000 (17:32 -0800)]
Change the signature of method addTextSource() in AwesomePlayer

o avoid a unnecessary copy constructor call

Change-Id: Ib598bbe42d42a835549e2d29502c6f196f859874

12 years agoMove header declarations around for clarity
Glenn Kasten [Thu, 26 Jan 2012 17:48:03 +0000 (09:48 -0800)]
Move header declarations around for clarity

Put IAudioFlinger methods in binder opcode order.
Move hardware call state closer to where it is used.
getMode() and btNrecIsOff() are private.

Change-Id: Ie50340b396c39c763f2b155cbc08da8a0d0f2424