Stay organized with collections
Save and categorize content based on your preferences.
CodecException
class CodecException : IllegalStateException
Thrown when an internal codec error occurs.
Summary
Constants |
static Int |
This indicates required resource was not able to be allocated.
|
static Int |
This indicates the resource manager reclaimed the media resource used by the codec.
|
Public methods |
String |
Retrieve a developer-readable diagnostic information string associated with the exception.
|
Int |
Retrieve the error code associated with a CodecException
|
Boolean |
Returns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again.
|
Boolean |
Returns true if the codec exception is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time.
|
Constants
ERROR_INSUFFICIENT_RESOURCE
static val ERROR_INSUFFICIENT_RESOURCE: Int
This indicates required resource was not able to be allocated.
Value: 1100
ERROR_RECLAIMED
static val ERROR_RECLAIMED: Int
This indicates the resource manager reclaimed the media resource used by the codec.
With this exception, the codec must be released, as it has moved to terminal state.
Value: 1101
Public methods
getDiagnosticInfo
fun getDiagnosticInfo(): String
Retrieve a developer-readable diagnostic information string associated with the exception. Do not show this to end-users, since this string will not be localized or generally comprehensible to end-users.
Return |
String |
This value cannot be null . |
getErrorCode
fun getErrorCode(): Int
Retrieve the error code associated with a CodecException
isRecoverable
fun isRecoverable(): Boolean
Returns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again.
isTransient
fun isTransient(): Boolean
Returns true if the codec exception is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaCodec.CodecException\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCodecException\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaCodec.CodecException \"View this page in Java\") \n\n```\nclass CodecException : IllegalStateException\n```\n\n|---|---|---|---|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||||\n| | ↳ | [java.lang.Exception](../../java/lang/Exception.html#) ||||\n| | | ↳ | [java.lang.RuntimeException](../../java/lang/RuntimeException.html#) |||\n| | | | ↳ | [java.lang.IllegalStateException](../../java/lang/IllegalStateException.html#) ||\n| | | | | ↳ | [android.media.MediaCodec.CodecException](#) |\n\nThrown when an internal codec error occurs.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_INSUFFICIENT_RESOURCE](#ERROR_INSUFFICIENT_RESOURCE:kotlin.Int) This indicates required resource was not able to be allocated. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_RECLAIMED](#ERROR_RECLAIMED:kotlin.Int) This indicates the resource manager reclaimed the media resource used by the codec. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getDiagnosticInfo](#getDiagnosticInfo())`()` Retrieve a developer-readable diagnostic information string associated with the exception. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getErrorCode](#getErrorCode())`()` Retrieve the error code associated with a CodecException |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isRecoverable](#isRecoverable())`()` Returns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isTransient](#isTransient())`()` Returns true if the codec exception is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time. |\n\nConstants\n---------\n\n### ERROR_INSUFFICIENT_RESOURCE\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_INSUFFICIENT_RESOURCE: Int\n```\n\nThis indicates required resource was not able to be allocated. \n\n Value: 1100\n\n### ERROR_RECLAIMED\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_RECLAIMED: Int\n```\n\nThis indicates the resource manager reclaimed the media resource used by the codec.\n\nWith this exception, the codec must be released, as it has moved to terminal state. \n\n Value: 1101\n\nPublic methods\n--------------\n\n### getDiagnosticInfo\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getDiagnosticInfo(): String\n```\n\nRetrieve a developer-readable diagnostic information string associated with the exception. Do not show this to end-users, since this string will not be localized or generally comprehensible to end-users.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getErrorCode\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getErrorCode(): Int\n```\n\nRetrieve the error code associated with a CodecException \n\n### isRecoverable\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun isRecoverable(): Boolean\n```\n\nReturns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again. \n\n### isTransient\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun isTransient(): Boolean\n```\n\nReturns true if the codec exception is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time."]]