930 Commits

Author SHA1 Message Date
James Dong
d353c840ad Merge "HW audio encoder expects timestamp via kKeyTime from each input buffer" into gingerbread 2010-09-08 17:51:59 -07:00
James Dong
d015ccf62b HW audio encoder expects timestamp via kKeyTime from each input buffer
- This fixes media server crashes on droid

Change-Id: I7191cadc5275107425ec3ee3d437b2c5295858dc
2010-09-08 17:28:57 -07:00
Eric Laurent
95d5de0681 Modify type of some environmental reverb parameters
Changed type of decay time, reverb delay and reflections delay parameters
from signed to unsigned int to match OpenSL ES interface definition.

Also fixed some type casts in lvm reverb wrapper.

Change-Id: I5ca5e76a87c2590f01f031f3168355586ef22556
2010-09-08 16:06:18 -07:00
Jeff Brown
b21fb104cc Fix key repeat delay.
Change-Id: I6216e082324ee29bf50e37acc673350ca5417c4d
2010-09-08 12:28:43 -07:00
Jeff Brown
85a3176704 Add support for secure views.
Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the
input manager whenever another visible window is partly or wholly obscured
the target of a touch event so that applications can filter touches
accordingly.

Added a "filterTouchesWhenObscured" attribute to View which can be used to
enable filtering of touches when the view's window is obscured.

Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
2010-09-08 11:50:55 -07:00
Dianne Hackborn
42c03e579a Modify native ALooper to take an explicit ident.
The ALooper API now uses an explicit "identifier" for the integer
that is returned rather than implicitly using the fd.  This allows
the APIs that had the fd to be a little more sane.

Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
2010-09-07 15:46:55 -07:00
Andreas Huber
9fee0b2a02 Ogg files can be tagged to be automatically looping, this setting always overrides the MediaPlayer's setLooping setting.
Change-Id: Ifb564c6cdf6137eac14869f9ca7d471f05a5556a
related-to-bug: 2974691
2010-09-03 14:31:50 -07:00
James Dong
7755cdd696 Remove unused/debugging code from MP4 file writer
o also makes nal length in the recorded file modifiable at runtime

Change-Id: I731b4dde7070d8d9628b36b523a5b2c011c7c2cf
2010-09-03 10:13:19 -07:00
James Dong
cb7e65c6cb Better file size estimate
When the recorded file becomes large, the metadata size can
no longer be ignored. This makes it possible to save the
recorded file when the storage becomes almost full at the
end of the recording session.

Change-Id: Ief038080f825c9946ce550949c03e914aec1e31a
2010-09-02 20:10:00 -07:00
James Dong
4c23815c39 Calculate audio media drift time from AudioSource
The problem was that the time to receive an output buffer
from an audio encoder is different because the encoder does not
need to read from the source for all output buffers. This leads
to large fluctuation in terms of wall clock duration between two
neighboring audio sample outputs from the audio encoder. As a
result, the media time for the video track after adjustment using
the drifting changes wildly sometimes.

This patch addresses this issue by only updating the media drift
time when an audio source input buffer is read. the wall clock
for the audio track is also calculated at the same time when
the input audio buffer is read at AudioSource.

bug - 2959800

Change-Id: I3174aa182f744784b540f0a7198524d4eee8bd7b
2010-09-01 20:45:39 -07:00
Jeff Brown
5fad2675e8 Remove incomplete input device enumeration NDK API.
Change-Id: I32de74ff5fcf0e29179a2aee03ddabd22fa485bb
2010-08-31 15:24:55 -07:00
Brad Fitzpatrick
0234376503 Don't propagate StrictMode over one-way Binder calls.
This was causing stack stitching problems where a one-way call with
violations followed by a two-way call without violations was getting
the previous one-way call's violation stack stitched on to the second
caller's stack.

