ExportException
@UnstableApi
public final class ExportException extends Exception
| java.lang.Object | |||
| ↳ | kotlin.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | androidx.media3.transformer.ExportException |
Thrown when a non-locally recoverable export failure occurs.
Summary
Nested types |
|---|
public final class ExportException.CodecInfoThe |
@DocumentedError codes that identify causes of |
Constants |
|
|---|---|
static final int |
Caused by an audio processing failure. |
static final int |
Caused by a decoder initialization failure. |
static final int |
ERROR_CODE_DECODING_FAILED = 3002Caused by a failure while trying to decode media samples. |
static final int |
Caused by trying to decode content whose format is not supported. |
static final int |
Caused by an encoder initialization failure. |
static final int |
ERROR_CODE_ENCODING_FAILED = 4002Caused by a failure while trying to encode media samples. |
static final int |
Caused by trying to encode content whose format is not supported. * |
static final int |
Caused by a failed runtime check. |
static final int |
Caused by an HTTP server returning an unexpected HTTP response status code. |
static final int |
Caused by the |
static final int |
ERROR_CODE_IO_FILE_NOT_FOUND = 2005Caused by a non-existent file. |
static final int |
Caused by a server returning a resource with an invalid "Content-Type" HTTP header value. |
static final int |
Caused by a network connection failure. |
static final int |
Caused by a network timeout, meaning the server is taking too long to fulfill a request. |
static final int |
ERROR_CODE_IO_NO_PERMISSION = 2006Caused by lack of permission to perform an IO operation. |
static final int |
Caused by reading data out of the data bound. |
static final int |
ERROR_CODE_IO_UNSPECIFIED = 2000Caused by an Input/Output error which could not be identified. |
static final int |
ERROR_CODE_MUXING_APPEND = 7003Caused by mismatching formats in MuxerWrapper. |
static final int |
ERROR_CODE_MUXING_FAILED = 7001Caused by a failure while muxing media samples. |
static final int |
ERROR_CODE_MUXING_TIMEOUT = 7002Caused by a timeout while muxing media samples. |
static final int |
ERROR_CODE_UNSPECIFIED = 1000Caused by an error whose cause could not be identified. |
static final int |
Caused by a video frame processing failure. |
Public fields |
|
|---|---|
final @Nullable ExportException.CodecInfo |
The |
final int |
An error code which identifies the cause of the export failure. |
final long |
The value of |
Public methods |
|
|---|---|
static ExportException |
createForAssetLoader(Throwable cause, int errorCode)Creates an instance for an |
static ExportException |
createForAudioProcessing(Creates an instance for an audio processing related exception. |
static ExportException |
createForCodec(Creates an instance for a |
static ExportException |
createForUnexpected(Throwable cause)Creates an instance for an unexpected exception. |
boolean |
errorInfoEquals(@Nullable ExportException other)Returns whether the error data associated to this exception equals the error data associated to |
String |
Equivalent to |
static String |
getErrorCodeName(@ExportException.ErrorCode int errorCode)Returns the name of a given |
Inherited methods |
|---|
Constants
ERROR_CODE_AUDIO_PROCESSING_FAILED
public static final int ERROR_CODE_AUDIO_PROCESSING_FAILED = 6001
Caused by an audio processing failure.
ERROR_CODE_DECODER_INIT_FAILED
public static final int ERROR_CODE_DECODER_INIT_FAILED = 3001
Caused by a decoder initialization failure.
ERROR_CODE_DECODING_FAILED
public static final int ERROR_CODE_DECODING_FAILED = 3002
Caused by a failure while trying to decode media samples.
ERROR_CODE_DECODING_FORMAT_UNSUPPORTED
public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 3003
Caused by trying to decode content whose format is not supported.
ERROR_CODE_ENCODER_INIT_FAILED
public static final int ERROR_CODE_ENCODER_INIT_FAILED = 4001
Caused by an encoder initialization failure.
ERROR_CODE_ENCODING_FAILED
public static final int ERROR_CODE_ENCODING_FAILED = 4002
Caused by a failure while trying to encode media samples.
ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED
public static final int ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED = 4003
Caused by trying to encode content whose format is not supported. *
Supported output formats are limited by the encoders available.
ERROR_CODE_FAILED_RUNTIME_CHECK
public static final int ERROR_CODE_FAILED_RUNTIME_CHECK = 1001
Caused by a failed runtime check.
This can happen when transformer reaches an invalid state.
ERROR_CODE_IO_BAD_HTTP_STATUS
public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 2004
Caused by an HTTP server returning an unexpected HTTP response status code.
ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007
Caused by the AssetLoader trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it.
ERROR_CODE_IO_FILE_NOT_FOUND
public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 2005
Caused by a non-existent file.
ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE
public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003
Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.
For example, this can happen when the AssetLoader is expecting a piece of media, but the server returns a paywall HTML page, with content type "text/html".
ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001
Caused by a network connection failure.
The following is a non-exhaustive list of possible reasons:
- There is no network connectivity.
- The URL's domain is misspelled or does not exist.
- The target host is unreachable.
- The server unexpectedly closes the connection.
ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002
Caused by a network timeout, meaning the server is taking too long to fulfill a request.
ERROR_CODE_IO_NO_PERMISSION
public static final int ERROR_CODE_IO_NO_PERMISSION = 2006
Caused by lack of permission to perform an IO operation. For example, lack of permission to access internet or external storage.
ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008
Caused by reading data out of the data bound.
ERROR_CODE_IO_UNSPECIFIED
public static final int ERROR_CODE_IO_UNSPECIFIED = 2000
Caused by an Input/Output error which could not be identified.
ERROR_CODE_MUXING_APPEND
public static final int ERROR_CODE_MUXING_APPEND = 7003
Caused by mismatching formats in MuxerWrapper.
ERROR_CODE_MUXING_FAILED
public static final int ERROR_CODE_MUXING_FAILED = 7001
Caused by a failure while muxing media samples.
ERROR_CODE_MUXING_TIMEOUT
public static final int ERROR_CODE_MUXING_TIMEOUT = 7002
Caused by a timeout while muxing media samples.
| See also | |
|---|---|
setMaxDelayBetweenMuxerSamplesMs |
ERROR_CODE_UNSPECIFIED
public static final int ERROR_CODE_UNSPECIFIED = 1000
Caused by an error whose cause could not be identified.
ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 5001
Caused by a video frame processing failure.
Public fields
codecInfo
public final @Nullable ExportException.CodecInfo codecInfo
The CodecInfo for codec related exceptions, or null if the exception is not codec related.
errorCode
@ExportException.ErrorCode
public final int errorCode
An error code which identifies the cause of the export failure.
timestampMs
public final long timestampMs
The value of elapsedRealtime when this exception was created.
Public methods
createForAssetLoader
public static ExportException createForAssetLoader(Throwable cause, int errorCode)
Creates an instance for an AssetLoader related exception.
| Returns | |
|---|---|
ExportException |
The created instance. |
createForAudioProcessing
public static ExportException createForAudioProcessing(
AudioProcessor.UnhandledAudioFormatException exception,
String details
)
Creates an instance for an audio processing related exception.
| Parameters | |
|---|---|
AudioProcessor.UnhandledAudioFormatException exception |
The cause of the failure. |
String details |
The details associated with this exception. |
| Returns | |
|---|---|
ExportException |
The created instance. |
createForCodec
public static ExportException createForCodec(
Throwable cause,
@ExportException.ErrorCode int errorCode,
ExportException.CodecInfo codecInfo
)
Creates an instance for a Codec related exception.
| Parameters | |
|---|---|
Throwable cause |
The cause of the failure. |
@ExportException.ErrorCode int errorCode |
See |
ExportException.CodecInfo codecInfo |
The |
| Returns | |
|---|---|
ExportException |
The created instance. |
createForUnexpected
public static ExportException createForUnexpected(Throwable cause)
Creates an instance for an unexpected exception.
If the exception is a runtime exception, error code ERROR_CODE_FAILED_RUNTIME_CHECK is used. Otherwise, the created instance has error code ERROR_CODE_UNSPECIFIED.
| Parameters | |
|---|---|
Throwable cause |
The cause of the failure. |
| Returns | |
|---|---|
ExportException |
The created instance. |
errorInfoEquals
public boolean errorInfoEquals(@Nullable ExportException other)
Returns whether the error data associated to this exception equals the error data associated to other.
Note that this method does not compare the exceptions' stack traces.
getErrorCodeName
public String getErrorCodeName()
Equivalent to ExportException.getErrorCodeName(this.errorCode).
getErrorCodeName
public static String getErrorCodeName(@ExportException.ErrorCode int errorCode)
Returns the name of a given errorCode.