505 Commits

Author SHA1 Message Date
Andreas Gampe
307218c7f2 resolved conflicts for merge of 09910723 to lmp-mr1-dev-plus-aosp
Change-Id: I4b47723a9314bf9bef08e68ce269038d0d50c5d9
2014-11-21 09:57:52 -08:00
Andreas Gampe
a4a13480dd Frameworks/base: Wall Werror in media/tests
Turn on -Wall -Werror in media/tests. Fix warnings.

Change-Id: I7177e795d4896f62dfa0b0a5990386e564763384
2014-11-10 18:44:43 -08:00
Leon Scroggins III
b3d2a85b64 am 694fd58d: am fed9888e: Merge "Remove outdated tests for custom decoder." into lmp-mr1-dev
* commit '694fd58dd93b6360ec2204dab731d3c68847478b':
  Remove outdated tests for custom decoder.
2014-10-22 22:39:30 +00:00
Leon Scroggins III
8e8a0d6eaf Remove outdated tests for custom decoder.
These tests don't appear to be meaningful. We are comparing an
unused decoder against one that is used.

Keeping this test building (the primary changes to this directory
in a while) is not believed to be worth the effort.

BUG:17419670
Change-Id: Ia0862f2a1de1fb9d744382bb949f6c1638a1a12a
2014-10-22 18:17:14 +00:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
Neil Fuller
f7cf5d43aa resolved conflicts for merge of ee665151 to lmp-dev-plus-aosp
Change-Id: I97671e62de26919e391dbb2686511584c59ab990
2014-10-02 11:48:08 +01:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Shaohan Zou
d097e7ef74 Add Media Player Streaming Tests
Change-Id: I4bb78b0487d158f4ea57349b591f66eda6b325d2
2014-08-27 17:36:51 -07:00
Eino-Ville Talvala
acc0095bc8 Camera2: Correct error handling
- Report capture failures from service to application
- Only go to error state for device-level errors
- Adjust binder interface method names to match the service side names
- Reduce failed session creation logging
- Don't fire CaptureSession.onActive for CameraDevice.onBusy
- Check with session to determine capture failure reason

Bug: 17160301
Bug: 15524101
Bug: 14448494
Bug: 11272459

Change-Id: I9dd606004fd7845910dc865738fbe17f1640f07d
2014-08-27 11:08:18 -07:00
Yin-Chia Yeh
12da140082 Camera2: add highSpeedVideoConfig wrapper and APIs
- Add wrapper class for highSpeedVideoConfiguration.
- Add APIs to query high speed video recording configurations in
  StreamConfigurationMap
- Fix ColorSpaceTransform unit test in CameraMetadataTest
- Fix a bug in HashCodeHelper

Change-Id: I192e57f6ab5dfbba6d958571352f067a9eaec7b2
2014-07-18 16:00:53 -07:00
Naveen Kumar Ponnusamy
ee64575cf7 Added a test for HEVC playback memory usage
Bug: 14571712
Change-Id: If5c4053dea23142b73aed77498c93e149b7ef9b2
2014-07-12 22:13:32 +00:00
Lajos Molnar
b1a236b85f add utility methods to util.Range, Rational and Size
Bug: 12065651
Bug: 11990470
Change-Id: I0d0929ea0289ac5de5c17cca90f25abc4e9dfd7a
2014-07-12 14:12:27 -07:00
Mike Reed
42a1d08df7 SkBitmap::Config is deprecated, use SkColorType
Change-Id: Ida181d2aac760072cf2d01409edac37699dea216
2014-07-07 18:11:24 -04:00
Ying Wang
7c0e6219c3 Fix build.
Change-Id: I2b161a4020862d83347d5a8989467c612fff08db
2014-06-20 17:30:45 -07:00
Mike Reed
402c8f5a07 Merge "stop using (deprecated) SkBitmap::Config" 2014-06-20 00:30:35 +00:00
Mike Reed
b933055cf3 stop using (deprecated) SkBitmap::Config
Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
2014-06-20 10:28:37 -04:00
Eric Laurent
1cff3844da update SCO audio test app
Added test for startBluetoothScoVirtualCall()

