1142 Commits

Author SHA1 Message Date
Marco Nelissen
beea9f7636 Revert "Multiple worker threads for SoundPool"
This reverts commit 7201d9cb6a5d9bcd4f82dfde32e25a1ca8e825e2.

This reduces CPU usage during Camera startup.

Bug: 38031165
Bug: 62447848
Change-Id: I857aefec9dd7566bfdd3b84873eb5d495449815c
2017-06-21 19:30:17 +00:00
Eino-Ville Talvala
20e2394f75 Merge "ImageReader: Set BufferItem mGraphicBuffer to null when returning it" into oc-dev
am: 20c2116c1f

Change-Id: I8385f1e65de888d602e5775f6811ec7c908f9073
2017-06-15 21:12:29 +00:00
Eino-Ville Talvala
0af9435572 ImageReader: Set BufferItem mGraphicBuffer to null when returning it
The ImageReader JNI layer needs to maintain a list of BufferItems that
back the Java Image objects. At start, we allocate maxImages of these
in a list, and acquire and release them from this list as the
application acquires and releases Images.

However, on release, the contents of the BufferItem are not adjusted,
so it can retain a reference to a GraphicBuffer until the BufferItem
is reused.

Test: Camera CTS passes, memory usage drops after camera bursts
Bug: 62652080
Change-Id: I9aade5e32cbe0af0c15a3886e16ada1a70392b74
2017-06-15 06:34:31 -07:00
Marco Nelissen
7201d9cb6a Multiple worker threads for SoundPool
This makes SoundPool create multiple worker threads for loading sounds.
Threads are created on demand, and go away when no work is available.
Bug: 38031165
Test: manual

Change-Id: Ic73f2777215e4aa65aa1c41b283b7838cebd165d
2017-06-01 12:37:29 -07:00
Andy Hung
0dc609a113 Merge "VolumeShaper: Enable xOffset from Java" into oc-dev am: b33c0eb07a
am: 0cc01b5bc2

Change-Id: I9afcd844391b56991b5cc686808f89b4ec878a31
2017-05-18 16:34:39 +00:00
Andy Hung
0cc01b5bc2 Merge "VolumeShaper: Enable xOffset from Java" into oc-dev
am: b33c0eb07a

Change-Id: Icc37873492d612a66484d731168de5c5e27213c9
2017-05-18 16:26:41 +00:00
Andy Hung
3c0f5d296e VolumeShaper: Enable xOffset from Java
Previously only accessible from native.
Also improve documentation and comments.

Test: CTS VolumeShaperTest, Ducking
Bug: 38353147
Change-Id: I27bb34f0a5d28f80d138111bbeeb92653b5195c5
2017-05-17 18:31:38 -07:00
Colin Cross
0bd45d3f2c Merge "Convert libsoundpool to Android.bp" am: dde9ee9edd am: e9ffa404ae
am: 13ea256d71

Change-Id: I8af55458b0bba29701249f7a8165f30055262f46
2017-05-17 22:03:06 +00:00
Colin Cross
da8082bda2 Convert libsoundpool to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: If0b7cb1e2c86ff1be41c00d98fd9ddec31287a53
Merged-In: If0b7cb1e2c86ff1be41c00d98fd9ddec31287a53
(cherry picked from commit 98c127f8cc652d1179871ad47cac99d15ea1a5a0)
2017-05-17 13:22:34 -07:00
Colin Cross
b5af660ff6 Merge "Convert libsoundpool to Android.bp" 2017-05-17 20:15:20 +00:00
Colin Cross
58d87e8ab7 Convert libmedia_jni to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I1817c75ee45537ca0d5fc40a035f94a3dfeccc11
Merged-In: I1817c75ee45537ca0d5fc40a035f94a3dfeccc11
(cherry picked from commit 76de4f6b4d09423b3a5d3603527ce79acae4ed32)
2017-05-16 22:05:39 -07:00
Colin Cross
eb27d2798a Convert libmedia_jni to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I1817c75ee45537ca0d5fc40a035f94a3dfeccc11
Merged-In: I1817c75ee45537ca0d5fc40a035f94a3dfeccc11
(cherry picked from commit 76de4f6b4d09423b3a5d3603527ce79acae4ed32)
2017-05-17 03:02:21 +00:00
Colin Cross
14b2beb0ef Merge "Convert libmedia_jni to Android.bp" 2017-05-17 02:42:41 +00:00
Andy Hung
f7162a3a43 Merge "AudioEffect: return DEAD_OBJECT for FAILED_TRANSACTION" into oc-dev am: 52f57cb720
am: 24ac07e1e0