The solution is a little more indirect than I would've liked
(preserving the binder's onTransact flags until enforceInterface) but
was seemingly necessary to work without changing the AIDL compiler.
It should also be sufficiently cheap, since no new calls to
thread-local IPCThreadState lookups were required.  The additional
work is just same-thread getter/setters on the existing
IPCThreadState.

Change-Id: I4b6db1d445c56e868e6d0d7be3ba6849f4ef23ae
2010-08-31 13:16:49 -07:00
Jeff Brown
8d60866e21 Input device calibration and capabilities.
Finished the input device capability API.
Added a mechanism for calibrating touch devices to obtain more
accurate information about the touch contact area.
Improved pointer location to show new coordinates and capabilities.
Optimized pointer location display and formatting to avoid allocating large
numbers of temporary objects.  The GC churn was causing the application to
stutter very badly when more than a couple of fingers were down).
Added more diagnostics.

Change-Id: Ie25380278ed6f16c5b04cd9df848015850383498
2010-08-30 18:16:43 -07:00
Wu-cheng Li
7ec7b9970c Remove camera metering mode API.
Metering mode is not supported yet.

Change-Id: Id6906d6ab0cd1a9dcbc5c303d8d5081b2cda699e
2010-08-30 13:33:53 -07:00
Andreas Huber
df992ac9cc Merge "ALoopers can now be named (useful to distinguish threads)." into gingerbread 2010-08-30 10:28:24 -07:00
Andreas Huber
c4e0b70a21 ALoopers can now be named (useful to distinguish threads).
Change-Id: Ieabaddb2e3a9e3a7a5bc36e55cd0721b60dbd50e
2010-08-27 15:21:07 -07:00
James Dong
90862e2a8b Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder
is occasionally too small.

bug - 2882917

Change-Id: Id59d8529084c5689a26f272e0cd3b1e955fd8a30
2010-08-27 13:59:26 -07:00
James Dong
b86365ad74 Merge "Suppress the video recording start signal - bug 2950297" into gingerbread 2010-08-27 13:47:06 -07:00
Mathias Agopian
c9289fa1c4 fix a race in SF buffer management
also remove some unused code.

Change-Id: Iae2c3309b7a08055f3e13a5b866c5c084993e352
2010-08-26 17:42:27 -07:00
James Dong
d7f1c3d692 Suppress the video recording start signal
- bug 2950297

Change-Id: I0044d07178691feb904cf81e87c1b6d4b714dc1a
2010-08-26 16:56:49 -07:00
Eric Laurent
c14f9ca6e5 Merge "Added preset reverb." into gingerbread 2010-08-25 15:09:10 -07:00
Andreas Huber
efdd088a71 Allow sniffers to return a packet of opaque data that the corresponding extractor can take advantage of to not duplicate work already done sniffing. The mp3 extractor takes advantage of this now.
Change-Id: Icb77ae3ee95a69c7da25b4d3b8696c0a2d33028a
related-to-bug: 2948754
2010-08-25 13:08:38 -07:00
Eric Laurent
a7e5648d61 Added preset reverb.
Modified lvm reverb wrapper code to expose a preset reverb interface.
Also removed debug log from bundle and reverb wrapper.

Change-Id: If9b95d91e25a6ff834decdfdda34b17df9b46967
2010-08-24 17:32:48 -07:00
Mathias Agopian
e96aa3e859 fix [2931513] Add support for setting the orientation of an ANativeWindow
Also implement support for cropping.

Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
2010-08-24 15:40:50 -07:00
James Dong
3f51fa78ad Runtime dump support for MediaWriter
Change-Id: I10b2c474de612ee4cef4b7c9eae2ee1dd8c2e895
2010-08-23 10:34:05 -07:00
Chia-chi Yeh
b80e610b07 Merge "Visualizer: replace the FFT implementation with a faster one." into gingerbread 2010-08-22 18:31:15 -07:00
Kenny Root
be857d4284 Reorganize MountService IPC
Remove auto-generated AIDL files and replace them with manually edited
.java and .cpp/.h files so that binder calls can be made from either
Java or C++.

Update the makefiles to not attempt to generate the AIDL files and also
remove the old auto-generated .java files.

Put all the storage-related C++ things in libstorage so that we don't
pollute other libraries.

Change-Id: I82d1631295452709f12ff1270f36c3100e652806
2010-08-20 13:17:12 -07:00
Wu-cheng Li
97a56269d0 Merge "Add camera fps range API." into gingerbread 2010-08-20 11:19:51 -07:00
Wu-cheng Li
454630f237 Add camera fps range API.
Original preview frame rate API assumes the frame rate
is fixed. It does not not work with auto frame rate camera.