Change-Id: I1b47b60a8c5fb0158d4e224252a9d511c612ca2f
2014-06-20 17:49:06 +00:00
Zhijun He
4c91380114 Camera: Implement HAL1 and higher HAL API coexistence
A higher hal version device like HAL3.2 can be opened as HAL1.0 device
if HAL supports it. This only applies to camera API1.

Change-Id: I4ae9f59f4317158cc1bd7ed7726e4032cdd1fa07
2014-06-19 15:46:02 -07:00
Igor Murashkin
4961bc88d7 camera2: Map camera characteristics in the managed layer
Change-Id: Ic86c8df3d703e7cf89caa856387e2c0a1b977401
2014-06-17 22:55:16 +00:00
Ji-Hwan Lee
162d6999e3 jpeg_bench: Fix checkbuild
Change-Id: I73d82ffc022be4fc78ff0d8b62ab541dd896df24
2014-06-13 20:16:15 +09:00
Igor Murashkin
007bfb14d2 util: Make Rational a Number/Comparable; add Range#inRange
* Also changes Rational to reduce the numerator/denominator by
its greatest common divisor at construction time (e.g. (2/4 -> 1/2)).

Bug: 15432042
Change-Id: Ib827abccf44a040667e5931cf9442afc86b57e2d
2014-06-06 16:38:09 -07:00
Igor Murashkin
5743868e15 camera2: Change android.lens.focusRange to Pair<Float,Float>
Since the focus range is defined in diopters (1/distance), it just so
happens that in a range [near, far] near >= far which is against the
android.util.Range contract.

Change it to pair instead.

Also adds a marshaler for Pairs since they didn't have one before
(and aren't parcelable).

Bug: 15335269
Change-Id: If2f3259aeec072438a1c18c1b9728a4c81e92a40
2014-05-30 11:28:49 -07:00
Yin-Chia Yeh
8298472764 Camera2: Test null TonemapCurve behavior
Add a test to verify we return null TonemapCurve when at least one
channel of tonemap curve is absent.

Bug: 14628001
Change-Id: I3e89dbcf00e5f21b01fc78fe43fe5c4200690357
2014-05-28 15:39:50 -07:00
Yin-Chia Yeh
8490ace76f Camera2: switch API interface to java classses
android.sensor.info.physicalSize: float[] -> SizeF
android.statistics.hotPixelMap: int[] -> Point[]
android.tonemap.curve[Red|Green|Blue]: float[] -> TonemapCurve

Bug: 14628001
Change-Id: I1e085f5e640a059852fcb504b6dd5f884039e653
2014-05-28 01:36:54 -07:00
Igor Murashkin
78712a8bd7 camera2: Add new metadata keys, change types for existing range keys
Also adds the following keys:
* android.control.maxRegionsAe
* android.control.maxRegionsAwb
* android.control.maxRegionsAf
* android.request.maxNumOutputRaw
* android.request.maxNumOutputProc
* android.request.maxNumOutputProcStalling

Changes the following keys' type
generations:
* android.control.aeTargetFpsRange
* (Range<Integer>)
* android.control.aeAvailableTargetFpsRanges
* (Range<Integer>[])
* android.control.aeCompensationRange
* (Range<Integer>)
* android.lens.focusRange
* (Range<Float>)

Bug: 14628001
Change-Id: I141847dffc4b0d89cea37c19a54d6d5faf24a9bb
2014-05-28 01:36:53 -07:00
Igor Murashkin
d6d65154e5 camera2: Refactor CameraMetadata.Key out into 3 key classes
Before:
* CameraMetadata.Key<T>

After:
* CameraCharacteristics.Key<T>
* CaptureResult.Key<T>
* CaptureRequest.Key<T>

CameraMetadata#get has been removed (each metadata subclass has
its own #get now) due to java generic limitations (in particular
a type bound <T1<T2> extends Key<T2>> is an illegal bound).