Change-Id: I0c662869ebda4d99a81a0c31407a47ea6699a907
2017-05-17 01:46:12 +00:00
Andy Hung
24ac07e1e0 Merge "AudioEffect: return DEAD_OBJECT for FAILED_TRANSACTION" into oc-dev
am: 52f57cb720

Change-Id: Idb0f8a1565c4eb36ad0031a86b244f698e9cefbd
2017-05-17 01:39:55 +00:00
Colin Cross
98c127f8cc Convert libsoundpool to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: If0b7cb1e2c86ff1be41c00d98fd9ddec31287a53
2017-05-16 13:08:19 -07:00
Colin Cross
76de4f6b4d Convert libmedia_jni to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I1817c75ee45537ca0d5fc40a035f94a3dfeccc11
2017-05-16 13:07:57 -07:00
Andy Hung
32d516381c AudioEffect: return DEAD_OBJECT for FAILED_TRANSACTION
Test: CTS AudioSecurityTest
Bug: 38346284
Change-Id: I96b4995c2d11b4a33c4b2fa6987922e26c91d336
2017-05-16 12:33:56 -07:00
Jeff Tinker
dffb216140 Merge "Fix drm hal resource leaks" into oc-dev am: 63398bbd71
am: 8b1e0e1254

Change-Id: I14d864345f84d801aef48b45af1c59a1e08f7087
2017-05-15 20:14:15 +00:00
Jeff Tinker
8b1e0e1254 Merge "Fix drm hal resource leaks" into oc-dev
am: 63398bbd71

Change-Id: Iae4c7f407e638dd2dba5acfc43a3ca894f665bd4
2017-05-15 20:03:16 +00:00
Jeff Tinker
94dd36cae9 Fix drm hal resource leaks
bug:36408047
test: manual testing to verify leaks are fixed
Change-Id: Ic6a29572874a9fe30f36e7fdabb68d2ddeffb278
2017-05-15 09:27:18 -07:00
Colin Cross
2a5d782689 Update path for libmediandk headers
Platform usages of libmediandk headers are now in media/.

Test: builds
Change-Id: I16385cab86ae9cac225304557df416bbb232ecf3
(cherry picked from commit c8ed45d38f3b42e06c9e0980e133a84181752b5e)
2017-05-05 13:05:55 -07:00
Colin Cross
0ece443558 Update path for libmediandk headers
Platform usages of libmediandk headers are now in media/.

Test: builds
Change-Id: I16385cab86ae9cac225304557df416bbb232ecf3
(cherry picked from commit c8ed45d38f3b42e06c9e0980e133a84181752b5e)
2017-05-05 20:03:42 +00:00
Colin Cross
28f320c5be Merge "Update path for libmediandk headers" 2017-05-05 20:02:14 +00:00
Eino-Ville Talvala
2e385f76f8 Merge "Merge "ImageWriter: Attach non-opaque Images as well." into oc-dev am: 97258cd731" into oc-dev-plus-aosp
am: 74d76f406b

Change-Id: I0ace22eb4cb7e4c90baf3ff066a400e609f5e620
2017-05-05 16:37:28 +00:00
Colin Cross
c8ed45d38f Update path for libmediandk headers
Platform usages of libmediandk headers are now in media/.

Test: builds
Change-Id: I16385cab86ae9cac225304557df416bbb232ecf3
2017-05-04 17:58:11 -07:00
Eino-Ville Talvala
07ad459c84 ImageWriter: Attach non-opaque Images as well.
With all the work under the hood of ImageReader/Writer in the last few
releases, this is much more straightforward to enable.

