787 Commits

Author SHA1 Message Date
Chih-Chung Chang
09b9005769 Add multiple camera support for in MediaProfiles.
Change-Id: Ie89568a0f5f5fd08ede77e33f9a559215d6bed9a
2010-07-01 10:57:15 +08:00
Dianne Hackborn
c6e1d88022 Merge "Introduce official public NativeWindow type." into gingerbread 2010-06-30 16:05:30 -07:00
Dianne Hackborn
8b49bd1a2f Introduce official public NativeWindow type.
Not yet hooked up to anything in the NDK, but requires renaming
the existing android_native_window_t type everywhere.

Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
2010-06-30 15:32:04 -07:00
Jeff Brown
d009787182 Fix injection of specially intercepted keys like HOME.
This change mainly unwinds a premature optimization in the
dispatch pipeline.
To test HOME injection, run 'adb shell input keyevent 3'.

Change-Id: I1c4b7377c205da7c898014b8b07fc6dc1d46e4dd
2010-06-30 14:41:59 -07:00
Andreas Huber
caad0a5c63 Merge "Support for vanilla YUV420sp => RGB565 color conversion." into gingerbread 2010-06-30 11:32:31 -07:00
Dianne Hackborn
3c80a4a044 Implement default key handling for native code.
The native code now maintains a list of all keys that may use
default handling.  If the app finishes one of these keys
without handling it, the key will be passed back off to Java
for default treatment.

Change-Id: I6a842a0d728eeafa4de7142fae573f8c11099e18
2010-06-30 10:49:40 -07:00
Andreas Huber
c543a21a40 Support for vanilla YUV420sp => RGB565 color conversion.
Change-Id: I22e5b554909e169eaf153d1f25b636f6f04a1871
2010-06-30 10:32:39 -07:00
James Dong
f7679a0493 Merge "Added encoding parameters set up for H263 video encoder" into gingerbread 2010-06-29 17:24:10 -07:00
Jeff Brown
0b72e82c5f Fix native input dispatch in the emulator.
Set a default orientation of ROTATION_0.
Added some more careful checks based on whether we have valid
absolute axis information from the driver.
Reset key repeating during configuration changes since the keyboard
device may have been removed.

Change-Id: I685960828acffcb17595fc5683309e8064a76714
2010-06-29 16:52:21 -07:00
James Dong
c0ab2a6458 Added encoding parameters set up for H263 video encoder
Also:
- Allowed start() call when encoder already starts and stop() call when encoder has not started yet
- Handled default value for audio/video sources/encoders and file output format

Change-Id: I03b2f7d3cf570baa0fd011a8c0ad200f2f2a5da1
2010-06-29 16:44:19 -07:00
Dianne Hackborn
2e9f93e8db Update native activity & event APIs to follow correct conventions.
Change-Id: Ie64fb3a9c68bc9c117fa5621b75d1f609e304e0e
2010-06-29 10:43:54 -07:00
Chris Tate
31e0ffe844 Merge "Native input event dispatching." into gingerbread 2010-06-28 19:12:55 -07:00
Jeff Brown
349703effc Native input event dispatching.
Target identification is now fully native.
Fixed a couple of minor issues related to input injection.
Native input enabled by default, can be disabled by setting
WindowManagerPolicy.ENABLE_NATIVE_INPUT_DISPATCH to false.

Change-Id: I7edf66ed3e987cc9306ad4743ac57a116af452ff
2010-06-28 19:10:54 -07:00
James Dong
fe1bafecde Separate MediaRecorderClient with MediaPlayerClient
- An alternative would be to define a common base class that
  both MediaRecorderClient and MediaPlayerClient can derive.
  But since the common code, onTransact() and notify() uses
  some Binder code, having a common base class may not gain
  us too much in terms of code reuse.

Change-Id: Ibc06720278ad173fceacff3d267b7060856c6316
2010-06-28 15:32:26 -07:00
James Dong
09936ed192 Provide progress status report during authoring
- Track either the number of A/V frames authored, or the time elapsed
- Track the completion of the authoring
- Add multiple camera support for authoring by accepting a camera id parameter
- Set file type based on the OUTPUT_FORMAT requested

Change-Id: I0f9d31b3b7a8fa43eb53f572410fb0ebd4fa0bb7
2010-06-25 16:20:42 -07:00
Mathias Agopian
1cb3fdc91e Merge "Fix a bug in sp<> and wp<> which could cause memory corruptions" into gingerbread 2010-06-25 13:28:06 -07:00
Eric Laurent
8e103da1f1 Merge "Various fixes and improvements in audio effects implementation" into gingerbread 2010-06-25 12:35:30 -07:00
Eric Laurent
53334cdb81 Various fixes and improvements in audio effects implementation
Effect API:
- Use different definitions for audio device, channels, formats... in AudioSystem and EffectApi:
  Removed media/AudioCommon.h file created for initial version of EffectApi
- Indicate audio session and output ID to effect library when calling EffectCreate(). Session ID can be useful to optimize
the implementation of effect chains in the same audio session. Output ID can be used for effects implemented in audio hardware.
- Renamed EffectQueryNext() function to EffectQueryEffect() and changed operating mode:
  now an index is passed for the queried effect instead of implicitly querying the next one.
- Added CPU load and memory usage indication in effects descriptor
- Added flags and commands to indicate changes in audio mode (ring tone, in call...) to effect engine
- Added flag to indicate hardware accelerated effect implementation.
- Renamed EffectFactoryApi.h to EffectsFactoryApi.h for consistency with EffectsFactory.c/h