CameraMetadataNative gets a new #dumpToLog function to dump the native
metadata to logcat.

Bug: 15091017
Change-Id: Ic56c54c0d184e209e20de374dc8a6d79527c209f
2014-05-23 11:55:29 -07:00
Igor Murashkin
72f9f0a96e camera2: Move parameters around to different packages
* Camera-specific params to android.hardware.camera2.params
* Remove android.hardware.camera2.Size
* Move Rational to android.util

Bug: 14628001
Change-Id: Ie7a82bf9f4a0d8c18e0dc3a1581123c0d95da3f0
2014-05-14 18:24:58 -07:00
Igor Murashkin
9c595174cc camera2: Use StreamConfigurationMap for format/size/duration lookup
* Also @hide/@deprecate a bunch of other keys
* Move some classes into android.hardware.camera2.params

Bug: 14628001
Change-Id: I2db490a0849680a133a901403477a147b004fb28
2014-05-14 10:40:53 -07:00
Igor Murashkin
3c40a046cf camera2: Update native<->managed camera metadata marshalers
* Improve existing marshalers:
 - each managed/native type combination can be queried marshal support
 - marshalers can recursively call other marshalers for nested types
 - support marshaling/unmarshaling generic classes by using super type tokens

* Add new marshalers for:
 - ColorSpaceTransform
 - MeteringRectangle
 - Parcelable
 - Range<T>
 - ReprocessFormatsMap
 - RggbChannelVector
 - SizeF
 - StreamConfiguration
 - StreamConfigurationDuration

Batteries included; so are unit tests.

Bug: 14628001
Change-Id: I38d3e646ccfb3953898cd6f750c33e4097328482
2014-05-13 15:28:24 -07:00
Igor Murashkin
53a1d323df camera2: Fix broken camera metadata test due to key rename
Change-Id: I0367550b5bb9f80c8df272804eab7052c122104d
2014-04-22 16:29:45 -07:00
Lajos Molnar
e0e77cb5bb Remove VideoEditor
remove android.media.videoeditor.*

No longer supported and should not be used.

Bug: 13542518
Change-Id: I12de122443f0289ab1dfdd8b553e572a830cf412
2014-04-21 16:11:51 -07:00
Zhijun He
438d77e042 MediaFrameworkTest: Fix Camera2 API unit test build breakage
Change-Id: I49329e2c3bbf1290f1f6e7c64dbb56eb831e5a96
2014-04-10 17:09:22 -07:00
Zhijun He
8d637b819b Camera2: Fix the JPEG format issues
Also add unit test.

Bug: 13836016

Change-Id: I0af4bfe299f99c99e70faf5d3159eb0cbcc147eb
2014-04-09 18:51:38 +00:00
Igor Murashkin
5c207ec9a0 camera2: Fix out-of-date metadata test
* The tag android.sensor.calibrationTransform1 was renamed
  to android.sensor.calibrationTransform (1 removed)

Bug: 12002757
Change-Id: Ida0e37a30222f08d0d9bb3871717c74c21e428ac
2014-04-01 15:50:48 -07:00
Leon Scroggins
7a3878cd8f Remove SkOmxPixelRef to fix build.
Recent changes to SkPixelRef (from which SkOmxPixelRef inherited)
added abstract functions which SkOmxPixelRef does not implement.

Solution: remove SkOmxPixelRef, which is completely unused. The only
code that created one was commented out at the same time as it was
added in 2009, so there's likely no benefit to reviving it.

