2500 Commits

Author SHA1 Message Date
Glenn Kasten
6a20b26d99 AudioRecord and AudioTrack client tid
Inform AudioFlinger of the tid of the callback thread.

Change-Id: I670df92dd06749b057238b48ed1094b13aab720b
2012-02-14 07:30:48 -08:00
Jean-Michel Trivi
fbd2e64346 Merge "Playback rate on MediaPlayer" 2012-02-13 14:21:36 -08:00
Jeff Brown
2d34e0cfe7 Accurately track the sequence numbers of batched events.
Instead of sending finished signals immediately when appending to
a batch, record the chain of sequence numbers that were part of
the batch and then send finished signals all at once when done.
This change helps the dispatcher keep track of the true state
of the application and can improve ANR detection slightly.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: I463c2221e2aa8fdf1c3d670c18e39e59ab69b0db
2012-02-13 13:59:32 -08:00
Jeff Brown
90fde93c47 Enable deferred input messages to be batched.
This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: I6874d2128e880a35c6c33890c858cc6ee22af0fd
2012-02-13 12:44:01 -08:00
Jean-Michel Trivi
e901a5c29b 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
2012-02-13 12:39:54 -08:00
Jeff Brown
072ec96a49 Implement batching of input events on the consumer side.
To support this feature, the input dispatcher now allows input
events to be acknowledged out-of-order.  As a result, the
consumer can choose to defer handling an input event from one
device (because it is building a big batch) while continuing
to handle input events from other devices.

The InputEventReceiver now sends a notification when a batch
is pending.  The ViewRoot handles this notification by scheduling
a draw on the next sync.  When the draw happens, the InputEventReceiver
is instructed to consume all pending batched input events, the
input event queue is fully processed (as much as possible),
and then the ViewRoot performs traversals as usual.

With these changes in place, the input dispatch latency is
consistently less than one frame as long as the application itself
isn't stalled.  Input events are delivered to the application
as soon as possible and are handled as soon as possible.  In practice,
it is no longer possible for an application to build up a huge
backlog of touch events.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420

Change-Id: I42c01117eca78f12d66d49a736c1c122346ccd1d
2012-02-13 10:28:41 -08:00
Jeff Brown
cbee6d6ede Rewrite input transport using sockets.
Since we will not longer be modifying events in place, we don't need
to use an ashmem region for input.  Simplified the code to instead
use a socket of type SOCK_SEQPACKET.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420

Change-Id: I05909075ed8b61b93900913e44c6db84857340d8
2012-02-13 10:28:40 -08:00
James Dong
8e9d67a135 Move away from MediaDebug and use ADebug instead
Change-Id: I963a3b6f79a7292891973cbeeaf3378b38629f08
2012-02-10 11:43:09 -08:00
Dianne Hackborn
a573f6a1d9 Some hardening of isolated processes by restricting access to services.
Services now must explicitly opt in to being accessed by isolated
processes.  Currently only the activity manager and surface flinger
allow this.  Activity manager is needed so that we can actually
bring up the process; SurfaceFlinger is needed to be able to get the
display information for creating the Configuration.  The SurfaceFlinger
should be safe because the app doesn't have access to the window
manager so can't actually get a surface to do anything with.

The activity manager now protects most of its entry points against
isolated processes.