Only trick is to ensure that the Image detached from the ImageReader
correctly clears out its planes, if present.

Bug: 19962027
Test: Camera CTS still passes on angler, sailfish, ryu
Change-Id: Ic8a1f3e2f45cf15971d76e308a5af25eb2fd66f1
2017-05-04 11:04:56 -07:00
Wei Jia
f316c99123 Merge "MediaPlayer: fix new API seekTo to address API review." into oc-dev am: 62a3aa745a
am: f38aa207b2

Change-Id: Ib2c0db36dd3f9958f0ecb714a1b6e73d73e3455d
2017-04-21 21:25:04 +00:00
Wei Jia
bebeaf9ae3 MediaPlayer: fix new API seekTo to address API review.
Test: compiles
Bug: 36790516
Bug: 37514763
Change-Id: I91307d10e6c9bc65779651c056053b3a025b0d50
2017-04-21 11:05:13 -07:00
Mike Reed
7c0ae0f58b bitmaps and pixelrefs no longer need lock/unlock
Test: covered by CtsGraphicsTestCases and hwui_unit_tests

Change-Id: I42a25961a2eb3755d2fd22a617aa21a24ec0994f
2017-04-18 10:22:42 -04:00
Ray Essick
10353e3601 Rework getMetrics() api per API council
Reworking the media metrics getMetrics() calls (currently in MediaCodec,
MediaExtractor, MediaPlayer, and MediaRecorder) to fit new direction
from the API Council.

Drop the MediaMetricsSet that we had in the first round; go back
to a PersistableBundle as the return type. Moves the key definitions
from MediaMetricsSet.MediaCodec to MediaCodec.MetricsConstants

Bug: 37083862
Test: ran the corresponding CTS tests
Change-Id: I7905959ad2109887dd8fd16f0eb2831247abab2a
2017-04-14 17:24:42 -07:00
TreeHugger Robot
fd89a95f35 Merge changes from topic 'api-review' into oc-dev
* changes:
  MediaCas: combine openSession methods
  MediaCas: address comments for API reviews
2017-04-13 06:23:51 +00:00
Chong Zhang
addc39ec27 MediaCas: address comments for API reviews
- Wrap session id byte array in Session object

- Move session operations from MediaCas to Session

- Remove position prarameters on descramble() method

- Retrieve cas info for a track by getCasInfo() instead
  of getDrmInitData().

bug: 22804304
bug: 36791613
bug: 36783335

Change-Id: Ib3ad8d6a2f679c0e60d2bb025ac5999339722306
2017-04-11 13:13:22 -07:00
Zhijun He
916d8ac650 ImageReader/Writer: add usage flag support
Also add an ImageWriter ctor to take additional arugment (format)

Test: ImageReader and Writer CTS tests
Bug: 32766711
Change-Id: I99e3862dd5b9a85c9df7879c14c84b68a35718ec
2017-04-10 23:38:32 +00:00
Ray Essick
ed5b028693 Move MediaMetrics into its own library
Changes for the new HAL structure have brought about a build time
circular dependency between libmedia and libmediadrm. This set of
changes the media metrics code into its own library and arranges
for the relevant consumers of the media metrics code to link
to this new library (where they had previously picked it up by
including libmedia).

Bug: 36990807
Test: build, boot.
2017-04-05 14:01:00 -07:00
Mathias Agopian
845eef05ff Remove useless GraphicBuffer() constructor
Test: compiled & run
Bug: 36869708
Change-Id: Ie825979cd03874904b6f953ece4a05d4a0d52253
2017-04-03 17:51:15 -07:00
Chong Zhang
dadee0c33e MediaCas: rethrow MediaCas specific exception
Translate ServiceSpecificException from aidl to CAS-specific
exceptions. Also, throw CAS specific exception for descramble().

bug: 22804304

