diff options
Diffstat (limited to 'media/java/android/media/MediaCodec.java')
-rw-r--r-- | media/java/android/media/MediaCodec.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 675916b..1c7c9ea 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -672,6 +672,11 @@ final public class MediaCodec { super(detailMessage); mErrorCode = errorCode; mActionCode = actionCode; + + // TODO get this from codec + final String sign = errorCode < 0 ? "neg_" : ""; + mDiagnosticInfo = + "android.media.MediaCodec.error_" + sign + Math.abs(errorCode); } /** @@ -696,15 +701,28 @@ final public class MediaCodec { * Retrieve the error code associated with a CodecException. * This is opaque diagnostic information and may depend on * hardware or API level. + * + * @hide */ public int getErrorCode() { return mErrorCode; } + /** + * Retrieve a human readable diagnostic information string + * associated with the exception. DO NOT SHOW THIS TO END-USERS! + * This string will not be localized or generally comprehensible + * to end-users. + */ + public String getDiagnosticInfo() { + return mDiagnosticInfo; + } + /* Must be in sync with android_media_MediaCodec.cpp */ private final static int ACTION_TRANSIENT = 1; private final static int ACTION_RECOVERABLE = 2; + private final String mDiagnosticInfo; private final int mErrorCode; private final int mActionCode; } @@ -737,6 +755,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 */ public int getErrorCode() { |