Change-Id: I0dad8cb2c873575c4c7659c3c2a7eda8e98f46b0
2012-02-09 18:06:01 -08:00
Daniel Lam
f7c761e5d3 Refactored query function from SurfaceTexture into BufferQueue
Change-Id: Id1cb6cc38d01edb4fcfcad867c5a7693bdcc3ab1
2012-02-09 16:16:51 -08:00
Jamie Gennis
1c90e73f5d Merge "Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue." 2012-02-09 11:08:02 -08:00
Glenn Kasten
6c9ddd2cbb Remove dead code AudioTrack::getLoop
Change-Id: I868329c52f31bc20125f068500d8f892b4ec9796
2012-02-08 14:12:12 -08:00
James Dong
e1a409ba68 Merge "Enable B frame support in MPEG4Writer" 2012-02-08 10:42:35 -08:00
Glenn Kasten
39d00cb442 Use audio_io_handle_t consistently instead of int
Other:
 - add a comment to nextUniqueId
 - made ThreadBase::mId const, since it is only assigned in constructor.

Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837
2012-02-08 10:06:32 -08:00
Glenn Kasten
6731333584 Effect UUID inputs passed by pointer are const
Change-Id: I1f5c338bcb7368e3dd8cd5f804b2e6d9fbe087f8
2012-02-08 09:21:39 -08:00
Glenn Kasten
1b33107f37 Merge "Don't double destruct audio_track_cblk_t" 2012-02-08 08:40:15 -08:00
Glenn Kasten
1e3a8d3090 Merge "Remove dead mutex in AudioTrack/AudioRecord thread" 2012-02-08 08:34:33 -08:00
Glenn Kasten
09b9ba0db2 Merge "AudioTrack declare more methods const" 2012-02-08 07:42:40 -08:00
Glenn Kasten
16d64ad699 Merge "Declare more IAudioFlinger methods const" 2012-02-08 07:39:27 -08:00
James Dong
7251673821 Enable B frame support in MPEG4Writer
This patch allows us to automatically detect whether ctts box is needed in MPEG4Writer.
MPEG4Writer uses ctts version 0 (non-negative offset value) store the composition time
offset on a needed basis.

Currently, the size of the ctts box is not optimized. Optimization will be addressed
in a subsequent patch.

o also changed the private method retrieveDecodingTime(bool) in OMXCodec
  to getDecodingTime()

o related-to-bug: 4232183

Change-Id: Ic6dc7b25ecd258c2506ca4b9c25156e922456e51
2012-02-07 18:32:29 -08:00
Romain Guy
68c02e25e8 Merge "Preliminary support for clipRect(Rect, Op)" 2012-02-07 17:07:00 -08:00
Romain Guy
967e2bf3ac Preliminary support for clipRect(Rect, Op)
This adds basic support for clip regions. It is currently disabled at compile
time. Enabling clip regions will require setting up a stencil buffer.

Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
2012-02-07 17:04:34 -08:00
Daniel Lam
70e80aacf9 Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue.
Change-Id: I514f6b802f6b49c9ae27bed37bf0b9d23da03c9a
2012-02-07 13:57:01 -08:00
James Dong
f5a9f439b6 Don't call virtual function in destructor of SurfaceMediaSource
Change-Id: I3cbc2b1222335b61c814b5cdcfaefa495148b0ec
2012-02-06 12:17:44 -08:00
James Dong
cea2c396c5 Merge "Don't call virtual functions in the destructor for audio and camera source classes" 2012-02-04 05:54:54 -08:00
Glenn Kasten
d9d68dcb62 Don't double destruct audio_track_cblk_t
Fortunately audio_track_cblk_t doesn't have a destructor, but for clarity
remove the double destruction.

Also add warning not to add any virtuals to audio_track_cblk_t.

Change-Id: I70ebe1a70460c7002145b2cdf10f9f137396e6f3
2012-02-03 16:16:46 -08:00
Glenn Kasten
7c2e37dd32 AudioTrack declare more methods const
Change-Id: I4999e984460893961d0d8092cff17f3cf07d7214
2012-02-03 15:48:25 -08:00
Glenn Kasten
3f6d83a68a Declare more IAudioFlinger methods const
This is just documentation, as C++ method const-ness doesn't mean anything
for a binder API.  Instead, here const means "no side effects".

