New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 727918 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Use MediaCrypto.requiresSecureDecoderComponent() to determine whether secure decoder is needed

Project Member Reported by xhw...@chromium.org, May 30 2017

Issue description

Chrome Version: Any
OS: Android

Currently when playing protected content in Chrome for Android, we'll always require secure decoder for Widevine L1 and other key systems. For Widevine L3, secure decoder must NOT be used because the decoded output might not be supported (which requires SurfaceView or secure texture). All of these are hardcoded [1].

Actually, on Android, there is a MediaCrypto.requiresSecureDecoderComponent() API which returns whether secure decoder is required for the specific MediaCrypto object. We should use this API to answer whether we need secure decoder for the current key system and security level.

However currently MediaCrypto.requiresSecureDecoderComponent() takes a |mime| parameter, which has the same meaning as the mime in getKeyRequest(), e.g. "video/mp4" or "video/webm". We could end up starting to configure the video decoder before any CDM session is created, when we don't know what the |mime| is yet :(

One solution is to call MediaCrypto.requiresSecureDecoderComponent() for all possible |mime| types and return all the results to the decoder. Then when we create the decoder, we should be able to get the mime type from the codec type.

[1] https://cs.chromium.org/chromium/src/media/base/android/media_drm_bridge.cc?rcl=c3301607c94a89ec896e7c33f0ec1612e995e84e&l=557
 

Comment 1 by yucliu@chromium.org, Jul 17 2017

Cc: sandv@chromium.org

Comment 2 by sanfin@chromium.org, Aug 24 2017

Cc: sanfin@chromium.org
We need both MediaCrypto instance and |mime| to invoke MediaCrypto.requiresSecureDecoderComponent() API. The easiest way I can think of is to have MediaCodecBridgeImpl::CreateAudioDecoder()[1] and MediaCodecBridgeImpl::CreateVideoDecoder()[2] pass the |media_crypto| to the constructor of MediaCodecBridgeImpl; then pass it to MediaCodecBridge.create() [3]. The reset of the work should be straightforward.


[1] https://cs.chromium.org/chromium/src/media/base/android/media_codec_bridge_impl.cc?l=185
[2] https://cs.chromium.org/chromium/src/media/base/android/media_codec_bridge_impl.cc?l=235
[3] https://cs.chromium.org/chromium/src/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java?l=196
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3006542f7aad93093f359e4c8d132431843d17c4

commit 3006542f7aad93093f359e4c8d132431843d17c4
Author: Sandeep Vijayasekar <sandv@chromium.org>
Date: Wed Oct 11 01:47:17 2017

Pass MediaCrypto to createDecoder() for secure audio decoder

Playready plugin on certain platform requires a secure audio decoder
Check MediaCrypto.requiresSecureDecoderComponent() to check if a secure
audio decoder is required.

BUG=727918
BUG=Internal b/63354167
TEST=Audio works with secure audio decoder

Change-Id: I32d8a88db8ca74b0f3dbc1a8aae7b42c5e9c60a3
Reviewed-on: https://chromium-review.googlesource.com/699696
Commit-Queue: Sandeep Vijayasekar <sandv@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507856}
[modify] https://crrev.com/3006542f7aad93093f359e4c8d132431843d17c4/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
[modify] https://crrev.com/3006542f7aad93093f359e4c8d132431843d17c4/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java
[modify] https://crrev.com/3006542f7aad93093f359e4c8d132431843d17c4/media/base/android/media_codec_bridge_impl.cc
[modify] https://crrev.com/3006542f7aad93093f359e4c8d132431843d17c4/media/base/android/media_codec_bridge_impl.h

Sign in to add a comment