Because DRM Plugins will not be allowed to call the AMI API under
Treble, the mediadrmservice will need to marshal the metrics out of the
plugin in protobuf format and report them to the AMI API instead. This
patch implements the pulling and interpreting of metrics from DRM
Plugins.
Bug: 36497276
Test: Played Google Play Movies, verified that playback still worked and
Widevine metrics appeared in a dump of the system media metrics.
Change-Id: If07717c1b87022bc1fcdedfbc62b9193899742d5
MediaDrm relies on each plugin to close its open sessions
when the plugin is destroyed. This change ensures that all
sessions will be closed even if the plugin does not do it.
b/38323088
Change-Id: I8b6e36182f3b3bc765963819101868fc46001527
If binderDied is invoked after a plugin is destroyed
the pointer can already be null. Also reset the init check
state after the plugin is deleted to make sure the
checks in other methods remain valid.
bug:62667492
Test: Play Movies, ExoPlayer
Change-Id: Ie12191b744331a7a435b4c64bbd1c179918553ac
A plugin's listener reference was preventing the plugin
from being released in binderDied, which caused
drm sessions to be kept open if an app was abnormally
terminated. Setting the plugin's listener to NULL
in binderDied resolves the problem.
Test: repeat {launch netflix app, kill <app-pid>}
Prior to this change the netflix app would always fail to
run on the second iteration and the log showed
ERROR_TOO_MANY_SESSIONS. After this change, the netflix app
can be killed and restarted without failures.
Also verified with gts tests and play movies app.
bug:37720811
Change-Id: Iceb1c23e2a1d518da85641336f017bb8b2948863
Use defaultServiceManager() instead of IServiceManager::getService()
bug:62073349
test:
repeat {launch Play Movies, play a movie, exit} while monitoring
adb shell cat /sys/kernel/debug/binder/stats |
grep -A10 '^proc <mediadrmserver PID>'
--> Make sure number of nodes is stable
Change-Id: Ibea0437ed21a9d58f3eb7ffa9461fb71d9c2b4ab
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: Iecab9a10a6973d01c47bffd5589d71e35614f855
(cherry picked from commit cb421ce297)
See build/soong/README.md for more information.
Test: m -j checkbuild
Change-Id: Icfc13bb5f55fa156ef72d3cf3a327e38739d775b
Merged-In: Icfc13bb5f55fa156ef72d3cf3a327e38739d775b
(cherry picked from commit 53f2035f1d)
This flag is obsolete now that the conversion
to treble is complete.
Change-Id: I7073d337939da43bddf99644bfe52db9baa2f605
Merged-In: I7073d337939da43bddf99644bfe52db9baa2f605
related-to-bug: 32815560
(cherry picked from commit 99a5aba027)
Combine the two openSession methods into one that doesn't take any
arguments. This gives the client more flexibility on creating
sessions efficiently. They can better decide whether to share one
session for multiple streams, or create one session per stream.
bug: 22804304
Change-Id: I9634f4dd4fc437229068103b54555cc28a818937
- Set crypto mode to kMode_AES_CTR, since kMode_AES_CBC is not defined
on Java API, and is rejected when the sample is queued to MediaCodec.
- Wrap the plugin object in a RefBase, and hold a strong ref to it
when executing any API calls in CasImpl. This is needed because
CasImpl could be released by Java API, while MediaCodec native is
still trying to access it.
- Fix build warnings.
Tests: cts-tradefed run cts-dev --module CtsMediaTestCases --test android.media.cts.ClearKeySystemTest
It should not fail.
bug: 22804304
Change-Id: Id4ef037d57dd741d2bb22b1de3d04c8d078b69fb
[ Merged from master ag/2027840 ]
The SESSION_RECLAIMED event needed to be propagated to the jni native
interface.
Test: Verified by
com.google.android.media.gts.DrmSessionManagerTest#testReclaimSession
(GtsMediaTestCases) test
b/36589391
Change-Id: Ia3f17e20be19bc2e7bb88a2354d231917bfce1e8
We are ready for devices to begin migrating to a 64-bit Media DRM
Server. However, not all devices are ready to make this jump yet. A
device needs to have all of its DRM Plugins ready to run as 64-bit
before it can do this. This includes having 64-bit hardware
integrations.
So that devices can turn on 64-bit support as they get ready, I am
adding flags that can be set in a device's device.mk file. There are two
parts:
* ENABLE_MEDIADRM_64 enables building the mediadrmserver as 64-bit.
* Setting drm.64bit.enabled=true in PRODUCT_PROPERTY_OVERRIDES switches
mediadrmserver to searching for DRM Plugins in the 64-bit directory.
Test: Validated that turning on these flags enables a 64-bit
mediadrmserver that loads 64-bit DRM Plugins from the lib64
directory (after setting DISABLE_TREBLE_DRM to true to load this
code as opposed to the Legacy DRM Plugin HAL)
Bug: 36076017
Change-Id: I141cfd57ff75b40c8b0cb40a5bf1439a1ab5b766
Heap base for the same heap could be mapped to different values
after they go across binder to CryptoHal. So we can't use heapbase
to index the heaps.
Since each ACodec instance allocates all its shared memory buffers
from the same memory dealer, we let CryptoHal assign a sequence
number to the ACodec when it calls setHeap. In subsequent calls
to CryptoHal::decrypt, reference the heap by the seq num, and ignore
the heap base address.
Bug: 36479980
Bug: 36209723
Bug: 36660223
Test: the above bugs don't repro
Change-Id: I2f519a689a5891447385d1bf9d6e668bb3b4dbe2
(cherry-picked from bf628da1e2)
When a decoder is created while another decoder
is in use and the two decoders share a common
crypto instance, decryption results would become
indeterminate, which could cause the decoder to
hang. This change adds a notification to the
crypto instance so it can update state when its
ownership changes.
bug: 36209723
Test: playbacktests-debug-androidTest.apk as
described in the bug.
Change-Id: I453c260eace5543dd79a3569bf6a9592394c4113
MediaCodecTest.android.media.cts.MediaCodecTest.testCryptoError
was failing due to incorrect error code translation introduced
by the drm hidl hal.
bug: 35137940
Change-Id: Ia5e16809872c19335b4b9c1a8ddd1e625a4781b4
Check opaque size to be not greater than an abitrary 100K
and verify malloc succeeded.
Test: Play Movies & TV
Test: Netflix
Test: ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts
-m GtsMediaTestCases --test
com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P60
Test: Forcing opaque size to exceed limit and malloc to report failure;
both resulted in Netflix reporting an error and failing to play.
This is the expected result.
bug: 30202440
Change-Id: I9fdaf208471f2781ffbd656358b1bf1ef5b28ee8
Prior to this change, the default legacy hal
module was explicitly referenced. This change
uses the service manager to iterate through
any hal instances so vendor-provided hals
can be loaded.
bug:34507158
Change-Id: I23bc4fdb2dc7d5254833c9a977241f1fede726a9
The initial drm hidl hal implementation assumed one
codec per crypto instance, but in fact there can be
multiple codecs per crypto instance. This change
extends the drm hal to allow multiple memory heaps
per crypto plugin. It fixes the issue of mapping
memory frequently during playback.
bug:35275191
Test: manual verification with Play Movies on angler
in passthrough mode and on marlin in binderized mode.
Change-Id: Icada005f515483d7bc214b08caf6eea46ca354a7
If mimeType is not defined, isCryptoSchemeSupported will always
return false.
Test: Netflix on Fugu
Test:
ANDROID_BUILD_Troid-gts/tools/gts-tradefed run gts -m GtsMediaTestCases
--test com.google.android.media.gts.MediaDrmTest#testWidevineSanity
bug: 35363342
Change-Id: I579dd6d41d17c1520404a5b45baae3f730f8245a
Eliminate ENABLE_TREBLE since it is obsolete.
Switching back to legacy DRM is still possible
by building with DISABLE_TREBLE_DRM=true
Change-Id: I6b921050dff6162112c60df21549fc93bc46e379
Pass application package name to createPlugin and createDrmPlugin.
The application packagename will be used as part of a unique
identifier for drm plugin.
Test: Play Movies.
Test: ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m
GtsMediaTestCases --test
com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P60
Verify the application's packagename is reachable in the drm plugin's
debug log.
bug: 27101531
Change-Id: I84fb09b591a7af63f6e20004e910112a4ce6ebac
This change adds DrmHal & CryptoHal classes that connect to the Treble
HAL interfaces for drm. These classes mirror the existing Drm and
Crypto classes that connect to the DrmPlugin and CryptoPlugin
interfaces. Having both allows mediadrmserver to run in either mode
while the HAL is stabilized.
The shared memory interfaces between mediaserver's ACodecBufferChannel
and ICrypto had to be reworked to use the Treble HALs. Specifically,
the shared memory path for returning decrypted buffers in the
non-secure case had to become separate instead of piggy-backing on the
source shared memory buffer. A separate shared memory destination
buffer is now allocated on the buffer channel. An abstraction for a
decrypt destination buffer was also introduced to clarify ICrypto's
decrypt method.
Tests: Playback using Play Movies and ExoPlayer works on angler
with and without the treble hal enabled.
bug: 32815560
Change-Id: I5a3dc84f99902eb8cf8eabab9ad074d307744950
Move various things around so mediadrmserver doesn't need
libstagefright and libmedia
Test: build/boot
Change-Id: I48b713cd679b992cb6ad1262c20394a9892d7027
Various media components were linking against dynamic libraries that weren't needed.
Test: built and booted
Change-Id: I7379506fd06d4e28e0eff0001fd073a2d3860f8e
The listener member of a Drm object wasn't
being released, causing memory to be leaked
every time a MediaDrm instance was created.
bug:32277525
Change-Id: I5582056fff3d20a5fd2b178bf028008d7f9ad1b4