Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b00ab012 authored by Jeff Tinker's avatar Jeff Tinker Committed by Android (Google) Code Review
Browse files

Merge "Add support for max-res decode" into lmp-dev

parents 732edf09 336d3eab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14672,6 +14672,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
+7 −0
Original line number Diff line number Diff line
@@ -736,6 +736,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
         */
+9 −0
Original line number Diff line number Diff line
@@ -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");