I use the API as described by Microsoft's Documentation, refer to the image below.
On setup, I receive no error by the API at any point. I create a secure decoder, open the session, retrieve the key, provide the response, etc.
AMediaDrm_isCryptoSchemeSupported
returns as expected.AMediaCodec_configure
with the appropriate AMediaCrypto
object and ANativeWindow
surface is a SurfaceView with setSecure(true)
.Playback of the first seconds of unencrypted content of the video is ok.
When it's time to decrypt, for each input sample I create an AMediaCodecCryptoInfo
with appropriate information and push them to the decoder with queueSecureInputBuffer()
.
Buffering sequence
AMediaCodec_queueSecureInputBuffer()
AMediaCodec_dequeueOutputBuffer()
AMediaCodec_releaseOutputBuffer()
On the first sample, from the log produced (see below) I can deduce the PlayReady plugin calls Drm_Reader_Bind. But there's no attempt to decrypt. No error is returned. Nothing is rendered.
If I keep buffering the encrypted content, eventually AMediaCodec_dequeueOutputBuffer()
will return AMEDIACODEC_INFO_TRY_AGAIN_LATER
.
What am I missing for the plugin to decrypt and render?
Last logs from the DRM plugin.
03-13 02:09:15.190 1766 1766 E PlayReadySession: [bindLicenseWithKID,188]: The key index:0 !!
03-13 02:09:15.190 1766 1766 E PlayReadySession: bindLicenseWithKID,229: kid_num = 1
03-13 02:09:15.190 1766 1766 E PlayReadySession: bindLicenseWithKID,245, do non-persist init
03-13 02:09:15.190 1766 1766 E PlayReadySession: resetDrmHeaderWithKID >>
03-13 02:09:15.190 1766 1766 E [PR40][SDK] : [API] Drm_Reader_Bind in
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, f_eOperation = 1
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR(938):[PR40] 3_XMR_IS_EXPIRATION_VALID-dwBeginDate:
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : 2020-3-12 17:5:7
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR(939): 3_XMR_IS_EXPIRATION_VALID curtime:
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : 2020-3-12 17:9:15
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR(950):4_XMR_IS_EXPIRATION_VALID-dwEndDate:
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : 2020-4-11 16:6:7
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR(951):4_XMR_IS_EXPIRATION_VALID curtime:
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.192 1766 1766 E [PR40][SDK] : 2020-3-12 17:9:15
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, lReasonForFail = 0
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, f_eOperation = 5
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.193 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, lReasonForFail = 0
03-13 02:09:15.193 1766 1766 I [PR40][SDK] : === DRM_PLAY_OPL_CALLBACK ===
03-13 02:09:15.193 1766 1766 I [PR40][SDK] : wCompressedDigitalVideo = 100
03-13 02:09:15.193 1766 1766 I [PR40][SDK] : wUncompressedDigitalVideo = 250
03-13 02:09:15.194 1766 1766 I [PR40][SDK] : wAnalogVideo = 150
03-13 02:09:15.194 1766 1766 I [PR40][SDK] : wCompressedDigitalAudio = 100
03-13 02:09:15.194 1766 1766 I [PR40][SDK] : wUncompressedDigitalAudio = 100
03-13 02:09:15.196 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.196 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, f_eOperation = 5
03-13 02:09:15.196 1766 1766 E [PR40][SDK] : [PR40][SDK]
03-13 02:09:15.196 1766 1766 E [PR40][SDK] : DRM_LEVL_PerformOperationsXMR, lReasonForFail = 0
03-13 02:09:15.196 1766 1766 E [PR40][SDK] : [API] Drm_Reader_Bind out, dr = 0x00000000
User contributions licensed under CC BY-SA 3.0