• Home
  • History
  • Annotate
  • only in /frameworks/av/drm/libmediadrm/
History log of /frameworks/av/drm/libmediadrm/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
70367f525a7bf5be52115608d190d72756e972ea 16-Jun-2017 Jeff Tinker <jtinker@google.com> Check for drmhal plugin null pointer deref

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
rmHal.cpp
3e2891674ef57a74e59ca5e27f89647b3f06861b 01-Jun-2017 Jeff Tinker <jtinker@google.com> Allow drm plugin to be released when binder dies

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
rmHal.cpp
593111f4460f2b2e8f541e936670e3577d45fff6 26-May-2017 Jeff Tinker <jtinker@google.com> Don't leak hwservicemanager binders

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
rmHal.cpp
f53d96676da2d672d03e35fa0894cb299ac9e318 09-May-2017 Jeff Tinker <jtinker@google.com> Fix resource leaks in drm hal

bug:36408047
test: manual testing to verify leaks are fixed
Change-Id: I3ade65eff4bbe8603fe4cf04b00ab1f3e1122f90
rmHal.cpp
9e7dd63dfff0cc967f025ea9e27a299aaa99fd69 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'api-review' into oc-dev

* changes:
MediaCas: combine openSession methods
MediaCas: changes to address API review comments
e309b22bff1719f1fea84b247e4b2bc4c5f09eb5 05-Apr-2017 Jeff Tinker <jtinker@google.com> Change drm/crypto service names to "default"

bug: 36371166

Test: vts drm hidl test, Play Movies

Change-Id: I942f91ab0be1f237017e88910f8d3738bf54447f
ryptoHal.cpp
rmHal.cpp
a78c1cc9773532b1f9d066ed8fa0d9414c1bb8bb 01-Apr-2017 Chong Zhang <chz@google.com> MediaCas: combine openSession methods

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
asImpl.cpp
idl/android/media/ICas.aidl
ef0b6b64144b6e062bbb445a6df73c365b66646d 07-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "MediaCas: fixes for playback tests" into oc-dev
b01fb48fcc755d6bfad9bc94d8c227349155e1b5 24-Mar-2017 Chong Zhang <chz@google.com> MediaCas: fixes for playback tests

- 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
asImpl.cpp
2fdf283c82b24caf4150b32b5e893322a3e3524b 02-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add Flag for Enabling 64-bit Media DRM Server" into oc-dev
b86f4b3ce066eadbfe9c2f420b16aaf2de741edb 28-Mar-2017 Rahul Frias <rfrias@google.com> Fix reclaim sessions (DO NOT MERGE)

[ 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
rmHal.cpp
e9fec5451704893412c8e707940483a6bdb5f238 14-Mar-2017 John W. Bruce <juce@google.com> Add Flag for Enabling 64-bit Media DRM Server

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
ndroid.mk
rypto.cpp
rm.cpp
rmPluginPath.cpp
6dcab2bafd847be84c2c2230bbd04af9c45c491e 28-Mar-2017 Chong Zhang <chz@google.com> DRM: more fixes for heap base mapping -- DO NOT MERGE

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 bf628da1e231e2e4d6bf61f9884e120bae3f9156)
ryptoHal.cpp
Crypto.cpp
d07c92742fc5801cab8e99801f591365986acbe9 28-Mar-2017 Chong Zhang <chz@google.com> Revert "Revert "Fix decoder instantiation during playback"" -- DO NOT MERGE

This reverts commit de7268d8e20b883ec88a7ff19ad560a665373484.

Bug: 36479980
Bug: 36209723
Bug: 36660223

Change-Id: I8d83305a28dc35cee16f8f1068c90fdd0b9effff
(cherry picked from commit 6aa5c0662c86c7f7b2890577a207086eeecbd177)
ryptoHal.cpp
Crypto.cpp
93e29c0846e0f7583ae96edafbf5e8a3169711ee 22-Mar-2017 Jeff Tinker <jtinker@google.com> Merge "Revert "Fix decoder instantiation during playback""
de7268d8e20b883ec88a7ff19ad560a665373484 22-Mar-2017 Jeff Tinker <jtinker@google.com> Revert "Fix decoder instantiation during playback"

This reverts commit 33327c7f0f04bcce3f8e8ee23953f87efc423037.

Bug: 36479980
Bug: 36209723

Change-Id: I8ff9422086f5ba9ba5df60135d20b9d8bfc0be52
ryptoHal.cpp
Crypto.cpp
7ec2a45e48f6c24a5e8fa96416d8793329b79d2f 17-Mar-2017 Jeff Tinker <jtinker@google.com> Merge "Fix decoder instantiation during playback"
33327c7f0f04bcce3f8e8ee23953f87efc423037 16-Mar-2017 Jeff Tinker <jtinker@google.com> Fix decoder instantiation during playback

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
ryptoHal.cpp
Crypto.cpp
efb7b9b26b966f6440bc8c5126c78c46090bf590 16-Mar-2017 Jeff Tinker <jtinker@google.com> Merge "Fix CTS post submit failures"
d0cb831e7f14c43359aeb080d9564185d28c7a75 15-Mar-2017 Jeff Tinker <jtinker@google.com> Fix CTS post submit failures

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
ryptoHal.cpp
e424bc24ea6d3c49832436c9e400c6244f3b8c5d 15-Mar-2017 Jeff Tinker <jtinker@google.com> Merge "Fix mediaserver crash due to NULL errorDetailMessage"
9247e10531fa3128d5263e3ad605a0fecefcd2d0 14-Mar-2017 Edwin Wong <edwinwong@google.com> Check opaque size in CREATE_PLUGIN.

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
Crypto.cpp
0be134af061566c7d68c0c4f868a677daf85f550 10-Mar-2017 Jeff Tinker <jtinker@google.com> Fix mediaserver crash due to NULL errorDetailMessage

