Add support for max-res decode

bug: 16034599
Change-Id: I12124aef03518600a27de45bae24eef9c9735be5
This commit is contained in:
Jeff Tinker
2014-08-28 17:57:36 -07:00
parent 85933eb18b
commit 336d3eabc0
3 changed files with 17 additions and 0 deletions

View File

@@ -14665,6 +14665,7 @@ package android.media {
public static final class MediaCodec.CryptoException extends java.lang.RuntimeException {
ctor public MediaCodec.CryptoException(int, java.lang.String);
method public int getErrorCode();
field public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; // 0x4
field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
field public static final int ERROR_NO_KEY = 1; // 0x1
field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3

View File

@@ -733,6 +733,13 @@ final public class MediaCodec {
*/
public static final int ERROR_RESOURCE_BUSY = 3;
/**
* This indicates that the output protection levels supported by the
* device are not sufficient to meet the requirements set by the
* content owner in the license policy.
*/
public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4;
/**
* Retrieve the error code associated with a CryptoException
*/

View File

@@ -62,6 +62,7 @@ static struct CryptoErrorCodes {
jint cryptoErrorNoKey;
jint cryptoErrorKeyExpired;
jint cryptoErrorResourceBusy;
jint cryptoErrorInsufficientOutputProtection;
} gCryptoErrorCodes;
static struct CodecActionCodes {
@@ -756,6 +757,9 @@ static void throwCryptoException(JNIEnv *env, status_t err, const char *msg) {
case ERROR_DRM_RESOURCE_BUSY:
err = gCryptoErrorCodes.cryptoErrorResourceBusy;
break;
case ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION:
err = gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection;
break;
default: /* Other negative DRM error codes go out as is. */
break;
}
@@ -1434,6 +1438,11 @@ static void android_media_MediaCodec_native_init(JNIEnv *env) {
gCryptoErrorCodes.cryptoErrorResourceBusy =
env->GetStaticIntField(clazz.get(), field);
field = env->GetStaticFieldID(clazz.get(), "ERROR_INSUFFICIENT_OUTPUT_PROTECTION", "I");
CHECK(field != NULL);
gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection =
env->GetStaticIntField(clazz.get(), field);
clazz.reset(env->FindClass("android/media/MediaCodec$CodecException"));
CHECK(clazz.get() != NULL);
field = env->GetStaticFieldID(clazz.get(), "ACTION_TRANSIENT", "I");