854 Commits

Author SHA1 Message Date
James Dong
36e573bf7d Audio/video sync during recording (second part)
Change-Id: Iba0b35f57fdeac7ee1da16899406bf4b957a2c8c
2010-06-21 17:34:01 -07:00
Brad Fitzpatrick
ef8f96a717 Merge "Start of work on passing around StrictMode policy over Binder calls." into gingerbread 2010-06-21 15:31:01 -07:00
Jeff Brown
7fbdc84e87 More native input event dispatching.
Added ANRs handling.
Added event injection.
Fixed a NPE ActivityManagerServer writing ANRs to the drop box.
Fixed HOME key interception.
Fixed trackball reporting.
Fixed pointer rotation in landscape mode.

Change-Id: I50340f559f22899ab924e220a78119ffc79469b7
2010-06-21 13:59:34 -07:00
Brad Fitzpatrick
27b3a7a759 Start of work on passing around StrictMode policy over Binder calls.
This is (intendend to be) a no-op change.

At this stage, Binder RPCs just have an additional uint32 passed around
in the header, right before the interface name.  But nothing is actually
done with them yet.  That value should right now always be 0.

This now boots and seems to work.

Change-Id: I135b7c84f07575e6b9717fef2424d301a450df7b
2010-06-21 12:56:35 -07:00
Chia-chi Yeh
2ce999fce7 am bd240c27: media: add AudioTrack::getMinFrameCount().
Merge commit 'bd240c2737913d6ed1982788699f93bbc52330c0' into gingerbread

* commit 'bd240c2737913d6ed1982788699f93bbc52330c0':
  media: add AudioTrack::getMinFrameCount().
2010-06-21 08:54:19 -07:00
Chia-chi Yeh
bd240c2737 media: add AudioTrack::getMinFrameCount().
Change-Id: If15162583d1d16d89f59be0793106afe77417f35
2010-06-21 09:51:18 +08:00
Jeff Brown
5c225b1680 Even more native input dispatch work in progress.
Added more tests.
Fixed a regression in Vector.
Fixed bugs in pointer tracking.
Fixed a starvation issue in PollLoop when setting or removing callbacks.
Fixed a couple of policy nits.

Modified the internal representation of MotionEvent to be more
efficient and more consistent.

Added code to skip/cancel virtual key processing when there are multiple
pointers down.  This helps to better disambiguate virtual key presses
from stray touches (such as cheek presses).

Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
2010-06-17 13:27:16 -07:00
Jeff Brown
9c3cda04d9 More work in progress on native events.
Refactored the code to eliminate potential deadlocks due to re-entrant
calls from the policy into the dispatcher.  Also added some plumbing
that will be used to notify the framework about ANRs.

Change-Id: Iba7a10de0cb3c56cd7520d6ce716db52fdcc94ff
2010-06-15 16:43:18 -07:00
Eric Laurent
01f7ac6448 Merge "Issue 2667802: [Audio Effect Framework] AudioEffect base class and JNI." into kraken 2010-06-14 09:02:13 -07:00
Jeff Brown
43a9527c54 Fix include paths.
Change-Id: Ifda45688f9f02710a74d5d7a7d902bacf1441e2e
2010-06-13 19:35:19 -07:00
Jeff Brown
46b9ac0ae2 Native input dispatch rewrite work in progress.
The old dispatch mechanism has been left in place and continues to
be used by default for now.  To enable native input dispatch,
edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy.

Includes part of the new input event NDK API.  Some details TBD.

To wire up input dispatch, as the ViewRoot adds a window to the
window session it receives an InputChannel object as an output
argument.  The InputChannel encapsulates the file descriptors for a
shared memory region and two pipe end-points.  The ViewRoot then
provides the InputChannel to the InputQueue.  Behind the
scenes, InputQueue simply attaches handlers to the native PollLoop object
that underlies the MessageQueue.  This way MessageQueue doesn't need
to know anything about input dispatch per-se, it just exposes (in native
code) a PollLoop that other components can use to monitor file descriptor
state changes.