Change-Id: I6d68c335c87fbb95fd8cc227e432eed4e5951550
2017-03-24 14:28:43 -07:00
Jerry Zhang
e30d5723e4 Merge "Add support for MTP perceived device type property." am: b6ed343e85 am: 7644b885c7
am: 136f37b88f

Change-Id: I446cd52e5fd8cda48e9af46ee3faee5578cae286
2017-03-20 21:54:28 +00:00
Ray Essick
5204ad0a2a Merge "Integrate API Council feedback into Media Metrics APIs" 2017-03-16 01:02:25 +00:00
Ray Essick
f2d0e40bf0 Integrate API Council feedback into Media Metrics APIs
Integrates the API Council's feedback into the Media Metrics
related APIs.
-- return types for the getMetrics() calls
-- definition of keys in the set of data that comes back

Bug: 35811992
Test: booted, CTS subset, checked dumpsys media.metrics output
Change-Id: Ib750f9631bd3453be3132760273ccfff0a891f88
2017-03-15 11:43:08 -07:00
Paul Mclean
b8feaa5eaa Merge "Switching Native MIDI API to an "opaque pointers" model." 2017-03-11 17:49:22 +00:00
Paul McLean
71f672b98a Switching Native MIDI API to an "opaque pointers" model.
Test: manual

Change-Id: Ic181008427e6e81106d867cc3a70deef8c591841
2017-03-10 15:54:16 -07:00
Robert Shih
252f3b20bb JNI ImageReader: propagate exceptions when creating surface planes
Bug: 36082388
Test: Manual
Change-Id: I4a0ad08c9b3c53aa7ca702e1c6e2d486b788f3ff
2017-03-10 18:18:00 +00:00
Andy Hung
d4f1e86190 VolumeShaper: Update Builder methods and Object overrides
Builder methods now throw IllegalArgumentExceptions on invalid
conditions.

Object hashCode, toString, equals updated for element-wise structural
equivalence.

Test: CTS VolumeShaperTest
Bug: 31015569
Change-Id: I02860a51da58d8207145a9b8a5d2cb13806774b4
2017-03-08 10:52:26 -08:00
TreeHugger Robot
227bdecf02 Merge "fallout of cleaning-up libutils includes" 2017-03-04 00:52:50 +00:00
Mathias Agopian
df7707cb4f fallout of cleaning-up libutils includes
Test: run & compile
Bug: n/a
Change-Id: I0f6a0be03f4b120b1b5876aae0c0618c025d9f2b
2017-03-03 12:37:54 -08:00
Mikhail Naganov
c276c59eb5 nativemidi: Prototype demonstrating native access to IMidiDeviceServer
Framework changes and a demo app
Comment and finalized Native MIDI API
Replaced fixed PortRegistry tables with std::map.
more error handling.
Removed not-very-useful MidiDeviceManager class.
Made Java API functions @hide.

Bug: 30252756

Test: Manual
Change-Id: Iae98e589f38ef6d625ff0842401193fe98c5d881
2017-03-03 12:00:33 -07:00
Chong Zhang
d5927ae883 MediaCas: add framework APIs
Java API changes to support MediaCas framework.

Also add partial-frame related enums to MediaCodec,
MediaCodecInfo, and MediaExtractor as a way to indicate
a input frame contains partial data.

Test: basic test app and test plugin to execise the code path;
impelenting playback of CAS-secured MPEG2TS streams, including
a Widevine-based CAS plugin, locally modified ExoPlayer and
Android TV Tuner input.

bug: 22804304
Change-Id: Ia4ba1d4046f7588e42bfb21e726390457d2fc8e3
2017-02-22 17:27:01 -08:00
Ray Essick
8020105fb2 Merge "Metrics for android.media.MediaRecorder" 2017-02-17 22:39:40 +00:00
Hassan Shojania
06b25fb236 Modular DRM for MediaPlayer
Bug:  34559906
Test: Manual through the test app
Change-Id: I1b1ca61e74f250d63ff5ff462905facb81fe44e0
2017-02-15 18:44:54 -08:00