Effect libraries:
- Reflected changes in Effect API
- Several fixes in reverb implementation
- Added build option TEST_EFFECT_LIBRARIES in makefile to prepare integration of actual effect library.
- Replaced pointer by integer identifier for library handle returned by effects factory

Audio effect framework:
- Added support for audio session -1 in preparation of output stage effects configuration.
- Reflected changes in Effect API
- Removed volume ramp up/down when effect is inserted/removed: this has to be taken care of by effect engines.
- Added some overflow verification on indexes used for deferred parameter updates via shared memory
- Added hardcoded CPU and memory limit check when creating a new effect instance

Change-Id: I43fee5182ee201384ea3479af6d0acb95092901d
2010-06-25 11:59:35 -07:00
James Dong
6feaa46496 Enable passing parameters to the MediaWriter at runtime (at start() call).
- estimate the moov box size for mp4 file writer based on the file
  size/duration limit and target bit rate.
- can switch to use 64 bit file offset at runtime

rebased

Change-Id: Ibbe1f57e91ab2605820d5d96e8048d11e5559c53
2010-06-25 10:24:35 -07:00
James Dong
57e7f83c03 Track maximum amplitude and fix getMaxAmplitude()
- only start to track the max amplitude after the first call to getMaxAmplitude()

Change-Id: I64d3d9ca0542202a8535a211425e8bccceca50fc
2010-06-24 21:59:25 -07:00
Mathias Agopian
51a6aef53c Fix a bug in sp<> and wp<> which could cause memory corruptions
when assigning a smart pointer to another one, we need to make
sure to read all the data we need from the right-hand-side
reference (the assignee) before we decRef the assigned.

This bug would cause linked-list of smart-pointers to fail
miserably.

Change-Id: Ibb554c15fddf909f7737c632b7c80322e80ea93f
2010-06-24 21:49:02 -07:00
Andreas Huber
a2549bb644 Merge "Remove most stagefright property overrides, remove VorbisPlayer and VorbisMetadataRetriever as this functionality is now provided by stagefright." into gingerbread 2010-06-24 09:05:08 -07:00
Andreas Huber
8d65dd2653 Remove most stagefright property overrides, remove VorbisPlayer and VorbisMetadataRetriever as this functionality is now provided by stagefright.
Change-Id: Ieafe75a4550c273ad59b4518d7cd4c0fce0f7cce
related-to-bug: 2370115
2010-06-23 16:40:57 -07:00
James Dong
39a0b21c65 Fixed some meta data issues in the recorded mp4 file
- Mainly correcting the location of stbl box which should be a child of minf box.
  This resolved the issue where the mis-muxed encoded file could not be played by QT/VLC.

- Enabled the the recorded tracks by setting the flags to 0x07 by default

- Allows for encoding either 32-bit or 64-bit offsets. By default encoding
  32-bit offsets to reduce the metadata overhead

- Fixed a edts box issue where an empty elst box was used at the end

Change-Id: I570621a26714a81dc9400271aa5d3a07b483172f
2010-06-23 14:09:18 -07:00
Eric Laurent
2c2ce8e53f Merge "Added support for audio sessions in MediaPlayer and AudioTrack." into gingerbread 2010-06-22 18:29:57 -07:00
Chia-chi Yeh
3238302b18 Merge "media: add AudioRecord::getMinFrameCount()." into gingerbread 2010-06-22 17:20:44 -07:00
Eric Laurent
619346f902 Added support for audio sessions in MediaPlayer and AudioTrack.
Audio sessions are used to associate audio effects to particular instances (or groups) of MediaPlayers or AudioTracks.

Change-Id: Ib94eec43241cfcb416590f435ddce7ab39a07640
2010-06-22 17:14:04 -07:00
Chia-chi Yeh
97d61f7518 media: add AudioRecord::getMinFrameCount().
Change-Id: I952071ab10aa49aa96b727d157b68470d69fff3d
2010-06-23 08:01:04 +08:00
James Dong
750600a187 Merge "Single track optimization" into gingerbread 2010-06-22 14:28:15 -07:00
James Dong
b54a917842 Single track optimization
We don't need to do interleave when the total number of tracks to be recorded is one.
Metadata-wise, we only need to have one chunk in chunk offset table, and a
single entry in the stsc table.

Change-Id: I46f0e4b3860620311e7a91b68a9067acaa137bb2
2010-06-22 11:27:37 -07:00
Dianne Hackborn
a95e4cb62f First stab at attaching native event dispatching.
Provides the basic infrastructure for a
NativeActivity's native code to get an object representing
its event stream that can be used to read input events.

Still work to do, probably some API changes, and reasonable
default key handling (so that for example back will still
work).

Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
2010-06-22 11:21:50 -07:00
James Dong
e5671bfe51 Merge "Audio/video sync during recording (second part)" into gingerbread 2010-06-22 10:05:02 -07:00
Mike Lockwood
f602d362ba GPS: remove GpsEventThread from GpsLocationProvider
Rather than polling for events from the native code in an event thread,
we now require the GPS HAL libraries to call our callbacks from a thread
that is registered with the JVM to call directly into Java.
This eliminates a thread from our code and removes one step in the chain
of message passing from the GPS to the Location Manager client.

Change-Id: I2745a157690310ba9a699a8369f54a7366c6b1ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-06-22 09:26:41 -04:00
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