There can be zero or more targets for any given input event.  Each
input target is specified by its input channel and some parameters
including flags, an X/Y coordinate offset, and the dispatch timeout.
An input target can request either synchronous dispatch (for foreground apps)
or asynchronous dispatch (fire-and-forget for wallpapers and "outside"
targets).  Currently, finding the appropriate input targets for an event
requires a call back into the WindowManagerServer from native code.
In the future this will be refactored to avoid most of these callbacks
except as required to handle pending focus transitions.

End-to-end event dispatch mostly works!

To do: event injection, rate limiting, ANRs, testing, optimization, etc.

Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
2010-06-13 17:42:16 -07:00
James Dong
08c7473ce9 Initial checkin for pause and resume control
Change-Id: Ibdcf7bea5fb66baa81878704ba4091dfcfe382ee
2010-06-11 13:48:48 -07:00
Eric Laurent
948235c06e Issue 2667802: [Audio Effect Framework] AudioEffect base class and JNI.
Added AudioEffect C++ class. AudioEffect is the base class for effect specific implementations,
OpenSL ES effect interfaces and audio effect JNI.

Added the AudioEffect JNI and AudioEffect JAVA class. AudioEffect is the base class
to implement more specific JAVA classes to control audio effects from JAVA applications.

Change-Id: If300a1b708f2e6605891261e67bfb4f8330a4624
2010-06-11 06:26:31 -07:00
Chih-Chung Chang
b8bb78f54b Change camera interface to support multiple cameras.
Change-Id: Ie88fe706d2278acf762eca87780de349434778a4
2010-06-11 16:47:33 +08:00
Andreas Huber
4d61f602bf Switch stagefright's approach to prefetching to the new model. The java MediaPlayer is now notified about rebuffering start/end via info messages.
Change-Id: If8185ba329ce8b6663b1ad39a4efb0ad3be81df2
2010-06-10 15:16:57 -07:00
Andreas Huber
c81d2c12de Merge "Initial check-in of new caching/prefetching data source implementation." into kraken 2010-06-10 15:15:29 -07:00
Andreas Huber
1f24b30fe4 Support "pausing" of MediaSources with the effect that they no longer pull on their upstream source until a subsequent read-with-seek.
Change-Id: Ie4153a10ab36c1135f5fcfb572958129d886bcc3
2010-06-10 11:24:49 -07:00
Andreas Huber
b206319122 Initial check-in of new caching/prefetching data source implementation.
Change-Id: I97a6e3f03c69c9b1219f1f06bd109c0102f2c504
2010-06-10 11:23:56 -07:00
Mathias Agopian
5e14010b1f allow re-targetting of surfaces
Surfaces can now be parcelized and sent to remote
processes. When a surface crosses a process
boundary, it looses its connection with the
current process and gets attached to the new one.

Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
2010-06-08 20:10:02 -07:00
James Dong
1244eab2ce Remove some hard-coded encoding parameters
Change-Id: I7a8ccd5d57891a6a585c8da2ee53acb094955913
2010-06-08 12:30:58 -07:00
James Dong
dae9fd3190 Initial check-in for collecting stats from authoring engine at runtime
Change-Id: I93a9d8bd260efc5e7fc135b726e3f1307c6df794
2010-06-08 11:54:21 -07:00
James Dong
4f501f0f2b Second part of speeding up video recording frame rate
1. Avoid copying the input recording frames to the encoder via OMX interface
   for TI video encoder
   This is a missing change for part one which help reduces the CPU load.

2. Release output buffers as early as possible. This is a little bit helpful, but not critical.

TODO:
We should save the underlying pointers allocated by the OMX component before we replace them
and restore them before we call OMX_FreeBuffer()!