Change-Id: Iaa9cd2fe477db10ae9a40cac4f79f0faa9b4e5e6
2012-02-03 15:40:56 -08:00
James Dong
4651c0ea80 Merge "Don't call virtual functions in destructors for the writer classes" 2012-02-03 15:37:40 -08:00
Amith Yamasani
1ef7d13172 Merge "Multi-user - 1st major checkin" 2012-02-03 12:04:40 -08:00
Amith Yamasani
742a671273 Multi-user - 1st major checkin
Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
2012-02-03 12:01:47 -08:00
Glenn Kasten
f55bc56490 Merge "Use audio_in_acoustics_t consistently" 2012-02-03 08:31:01 -08:00
Glenn Kasten
191c849283 Merge "Use ToneGenerator::tone_type consistently" 2012-02-03 08:00:52 -08:00
Glenn Kasten
3694ec1f19 Use NULL not 0 for raw pointers
Use if (p != NULL) instead of if (ptr)

Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
2012-02-03 07:57:01 -08:00
Glenn Kasten
08d5eb9885 Merge "Make AudioTrack control block volume field private" 2012-02-03 07:18:06 -08:00
James Dong
946ab0ff30 Don't call virtual functions in the destructor for audio and camera source classes
Change-Id: Ia74ffc1c0cbd7971697f5e3c476e340ec5c7727a
2012-02-02 18:11:53 -08:00
Mathias Agopian
b545eaa9cb Merge "separate transactions from updates" 2012-02-02 16:28:05 -08:00
James Dong
c2240b127b Don't call virtual functions in destructors for the writer classes
Have not found any concrete bugs related to these calls yet, but we should avoid
calling virtual functions in destructors, regardless.

Change-Id: I2d47b79d3fb2d29f418619bee83aa147d232a5d4
2012-02-02 15:13:56 -08:00
Glenn Kasten
91a7b145df Merge "More audio_stream_type_t" 2012-02-02 13:26:12 -08:00
Glenn Kasten
ac1748ce33 Merge "Thread::getTid returns pid_t gettid() after run" 2012-02-02 13:24:52 -08:00
Glenn Kasten
4b80abcdd5 Remove dead mutex in AudioTrack/AudioRecord thread
The client callback threads had mutexes called AudioTrackThread::mLock
and ClientRecordThread::mLock.  These mutexes were only used by start()
and stop(), and were unused by the thread itself.  But start() and
stop() already have their own protection provided by AudioTrack::mLock
and AudioRecord::mLock.  So the thread mutexes can be removed.

Change-Id: I098406d381645d77fba06a15511e179a327848ef
2012-02-02 11:23:30 -08:00
Mathias Agopian
9a9dbd5921 separate transactions from updates
with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
2012-02-01 20:43:06 -08:00
Mathias Agopian
dcaf1adcb6 Merge "fix an issue with vsync event delivery" 2012-01-31 16:46:27 -08:00
Mathias Agopian
58737fe96d fix an issue with vsync event delivery
vsync events were sometimes delivered to connected
client who didn't request them. this happened if
another client requested the delivery and that client
was first in the client list.

also fix the vsync test which didn't request any events as
well as DisplayEventReveiver documentation which was misleading
about the necessity to request vsync events.

Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686
2012-01-31 16:42:54 -08:00
Dianne Hackborn
6c997a9e88 aapt now sorts the strings in the resource string pool.
In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).

Also add a new aapt command to print the contents of the resource
table string pool.

Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
2012-01-31 15:41:30 -08:00
Andreas Huber
f6b4ca408e Slighly improve the API to discover if the OMX stack is running in the local
process.

Change-Id: Idd3c2f0d4a9542af01a3fdfd3b0bfab90e083505
2012-01-31 11:16:24 -08:00
Glenn Kasten
b7cffb4140 More audio_stream_type_t
Change-Id: I1260259efe0aa3fc1ef13de69758aaa592e1f815
2012-01-27 16:33:43 -08:00
Glenn Kasten
23f7ad39ef Use ToneGenerator::tone_type consistently
Also remove defaults in startToneCommand(), they're not needed and the
default for tone type was nonsense.

Change-Id: I70fa8cee4f3dbb8c66ceb3719c8d3d2f447f05b9
2012-01-27 16:01:44 -08:00
Glenn Kasten
882c0a20c5 Use audio_in_acoustics_t consistently
Change-Id: I0a9dd668fb2e57b1c3ece3190588194974b99062
2012-01-27 13:31:54 -08:00
Glenn Kasten
c14639a9a1 Merge "Use audio_source_t consistently" 2012-01-27 09:06:00 -08:00