Change-Id: Icbf2537fcc03fd464fd791ff91659a1812019623
2014-03-27 17:36:18 -04:00
Leon Scroggins III
5e49b497ae Update framework to use M33 Skia. DO NOT MERGE
(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
  the length (read(NULL, 0)) is no longer implemented, since it is
  no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
  so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
 const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
 const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
 const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
2014-03-06 12:14:47 -05:00
Derek Sollenberger
fc92763408 Merge "Fix includes so that they no longer rely on the global Skia includes directories." 2014-02-28 13:23:15 +00:00
Derek Sollenberger
eece0dda56 Fix includes so that they no longer rely on the global Skia includes directories.
bug:13225538
Change-Id: Ia5d816dc665f81c7985f21036af4fd0a63c560cf
2014-02-27 14:31:29 -05:00
Derek Sollenberger
950fe8f8d4 Cleanup unnecessary includes for libskia.
The libskia target exports all of its public includes directories so
redefining them here is redundant. Also this cleans up and makes it
obvious where the framework is making using of private Skia headers.

Change-Id: Ie7ecc9ddd3df780bed6b9af54ba58ca58274e043
2014-02-27 16:21:24 +00:00
John Spurlock
a77cf87354 Merge "Tabs -> spaces in frameworks/base." 2014-02-25 19:57:33 +00:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Chong Zhang
daa98ca8d7 support time lapse/slow motion on SURFACE source
- pass time between capture as us, in high fps case ms could
  be inaccurate

- add test cases in MediaRecorderTest for time lapse/slow motion

Bug: 13032650

Change-Id: I34ecc3b39e0519753f74ae42afcaeeddfff1666a
2014-02-14 15:53:25 -08:00
Chong Zhang
d7eab895b7 Merge "MediaRecorderTest: add tests for getSurface() and SURFACE source" 2014-02-06 00:20:03 +00:00
Andreas Huber
d2506a5063 FINAL ATTEMPT: HTTP services are now provided from JAVA and made available to media code
Change-Id: I7f6cdcfd2a28846d36d89dd5180ef20a22b03af8
2014-02-04 14:45:28 -08:00
Chong Zhang
e996c419e6 MediaRecorderTest: add tests for getSurface() and SURFACE source
Bug: 12305192
Change-Id: I2f63799219273dc84732ba3b7a9dceb84a1f27a7
2014-01-16 10:38:35 -08:00
Leon Scroggins III
8790be6de3 Remove calls to deprecated SkBitmap::setIsOpaque()
setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

Change-Id: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
2014-01-15 11:37:04 -05:00
Zhijun He
b7bfdc7cf7 Camera2: add metadata override
There are interface difference between managed and native side for some
metadata, like Face and JPEG format. we need override them when they are set/get
between native and managed sides.

Also fix some issues in the CameraMetadataTest.

Bug: 10406212

Change-Id: Ibd8be0415968445e711b3ea89f45e1edfa193ee2
2013-10-07 08:02:25 -07:00
Eino-Ville Talvala
e841d4e165 Camera2: Implement idle callbacks
- Rework camera callback binder interface
- Connect up idle, disconnect callbacks
- A few unit tests for shutter firing and idle use

Bug: 10549462
Change-Id: I8455a8a0561e366b7edeef6b101682be2ec44d79
2013-10-03 15:44:32 +00:00
Zhijun He
7b7a154026 Camera2: Fix Camera integration test deadlock
The problem was: when SurfaceTexture is used, test didn't acquire/release
images when they are produced, then it starves the producer and
cause deadlock. This change replaces SurfaceTexture with ImageReader, release
every image produced immediately.

Bug: 10360518
Change-Id: I9aabaee23013277c2da6f5825ac931bc10511fbc
2013-09-25 19:33:31 -07:00
Zhijun He
2001188be3 Camera2: Implement CameraManager#getCameraCharacteristics
Bug: 10904541
Bug: 10360518
Change-Id: I1da0b0319703fda46789f15a232e56ed1d928bc3
2013-09-25 13:54:25 -07:00