Change-Id: Ib3a88978f4c3b1153808872eaa7ac4c265a811ff
2010-06-08 10:01:47 -07:00
Andreas Huber
a557b24ac4 Initial checkin of mpeg2 transport stream parser for stagefright.
Change-Id: I328ce77404daf7127933b48c9d58ed504fb8fc6f
2010-06-07 13:05:37 -07:00
Andreas Huber
455d41002e Merge "Initial checkin of "foundation" library for future stagefright development." into kraken 2010-06-07 12:50:05 -07:00
Andreas Huber
7d2f703649 Initial checkin of "foundation" library for future stagefright development.
Change-Id: I11714dcaa647d0437a13e4c5b953b35e712da8f3
2010-06-07 10:22:07 -07:00
James Dong
7a68d3686a Merge "Remove hard-coded pixel format for recording frames in CameraSource. Retrieve the pixel format from Camera HAL at runtime." into kraken 2010-06-07 10:19:58 -07:00
Mathias Agopian
fae5cb2b35 optimize Surface.readFromParcel()
this is called for each relayout() and used to create a full Surface (cpp)
which in turn did some heavy work (including an IPC with surfaceflinger),
most of the time to destroy it immediatelly when the returned surface
(the one in the parcel) was the same.

we now more intelligentely read from the parcel and construct the new
object only if needed.

Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
2010-06-04 18:57:41 -07:00
Mathias Agopian
7623da435e split surface management from surface's buffers management
Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
2010-06-04 18:57:41 -07:00
Wu-cheng Li
cefb01abbf Merge "Add KEY_SUPPORTED_METERING_MODES and fix some typos." into kraken 2010-06-04 03:38:25 -07:00
Wu-cheng Li
8aba232dbc Add KEY_SUPPORTED_METERING_MODES and fix some typos.
bug:2737111
Change-Id: I108ae7057786921bf99385ad66dbc1f02d6a1448
2010-06-04 17:18:17 +08:00
Eric Laurent
2ea200c5a7 Merge "Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications." into kraken 2010-06-04 00:14:46 -07:00
James Dong
c2f328d0d2 Remove hard-coded pixel format for recording frames in CameraSource.
Retrieve the pixel format from Camera HAL at runtime.

Change-Id: I63f820f54c59c2019dfd195320b9928da3362536
2010-06-03 11:51:39 -07:00
Eric Laurent
65b65459e6 Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications.
First drop of audio framework modifications for audio effects support.

- AudioTrack/AudioRecord:
Added support for auxiliary effects in AudioTrack
Added support for audio sessions
Fixed left right channel inversion in setVolume()

- IAudioFlinger:
Added interface methods for effect enumeraiton and instantiation
Added support for audio sessions.

- IAudioTrack:
Added method to attach auxiliary effect.

- AudioFlinger
Created new classes to control effect engines in effect library and manage effect connections to tracks or
output mix:
  EffectModule: wrapper object controlling the effect engine implementation in the effect library. There
	is one EffectModule per instance of an effect in a given audio session
  EffectChain: group of effects associated to one audio session. There is one EffectChain per audio session.
	EffectChain for session 0 is for output mix effects, other chains are attached to audio tracks
	with same session ID. Each chain contains a variable number of EffectModules
  EffectHandle: implements the IEffect interface. There is one EffectHandle object for each application
	controlling (or using) an effect module. THe EffectModule maintians a list of EffectHandles.

Added support for effect modules and effect chains creation in PlaybackThread.
modified mixer thread loop to allow track volume control by effect modules and call effect processing.

-AudioMixer
Each track now specifies its output buffer used by mixer for accumulation
Modified mixer process functions to process tracks by groups of tracks with same buffer
Modified track process functions to support accumulation to auxiliary channel

Change-Id: I26d5f7c9e070a89bdd383e1a659f8b7ca150379c
2010-06-03 03:21:53 -07:00
Wu-cheng Li
f7f6333831 Add camera metering mode API.
bug:2737111
Change-Id: Ie986fee56ebeaaed2d2efb757701dfe3ffdec8d8
2010-06-03 16:34:18 +08:00
Mathias Agopian
770492cb2b more clean-up in preparation of bigger changes
the most important change here is the renaming of
ISurfaceFlingerClient to ISurfaceComposerClient

Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3
2010-05-28 17:19:16 -07:00
Mathias Agopian
cdfd5fe2c8 Fix a typo in Singleton<>
it could cause the sLock field to be emitted several times
in different compilation unit. it also prevented to
have 2 Singleton<> in the same file.
2010-05-28 15:13:30 -07:00
James Dong
464411983a Merge "Avoid copying for input recording frames in CameraSource" into kraken 2010-05-28 10:53:09 -07:00
James Dong
dfb1dd6a8c Avoid copying for input recording frames in CameraSource
This is the part one.