bug: 33905340
Change-Id: Icad86ad066a053f4aa9ca708a3c8690a68ec1856
Crypto.cpp
6a4921ae044186bf64dab3903e8fead9499fc7f6 10-Mar-2017 Jeff Tinker <jtinker@google.com> Fix mediadrmserver not finding IServiceManager instance

bug: 36113291
Change-Id: I8d459e0edd61555a874cce68e178afd8d468e2e4
ryptoHal.cpp
rmHal.cpp
de2c37e75c6e58fd9da2e87f11e72927620c3265 03-Mar-2017 Jeff Tinker <jtinker@google.com> Merge "Load vendor-provided drm hidl hal modules"
abeb36a8c2f044772297536e70340c3b245863e4 17-Feb-2017 Jeff Tinker <jtinker@google.com> Load vendor-provided drm hidl hal modules

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
ndroid.mk
ryptoHal.cpp
rmHal.cpp
886aca07d2a730ba8e972478511c7bc8660ebd2a 28-Feb-2017 Chong Zhang <chz@google.com> MediaCas: move *.aidl files from frameworks/base to frameworks/av

PDK builds can't reference frameworks/base from frameworks/av.

bug: 22804304
Change-Id: I5ae534a09e15999c73d0c2d6e96755ee74ffa940
ndroid.mk
idl/android/media/ICas.aidl
idl/android/media/ICasListener.aidl
idl/android/media/IDescrambler.aidl
idl/android/media/IMediaCasService.aidl
idl/android/media/MediaCas.aidl
idl/android/media/MediaDescrambler.aidl
9dbe9a57bf0ae2494ec312d6c1b06feec20e9ec9 03-Jan-2017 Chong Zhang <chz@google.com> MediaCas: add MediaCasService

This CL adds API only without implementation.

bug: 22804304
Change-Id: Ibb5a29cc616ec0af81957b2bfe1419c482591753
ndroid.mk
asImpl.cpp
escramblerImpl.cpp
ediaCasDefs.cpp
haredLibrary.cpp
3cb5316c442d182ada75a1394e1505a017400526 16-Feb-2017 Jeff Tinker <jtinker@google.com> Support multiple codecs per crypto instance

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
ryptoHal.cpp
38875a41d62003ee9ad1f537106a86289fb0c437 16-Feb-2017 Edwin Wong <edwinwong@google.com> Fix isCryptoSchemeSupported's return value.

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
rmHal.cpp
c82b9c335e69b617817dace0ef64ad3df3f5080f 14-Feb-2017 Jeff Tinker <jtinker@google.com> Don't segfault on fail to create drm factory

bug:35329920
Change-Id: Id65254447d76222b78f977f6598751c5c51c87f3
rmHal.cpp
f3a591cc9d604133e2c5cae3d34322b52cd7575d 02-Feb-2017 Jeff Tinker <jtinker@google.com> Enable DRM HIDL HAL by default

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
ndroid.mk
rmHal.cpp
68b3d9f49e68a11af5225175dc9e60ce88819e84 07-Jan-2017 Edwin Wong <edwinwong@google.com> Pass application packagename to drm plugin.

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
ndroid.mk
rm.cpp
rmHal.cpp
Drm.cpp
a53d6553fce1818bdf87833f93633c93ad1b5915 20-Jan-2017 Jeff Tinker <jtinker@google.com> Implement client code to use Drm and Crypto HALs

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
ndroid.mk
rypto.cpp
ryptoHal.cpp
rmHal.cpp
Crypto.cpp
75571e4bc76bd2defd4309c7154120840396329d 08-Nov-2016 Marco Nelissen <marcone@google.com> Clean up mediadrm dependencies

Move various things around so mediadrmserver doesn't need
libstagefright and libmedia

Test: build/boot
Change-Id: I48b713cd679b992cb6ad1262c20394a9892d7027
ndroid.mk
Crypto.cpp
Drm.cpp
DrmClient.cpp
MediaDrmService.cpp
c661ae6165338fd5f0bca50a63058b4bcd6def4b 25-Oct-2016 Marco Nelissen <marcone@google.com> Remove unneeded links with dynamic libraries

Various media components were linking against dynamic libraries that weren't needed.

Test: built and booted

Change-Id: I7379506fd06d4e28e0eff0001fd073a2d3860f8e
ndroid.mk
9e27bc6c9c446814fa88bca98c1faa26c8d41fed 20-Oct-2016 Jeff Tinker <jtinker@google.com> Fix memory leak in DRM framework

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
rm.cpp
5f5ee1110dd85001b43db7637a97474acfe8d681 16-Aug-2016 Glenn Kasten <gkasten@google.com> LOCAL_CLANG := true is now the default

Test: verify that build has no failures
Change-Id: Ib249b276c6295e55eb54fa37b6d15486415dfbed
ndroid.mk
fb78341ae3a11b4c0356b393b6163f3e1258d7be 15-Sep-2016 Elliott Hughes <enh@google.com> Stop including libcore/include/ in frameworks/av.

Change-Id: I7c0ffa84071c2080b5bfe2ce9ad7e1822fe863c7
ndroid.mk
aee0669a7bdc1502a5e3d0752aaf84b0354a005e 10-Aug-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix clang-tidy warnings in drm."
am: e055519839

Change-Id: I99159fb0391af796445ea24265d088d20d178077
3003807fcfa96c9cbfea18d643f47108aa116cd5 25-Apr-2016 Jeff Tinker <jtinker@google.com> Remove MediaDrm stack from mediaserver

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
ndroid.mk
rypto.cpp
rm.cpp
rmSessionManager.cpp
haredLibrary.cpp