Change-Id: I38f7122ac8ec844ffd63558dc0763ffa17b0926a
2010-08-20 11:14:17 -07:00
Wu-cheng Li
271c1bfd60 Merge "Handle the camera open failure better." into gingerbread 2010-08-19 21:45:46 -07:00
Wu-cheng Li
e7044384b2 Handle the camera open failure better.
Check if camera hardware is NULL to avoid mediaserver crash.

Change-Id: Ibde0251f30bdb6b36a5d5380222d7be25ec9449c
2010-08-19 21:44:06 -07:00
James Dong
cbd038fe20 Merge "Make MediaWriter stop and pause return errors if necessary" into gingerbread 2010-08-19 13:59:32 -07:00
James Dong
d036662470 Make MediaWriter stop and pause return errors if necessary
o Make the API consistent with SF framework, which the MediaSource
  provides a return status for stop

o Also, helps to convey errors that occurred right when a
  premature stop() is called, leading to a potentially
  mal-formed output file.

Change-Id: I52a932345f38570fdf8ea04d67d73dd94ccd30ef
2010-08-19 13:33:13 -07:00
Wu-cheng Li
eba1274978 Merge "Adding getSupportedPreviewSizes to CameraParameters.DO NOT MERGE" into gingerbread 2010-08-19 11:08:39 -07:00
Wu-cheng Li
ccb915963e Merge "Adding getSupportedPictureSizes to CameraParameters.DO NOT MERGE" into gingerbread 2010-08-19 11:08:36 -07:00
Andreas Huber
eef3c33e56 In the absence of width/height information in the sdp, extract the dimensions from the avc codec specific data.
Change-Id: I98c4194593c7e6e24f6fc339c862245111800293
2010-08-19 10:39:47 -07:00
Nipun Kwatra
6c008b8640 Adding getSupportedPreviewSizes to CameraParameters.DO NOT MERGE
Moved functionality to parse string of sizes from getSupportedPictureSizes
to parseSizesList.
Added getSupportedPreviewSizes which returns a list of supported preview sizes.

Change-Id: I41d4f62f9f1641e9e9258aa2ebaeda13ba846c02
2010-08-19 09:59:18 -07:00
Nipun Kwatra
0de0c4960d Adding getSupportedPictureSizes to CameraParameters.DO NOT MERGE
Also added a struct 'Size' containing a width and a height field.
Modified parse_size to optionally set an end pointer pointing to the
character after the found size.

Change-Id: I0c95ebf1ad4684721b32165f363db7d4d15a1b19
2010-08-19 09:59:11 -07:00
Kenny Root
54d4137935 Merge "Add OBB flags to support overlays" into gingerbread 2010-08-19 09:09:32 -07:00
Chia-chi Yeh
58d3bd0810 Visualizer: replace the FFT implementation with a faster one.
This implementation uses fixed points instead of floating points. It
is slightly inaccurate compared to the old one but still perfect for
visualization purpose. It runs 40% faster on passion, 5 times faster
on sholes, and of course 14 times faster on sapphire.

Change-Id: I1e868417bcffda091becf106a7b941d02813faec
2010-08-19 16:05:32 +08:00
Jeff Brown
ae9fc03bdc Add support for throttling motion events.
Change-Id: I24b3a17753e91ecda60a60fe5cd2e6b3260e033d
2010-08-18 16:58:27 -07:00
Jeff Brown
72e0b2ab08 Merge "Fix some input device mapping bugs with certain drivers." into gingerbread 2010-08-18 13:38:32 -07:00
Jeff Brown
2dfd7a7cbf Fix some input device mapping bugs with certain drivers.
On single-touch devices, pointer up/down is signalled by a BTN_TOUCH
key event.  Previously we handled BTN_TOUCH immediately but some drivers
may produce the sequence BTN_TOUCH, ABS_X, ABS_Y, SYN_REPORT on pointer down
which caused us to emit a bad initial pointer down location.
Now we wait for SYN_REPORT before reporting the up or down.

