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
Part of media security hardening
MediaDrm was temporarily allowed to
run in either mediaserver or mediadrmserver
while all nexus devices were implementing
support for the native_handle representation
of secure buffers. Now that all nexus
devices support native_handle, the MediaDrm
stack can be removed from mediaserver.
b/22990512
Change-Id: Ie5d83bfeb4c4a824e1d0edb4c9452c782d6fd386
When creating this static lib, explicitly reference libbinder
to pick up its header include paths.
Bug: 27804373
Test: lib compiles when libbinder's header include
paths change.
Change-Id: I6cd034703db8ef13f0bcaece27373a60fcde7b4e
This change also enables -Werror flag that causes
all warning to fail this target's build to prevent regressions.
Bug: 27151704
Change-Id: I5d815d20aea151eb40292b8e2bffb144240413a2
drmserver need to be in the readproc group to access /proc files
associated with other UIDs, due to enabling hidepid=2 in
https://android-review.googlesource.com/181345
Bug: 25925909
Change-Id: If477214a6cd598cebbe440a94aa1d58ea8f7114a
To support adding cts tests for new APIs in M, the
clearkey DRM plugin needs to be updated.
Change-Id: If672ecec8f570d1dd5130e8e4419d37bd931a9e2
related-to-bug: 21527003
This file needs stdlib.h for malloc, free and realloc, but was
previously getting it only via the OpenSSL headers that it was
including.
BoringSSL, in the future, will be tider about what it includes via its
headers and so this file will need to include stdlib.h itself.
(cherry picked from commit 2544611b6f)
Bug: 21085331
Change-Id: I864c679ba5a9f0041dd49d063ad1190ffa87b30a
This file needs stdlib.h for malloc, free and realloc, but was
previously getting it only via the OpenSSL headers that it was
including.
BoringSSL, in the future, will be tider about what it includes via its
headers and so this file will need to include stdlib.h itself.
Change-Id: Ic0ee43ed74ff96f1a57e6e153c65e80e0115c0e9
The libcrypto and libssl modules (and their respective static and host
versions) use LOCAL_EXPORT_C_INCLUDE_DIRS thus just including the module
is sufficient.
Change-Id: If9df76e6fefb7419cbb2fb33a0264626c748561e
to use the new static version.
Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
Conflicts:
media/libmedia/IAudioFlinger.cpp
media/libmedia/IMediaPlayer.cpp
media/libstagefright/CameraSource.cpp