0

Context:

I want to decrypt EME content of type video/mp4 on Android. I opened a MediaDrm instance using PlayReady UUID. AMediaDrmKeyType is KEY_TYPE_STREAMING.

I am unable to obtain a key request from AMediaDrm_getKeyRequest. I suspect the init data I provide is incorrect, because it's the only parameter I'm not certain about.

The only information I can find is in the library's header and not very specific:

/*
* init container-specific data, its meaning is interpreted based on the mime type
* provided in the mimeType parameter.  It could contain, for example, the content
* ID, key ID or other data obtained from the content metadata that is required in
* generating the key request. init may be null when keyType is KEY_TYPE_RELEASE.
*/

media_status_t AMediaDrm_getKeyRequest(AMediaDrm *, const AMediaDrmScope *scope,
    const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType,
    const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters,
    const uint8_t **keyRequest, size_t *keyRequestSize);

With other DRM libraries, usually the key request API requires a PlayReady PSSH box. I've tried this with AMediaDrm_getKeyRequest() but I only get a generic error -10000.

I've also tried the content ID or key ID, as suggested by the documentation, to no avail.

What is the expected init data for the call to AMediaDrm_getKeyRequest() for PlayReady content?

Martin
  • 3,960
  • 7
  • 43
  • 43
  • I am guessing your device does actually support PlayReady DRM if you are able to create the MediaDRM instance, even though Widevine is the usual default DRM on Android and regular Android device are not required to support PlayReady by default (Android TV is I think) but are you able to share what device type it is and how PlayReady is included on it, i.e. at OEM or via some other way? – Mick Dec 23 '19 at 17:15
  • The only device I'm allowed to share this is happening on is an Nvidia Shield. On the target device, PlayReady is provided by OEM. – Martin Jan 06 '20 at 17:00
  • 1
    Its hard to find open sharable examples of this case as Widevine is much more common on Android, but if you look at this opensoure project it has an example call showing how they set init from the PSSH: https://github.com/peak3d/inputstream.adaptive/blob/master/wvdecrypter/wvdecrypter_android.cpp – Mick Jan 09 '20 at 10:52
  • I was able to make it work by sending the complete PlayReady PSSH as obtained by the server. – Martin Mar 12 '20 at 17:51

0 Answers0