Some drm HAL methods were not properly checking
their hidl Return<Status> values which would cause
aborts in some cases. This CL adds checks as needed
Test: GTS media tests
bug:73500808
Change-Id: I47ae0f82d4e614b1e78923ed48fbe4c024df5d71
Adds support to fetch metrics from vendor and convert them to a proto
bundle returned from a call to getMetrics.
Bug: 64001676
Test: CTS test for metrics and GPlay test
Change-Id: I05634dd1bf092e64e2d0e77c4c0e243340af48e3
Relocate drm and crypto headers from media
to mediadrm to have finer grained ownership
bug:73556221
Change-Id: I7d1b5944f261f9b1fdeed7605e4c0b4b4ca43e1a
closeAllSessions() was calling into the hidl interface closeSession
directly, and neglected to check the return status which resulted in
an abort. Instead, call the DrmHal::closeSession() method which handles
the hidl return status correctly.
Test: gts media tests
bug:72400509
Change-Id: I697997eb73ef6d8746fe695509671c4695124cee
Adds proto serialization and logging support for media drm framework metrics.
Bug: 64001676
Test: Ran CTS tests, unit tests and Google Play.
Change-Id: Ie350ac93caa6b35610eb63e4acc860c8e8a5cf5b
getKeyRequest_1_1 was using 1.0 callback.
This fix creates a common function for both 1.0 and 1.1
getKeyRequest to call. The function now calls the version
appropriate callback to return key request data, key type
and default url.
Test: CTS ClearKeySystemTest#testClearKeyPlaybackCenc
Test: CTS ClearKeySystemTest#testGetProperties
Test: CTS ClearKeySystemTest#testSetProperties
Test: Verify getKeyRequest_1_1 is called
bug: 73085826
Change-Id: Id70a92862473540f5a4eb815892a69dfe1601b92
Some metrics required a conversion to using PersistableBundle to support
slightly richer structure (lists, and nested PBs).
BUG: 64001676
Test: Ran updated CTS test and verified Google Play works.
Change-Id: I8f8d67ba04b234f2ac5ac348a8945e20837f98d6
This reverts commit a3c77911df.
Reason for revert: build cop here. The original CL broke build git_master / walleye_asan, hence I'm reverting.
https://android-build.googleplex.com/builds/submitted/4597721/walleye_asan-userdebug/latest/view/logs/build_error.log
In file included from vendor/google/tools/security/fuzzers/libFuzzer/ICrypto_fuzzer/ICrypto_fuzzer.cpp:24:
frameworks/av/include/media/CryptoHal.h:23:10: fatal error: 'android/hardware/drm/1.1/ICryptoFactory.h' file not found
Change-Id: I185d5310cadb9990b864d71e42bba94f4740160c
This change in DrmHal allows us to transfer a PersistableBundle containing
previously unavailable metrics.
Bug: 64001676
Test: CTS test for metrics and GPlay test
Change-Id: I1fa87c76dd980a3f91b4e2d02b37329f6c0a88ec
kVersionValue should return 1.1. Also change getPropertyString
to get value from mStringProperties[] instead of using hard coded
values.
Test: CTS ClearKeySystemTest#testGetProperties
bug: 73031837
Change-Id: I9d108a42a75ac3685d2c6ef58697efffe6152284
Vendors implementing the newly added MediaDrm.setSecurityLevel
HAL found that it was difficult to implement properly. Also the
semantics are somewhat ambiguous from the Java platform API
level. This CL binds the security level assignment to openSession
which clarifies the API for apps as well as making it more
natural to implement in HAL modules.
bug:72831697
bug:64001680
test: VtsHalDrmV1_1TargetTest, GTS media tests
Change-Id: Iaa07727be86ec2bc92be907d5a48c92136dc2014
Adds an implementation of getMetrics to the ClearKey implementation.
BUG: 69635855
Test: VtsHalDrmV1_1TargetTest
Change-Id: I3e01037081e8855e1dc9ff332c27edb8c79040df
Create clearkey HIDL service to support new APIs for drm 1.1 HAL.
The directories are organized into common, default and hidl.
The old shared library source is in common and default.
The new clearkey service source is in common and hidl.
Test: VtsHalDrmV1_1TargetTest
bug: 69635855
Change-Id: I2e8e0e1a39b622aa274ecd32c873d81b95bdc4f8
Also check for NULL mDrmPlugin before casting to V1_1.
Test: Play Movies and NetFlix
bug: 72687425
Change-Id: I47aa18730332a17860b7e27440d417ffd612810f
This reverts commit 09a90ab544.
Fix for regressed b/72666743
Test: manual test to confirm problem is fixed.
See bug for repro steps.
Change-Id: Ifac9a2c3a3a92063d544e39ace48ab14c90b8050
the 'finalized' concept didn't pan out -- remove references to it.
Simplifies the code flow.
Also purged some uses of generateSessionID().
Bug: 71874686
Test: logcat/dumpsys
Change-Id: I39e48526a5696158d8195f47154881ca6ecda266
Methods are needed to release a secure stop by ID and
return a list of secure stops.
Tests: gts media tests
bug:67361434
bug:64001680
Change-Id: If6cb180cb4d2e3b655028955d105aee0cb8d70b6
The metric names need to be consistent with related APIs (e.g.
MediaCodec#getMetrics). Those APIs use dot separators rather than
slashes.
Bug 64001676
Test: Re-ran CTS, unit tests. Smoke with GPlay Movies.
Change-Id: I606e4c4bcbf630d584b9dea80471ad256764a42b
Adds nearly all of the remaining specified framework level metrics.
Also adds a basic unit test to verify that metrics are exported
correctly. A follow-up CL will update the CTS test to touch all metric
values in DrmHal.
BUG: 64001676
Test: New unit test. Smoke tested with GPlay/Walleye.
Change-Id: I4df90675ae304d3c62b7886537328b3d848fd77c
Adds an EventMetric class, associated unit tests, and an instance of the
EventMetric to DrmHal. Also added a unit test for CounterMetric and
created a class to hold all of the future metric instances.
BUG: 64001676
Test: Added and ran unit tests. Also added a CTS test case.
Change-Id: Ic94bedd5f8293a58a939613a4ae69ce656a772be
closeAllSessions() was calling into the hidl interface closeSession
directly, and neglected to check the return status which resulted in
an abort. Instead, call the DrmHal::closeSession() method which handles
the hidl return status correctly.
Test: gts media tests
bug:72400509
Change-Id: I444be998702aeaca2905ddf560a5138d5775a316
This adds a new class CounterMetric which is used to hold metric
information. It also adds a single use case for recording and
reporting a counter metric.
BUG: 64001676
Test: Added and ran a new test for the specific CounterMetric use case.
Change-Id: I39cab8328f135e579f80b6c2fab721da5f569795
Two additional KeyRequestTypes have been added, None and Update. None
indicates that no key request is needed as keys have already been
loaded. Update indicates that while keys have previously been loaded,
an additional (non-renewal) license request is needed.
Bug: 70335058
Test: GtsMediaTestCases
Change-Id: I36a8b334c70140098a01e4a3bea3159fc0a4584f
Methods for querying HDCP, security levels and
number of sessions
bug:64001680
bug:33657579
Test: cts: MediaDrmMockTest, ClearKeySystemTest
gts: GtsMediaTestCases
Change-Id: I7c84df02ec33d305b6bd5ac7479922f87aa64863
Adds support for the new getMetrics call to the IDrm interface and the
DrmHal implementation. The implementation currently returns a dummy
metric collection. Follow-up CLs will flesh out the implementation.
Bug: 64001676
Test: Ran the new unit test created in a related CL; ran Google Play.
Change-Id: Ia6a3af5b59a30ca55267f7e3ba278a510fc8c81e
change from AString to std::string for how media.metrics handles
strings. This severs the dependency on libstagefright_foundation,
where AString is implemented, so we can integrate into places
which do not want to introduce a dependency on libstagefright_foundation.
Bug: 70805723
Test: compilation/linking, CTS subset
Change-Id: I66de971b6ec354444e06112607a2d7614084cef8
Changes to the clearkey plugin broke existing vts
tests, and those tests can't be changed due to
backward compatibility requirements. This CL
reverts the parts of ag/3125606 that caused the
test failures, while retaining most of those
changes.
bug:70660219
Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
Change-Id: Iab54b0917cc2e1edafc98bd97390bf9937b3d2ca
Calculating index sometimes causes an unsigned integer overflow. This
throws a runtime error on integer sanitized builds.
runtime error: unsigned integer overflow: 0 - 1 cannot be represented
in type 'unsigned int'
Since this gets implicitly converted to ssize_t anyhow, make the
conversion explicit before decrementing to avoid the overflow.
Bug: 30969751
Test: Compiles.
Change-Id: Ibd39c1ba0dc64673743672ffc70c22c09f8e828a
Merged-In: Ibd39c1ba0dc64673743672ffc70c22c09f8e828a
* Comment out unused parameters.
* Remove unused local constants.
* Use both unsigned/signed values for EXPECT_EQ.
Bug: 66996870
Test: normal build.
Change-Id: Ia396e5ba1f57e547ac731bd7cdb3e6ff4290b52a
MockCasPlugin.cpp: These are printing out `size_t`s, so we should be
using %zu.
ClearKeyFetcher.cpp: asset_.id() is an `unsigned long long`, so we
can't use PRIu64 for it.
Bug: None
Test: mma. Warnings are gone.
Merged-In: Ie34acb274696dea999f6309fb914b39ef00f4d77
(cherry picked from commit 843328ff13)
Change-Id: I7be4fff7d3fd603b7ab64397a6a05c28f7a34ace
Calculating index sometimes causes an unsigned integer overflow. This
throws a runtime error on integer sanitized builds.
runtime error: unsigned integer overflow: 0 - 1 cannot be represented
in type 'unsigned int'
Since this gets implicitly converted to ssize_t anyhow, make the
conversion explicit before decrementing to avoid the overflow.
Bug: 30969751
Test: Compiles.
Change-Id: Ibd39c1ba0dc64673743672ffc70c22c09f8e828a
Cherry picked from http://go/ag/3038278.
AesCtrDecryptor::decrypt() doesn't check whether the size of "key"
is equal to 16 bytes, which may lead to an OOB read problem in the
context of mediadrmserver.
Add DecryptsWithEmptyKey and DecryptsWithKeyTooLong unit tests.
Test: ClearKeyDrmUnitTest
adb shell LD_LIBRARY_PATH="/vendor/lib/mediadrm"
/data/nativetest/ClearKeyDrmUnitTest/ClearKeyDrmUnitTest
bug: 63982768
Change-Id: I1f22c9df2b051972b2c532608b7f203e3ce77926
This turns on signed and unsigned integer overflow sanitization in the
libdrmclearkey library.
Bug: 67706062
Bug: 62343822
Test: Ran CtsMediaTestCases and CtsDrmMediaCases
Change-Id: If74850fe73f2cca13ad27d58458d559dd26953ee
Now that this API is available.
This keeps the implementation details of hidl's
ashmem allocator in libhidl itself (it should be
opaque).
Test: try and succeed watching (part of a) DRM protected movie
Bug: 34234561
Change-Id: Ied9beddace2ccfc859833ac55f4e3837db5f495e
The app package name was not previously reported in drm metrics. This
change reports the app package name as returned from the vendor metrics.
This is part of the fix. The other change will go into another project.
Bug: 64584568
Test: Unit tests, GTS tests, and Google Play.
Change-Id: Iee36d5203364c5f80a8b0fe9d9bbf5c167abefd1
Implement queryKeyStatus in Clearkey plugin for testing.
Add CTS testQueryKeyStatus in ClearKeySystemTest and
NativeClearKeySystemTest in a separate CL.
Test: CTS - ClearSystemTests
ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
CtsMediaTestCases --test android.media.cts.ClearKeySystemTest
Test: CTS - NativeClearSystemTests
ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
CtsMediaTestCases --test android.media.cts.NativeClearKeySystemTest
bug: 64938501
Change-Id: I8371a3b871e90762f1e7c8453dd6002c31f7eb13
Rather than having a lib called libstagefright_foundation and one
called libstagefright_foundation_vendor, we now just have one library
and the build system keeps track of the vendor APIs that are exposed.
Test: (sanity) boot device, watch (part of) DRM protected movie.
Change-Id: I49f1c557ae8f93092bad5314e0630583cc7dc710
Merged-In: I49f1c557ae8f93092bad5314e0630583cc7dc710
MockCasPlugin.cpp: These are printing out `size_t`s, so we should be
using %zu.
ClearKeyFetcher.cpp: asset_.id() is an `unsigned long long`, so we
can't use PRIu64 for it.
Bug: None
Test: mma. Warnings are gone.
Change-Id: Ie34acb274696dea999f6309fb914b39ef00f4d77
If addValue does not succeed, there will be memory leak on
decodeSession. Fixed it by checking if addValue returns true first.
Plus fixed a small indentation error.
Test: mmm with static analyzer and warning disappears.
Change-Id: Ibf9b85e4c416e8fea8b80a3ba47f87f88573c54c
HIDL transaction status wasn't being checked
resulting in a SIGABRT from createPlugin when the
remote process dies.
bug: 64441780
test: run Play Movies and repeat killing
android.hardware.drm@1.0-service.widevine, check
log for transaction failed messages.
Change-Id: I0ea70578d60bb84cf693f158963181781d7e35c3
Test: run Play Movies and repeat killing
android.hardware.drm@1.0-service.widevine, check
log for transaction failed messages. This uncovered
a related problem in closeSession which is also fixed
in this CL.
bug: 64022042
Change-Id: I4e86414aa1625c35689339389391e9fa6d377b1c
Merged-In: I4e86414aa1625c35689339389391e9fa6d377b1c
Test: run Play Movies and repeat killing
android.hardware.drm@1.0-service.widevine, check
log for transaction failed messages. This uncovered
a related problem in closeSession which is also fixed
in this CL.
bug: 64022042
Change-Id: I4e86414aa1625c35689339389391e9fa6d377b1c
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
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive
restricted sets of headers and that automatic global
headers are restricted.
Test: build ClearKeyDrmUnitTest with BOARD_VNDK_VERSION=current
Bug: 37342627
Change-Id: I5e95a19700522d3ec03e457d6779a34e9be99139
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive
restricted sets of headers and that automatic global
headers are restricted.
Test: build ClearKeyFetcherTest with BOARD_VNDK_VERSION=current
Bug: 37342627
Change-Id: If4a6b78f515a29c0af13ca1db8c75a06d10369eb
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive
restricted sets of headers and that automatic global
headers are restricted.
Test: BOARD_VNDK_VERSION=current m -j k libmockcasplugin
Bug: 37342627
Change-Id: I6129ae91458216f537f6fb4065ecd9f26739851c
Instead of relying on the global include paths, use the new headers lib
'media_plugin_headers'.
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j libclearkeycasplugin
Change-Id: Ic6b5230bc9b674e21ccd36ce6ad117c687200599
Rather than having a lib called libstagefright_foundation and one
called libstagefright_foundation_vendor, we now just have one library
and the build system keeps track of the vendor APIs that are exposed.
Test: (sanity) boot device, watch (part of) DRM protected movie.
Change-Id: I49f1c557ae8f93092bad5314e0630583cc7dc710
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
Since libdrmclearkeyplugin is in vendor partition, it is linked against
the vendor-variant of the libstagefright_foundation.
Bug: 37343126
Test: sailfish builds and boots
Test: BOARD_VNDK_CURRENT=current m libdrmclearkeyplugin is successful
Merged-Id: Id8302f88978fc91282c54e0a679bcd8978898f8d
Change-Id: Id8302f88978fc91282c54e0a679bcd8978898f8d
(cherry picked from commit 24aa2adf67)
Since libdrmclearkeyplugin is in vendor partition, it is linked against
the vendor-variant of the libstagefright_foundation.
Bug: 37343126
Test: sailfish builds and boots
Test: BOARD_VNDK_CURRENT=current m libdrmclearkeyplugin is successful
Merged-In: Id8302f88978fc91282c54e0a679bcd8978898f8d
Change-Id: Id8302f88978fc91282c54e0a679bcd8978898f8d
(cherry picked from commit 24aa2adf67)
* Owners are selected from top CL approvals or owners.
They will be suggested to review/approve future CLs.
* OWNERS files are recognized by the new find-owners plugin, see .md files in
https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I7c848855a2d7a0d7f33123ea4ef5c2d03977b495
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
See build/soong/README.md for more information.
Also moves a few headers into the same library as their
implementation, and fixes a few includes to go through the
global frameworks/av/include path instead of manually adding
frameworks/av/include/drm.
Test: m -j checkbuild
Change-Id: I0c2d2f2262e7ed78d80a0d44795705c64b797ff0
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)
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)
* changes:
LOCAL_CLANG := true is now the default
stagefright: move several static methods out of ACodec
stagefright: move MediaDefs from libstagefright to libmedia
Test: verify that build has no failures
Change-Id: Ib249b276c6295e55eb54fa37b6d15486415dfbed
Merged-In: Ib249b276c6295e55eb54fa37b6d15486415dfbed
(cherry picked from commit 5f5ee1110d)
A function argument which is an array with a fixed size is not
actually a fixed size array, but rather just a pointer. Thus,
when we were using sizeof() for 'key' and 'iv', we were mostly
likely only logging the first 4 or 8 bytes of the array, and
not all 16.
We change this code so we're at least passing the correct size
to the arrayToString method, and thus logging all the bytes.
This API is still fragile, as there is nothing which assures
callers to decrypt are passing in arrays which are exactly 16
bytes. However, this API is equivalent to before, so we aren't
introducing any compatibility issues.
The compiler gave a warning about this.
Test: Compiled and confirmed there's no longer this compiler warning.
Change-Id: Ie3a32eef0882ea95bccc3e22ffcab7336779bd4c
Move various things around so mediadrmserver doesn't need
libstagefright and libmedia
Test: build/boot
Change-Id: I48b713cd679b992cb6ad1262c20394a9892d7027
Merged-In: I48b713cd679b992cb6ad1262c20394a9892d7027
(cherry picked from commit 75571e4bc7)
Non-treble process can no longer load .so from /vendor/lib.
Move the clear key plugin to /system/lib until MediaCas is converted
to treble.
bug: 37476803
Change-Id: I563b4576aeada5470355e7e168fa2c73997004d7
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
The clearkey plugin didn't handle some cases of
invalid parameters, which was found the drm VTS test.
Test: drm vts test passes
bug:34178477
Change-Id: I4643e099f052169d6950db8002b13711b56f30f5
[ 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
- MockCasPlugin: does nothing other than API logging
- ClearKeyCasPlugin: implement a clear key CAS that carries content
keys in the clear in ECMs. It initializes from a test asset string
with a valid id. It outputs to clear buffers.
bug: 22804304
Change-Id: Ifc70b86c1ec80a45b75c7bdd1e558a59018ace5a
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
findSession in the SessionLibrary wasn't detecting
the case of a sessionId not found. Since
DefaultKeyedVector was used, a new session id would
get created instead of returning a null sp.
Test: drm hidl hal vts test
bug:36006836
Change-Id: Iff00d8b84188d2bf9f26bceccf645bb730076378
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
The drm plugin provides a listener, we send a kDrmPluginEventVendorDefined
if provideKeyResponse succeeds.
The reason for sending kDrmPluginEventVendorDefined is because
kDrmPluginEventKeysChange currently does not have ndk api support.
This addition is intended for testing AMediaDrm_setOnEventListener only.
Test: cherrypick go/ag/1598039 and go/ag/1630324
ANDROID_BUILD_TOP= ./android-cts/tools/cts-tradefed run cts -m CtsMediaTestCases --test android.media.cts.NativeClearKeySystemTest#testClearKeyPlaybackCenc
Test passes and look for "EVENT_VENDOR_DEFINED received" in the debug log.
bug: 32648208
Change-Id: Iec98b856e8d4ce888f8a1cd2568a3dee871effc5
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
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
AMediaDrm_getKeyRequest() passes mimeType to drm plugin's getKeyRequest()
based on the UUID. If the drm scheme is clearkey UUID, clearkey plugin will
return ERROR_DRM_CANNOT_HANDLE because it is expecting initDataType
(e.g. "cenc") instead of mimeType (e.g. "video/mp4").
Replace initDataType parameter in clearkey DrmPlugin::getKeyRequest() with
mimeType.
bug: 30790899
Change-Id: I60c77c458d8d836d3eb2f9f52296a86efa73a4eb
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1
Change-Id: Idf1c48d7bfe3f0da20401cb3ff1983ec00be170d
Memory heap check updated and restored to mediaserver,
added as new option to audioserver.
Requires properties to be set (example for audioserver):
$ adb shell setprop libc.debug.malloc.program audioserver
$ adb shell setprop libc.debug.malloc.options backtrace=8
$ adb shell pkill audioserver
...
and to dump:
$ adb shell dumpsys media.audio_flinger -m
Bug: 28909124
Bug: 27500825
Change-Id: Ifa8c2c02b022daf1a799ee4a1d75282a3c921763