- Let CameraSource be a MediaBufferObserver. It releases the recording frame when the ref count of a MediaBuffer containing
  the recording frame drops to 0.

  This reduces the CPU load from 90+% down to 50-60%.

Part two is related to the avoidance of copying the input video frames to the video encoder.
However, we are not able to use OMX_UseBuffer directly. Still work on the second part.

Change-Id: I906f1d054ae8bdcf82e1617f1fc120152f2eb2eb
2010-05-28 10:44:20 -07:00
Wu-cheng Li
198975bb01 Merge "Add video frame parameter." into kraken 2010-05-28 04:34:13 -07:00
Wu-cheng Li
d2c2929c94 Add video frame parameter.
The image format of preview frames and video frames may be different.
We need another parameter for video frame format.

bug:2720893
Change-Id: I966a31b0ce8cab25cdde65db65a18c8cbe9c7bd6
2010-05-28 17:32:41 +08:00
Mathias Agopian
c7b388c2b3 more clean-up of Surfaceflinger's client management
SurfaceComposerClient now only exist on the WindowManager side,
the client side uses the new SurfaceClient class, which only
exposes what a client needs.

also instead of keeping mappings from IBinder to SurfaceComposerClients
we have a SurfaceClient per Surface (referring to the same IBinder), this
is made possible by the fact that SurfaceClient is very light.

Change-Id: I6a1f7015424f07871632a25ed6a502c55abfcfa6
2010-05-27 19:55:43 -07:00
James Dong
1090a29d4e Merge "Avoid repeatedly allocating and freeing memory in CameraSource" into kraken 2010-05-26 17:01:16 -07:00
James Dong
aed15e7856 Avoid repeatedly allocating and freeing memory in CameraSource
Change-Id: Ia3760820da0559e4e908dedae1f1df05f9a6a242
2010-05-26 16:54:18 -07:00
Eric Laurent
27a308d309 Merge "Fix issue 2667797: [Audio Effect Framework] new base class and binder interfaces for effect control." into kraken 2010-05-25 23:48:30 -07:00
Mathias Agopian
64f7549b0e Merge "fix [2712278] The preview buffer left some black borders in left and bottom edges" into kraken 2010-05-25 17:56:07 -07:00
Mathias Agopian
2ce19af45b fix [2712278] The preview buffer left some black borders in left and bottom edges
we were incorrectly flagging push_buffer surfaces as invalid

Change-Id: I4dfd4ffbbe8a71f7e23e835db8d71966416c29bb
2010-05-25 17:51:34 -07:00
Eric Laurent
c0f34386d6 Fix issue 2667797: [Audio Effect Framework] new base class and binder interfaces for effect control.
Added IEffect and IEffectClient binder interfaces to exchange effect module control
and status information between application and media server processes.

Change-Id: I10e8e894898e52ed9956a765d0ef7075eb2593af
2010-05-24 23:33:42 -07:00
Eric Laurent
cf3fa85cdb Merge "Fix issue 2667796: [Audio Effect Framework] Effect factory and libraries." into kraken 2010-05-24 23:23:29 -07:00
Mathias Agopian
2be352adab added the notion of fixed-size buffers
the new native_window_set_buffers_geometry allows
to specify a size and format for all buffers to be
dequeued. the buffer will be scalled to the window's
size.

Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
2010-05-24 18:26:01 -07:00
Mathias Agopian
57d89899c9 fix a bug when reallocating a window's buffers is needed
we need to mark the buffers that need to be reallocated,
NOT the buffer's indices.

Change-Id: I809e2e1b03b56c4d2ab983c25523dae99aa1da74
2010-05-24 13:47:24 -07:00