On multi-touch devices, pointer up can be signalled by as little as
the sequence SYN_MT_REPORT, SYN_REPORT.  This change ensures that we
handle this case.

Added support for reading ABS_MT_PRESSURE when available.
Corrected mapping of touchMajor/touchMinor on single touch devices.
Minor code cleanup.

Change-Id: Ic7ec4811241ed85a06e59b8a839ca05180d491d4
2010-08-18 13:37:45 -07:00
Jens Gulin
c4554b9a08 Keep track of remaining fd when devices are removed
Sometimes the wrong fd was accessed when the device was addressed
by device id.

The earlier implementation assumed that two arrays were in sync
but one of them was compacted when devices were removed. Instead
of that dependency the device now keeps track of it's file descriptor.

Change-Id: Ib0f320603aafb07ded354bc3687de9759c9068f2
2010-08-18 10:54:03 -07:00
Wu-cheng Li
c86960236d Merge "Document that autoFocus must be called in auto and macro mode." into gingerbread 2010-08-18 10:19:45 -07:00
Kenny Root
02ca31fbae Add OBB flags to support overlays
* Add flags field in OBB footer to support overlays.

* Remove unused 'crypto' and 'filesystem' fields in obbtool (could
  later be supported in the "flags" field of the OBB footer).

* Add notes to document OBB classes before shipping.

Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
2010-08-18 09:34:58 -07:00
Jeff Brown
cc2e717f1d Optimize EventHub reads.
Change-Id: Id7d09c0a6e5c741c1e29becd2b6560772c5ff372
2010-08-17 19:40:26 -07:00
Jeff Brown
2cbecea4c9 Fix possible race conditions during channel unregistration.
Previously, the input dispatcher assumed that the input channel's
receive pipe file descriptor was a sufficiently unique identifier for
looking up input channels in its various tables.  However, it can happen
that an input channel is disposed and then a new input channel is
immediately created that reuses the same file descriptor.  Ordinarily
this is not a problem, however there is a small opportunity for a race
to arise in InputQueue.

When InputQueue receives an input event from the dispatcher, it
generates a finishedToken that encodes the channel's receive pipe fd,
and a sequence number.  The finishedToken is used by the ViewRoot
as a handle for the event so that it can tell the InputQueue when
the event has finished being processed.

Here is the race:

1. InputQueue receives an input event, assigns a new finishedToken.
2. ViewRoot begins processing the input event.
3. During processing, ViewRoot unregisters the InputChannel.
4. A new InputChannel is created and is registered with the Input Queue.
   This InputChannel happens to have the same receive pipe fd as
   the one previously registered.
5. ViewRoot tells the InputQueue that it has finished processing the
   input event, passing along the original finishedToken.
6. InputQueue throws an exception because the finishedToken's receive
   pipe fd is registered but the sequence number is incorrect so it
   assumes that the client has called finish spuriously.

The fix is to include a unique connection id within the finishedToken so
that the InputQueue can accurately confirm that the token belongs to
the currently registered InputChannel rather than to an old one that
happened to have the same receive pipe fd.  When it notices this, it
ignores the spurious finish.

I've also made a couple of other small changes to avoid similar races
elsewhere.

This patch set also includes a fix to synthesize a finished signal
when the input channel is unregistered on the client side to
help keep the server and client in sync.

Bug: 2834068
Change-Id: I1de34a36249ab74c359c2c67a57e333543400f7b
2010-08-17 17:03:42 -07:00
Wu-cheng Li
f008f3ea82 Document that autoFocus must be called in auto and macro mode.
Change-Id: Ia52f8bc8a75a7473edff50326a4a0467f4295e6a
2010-08-17 13:44:35 -07:00
James Dong
b72081966d Use audio clock as the reference media clock
o Only do this for realtime applications
o Adjust other track clock based on audio clock
o Assume other track uses wall clock as the media clock
o Use some heuristics to reduce the size of stts box by 2/3.

- also
o Remove one unused key from MetaData.h

Change-Id: Ib9432842627b61795b533508158c25258a527332
2010-08-13 18:12:48 -07:00