@UnstableApi
class ExportException : Exception


Thrown when a non-locally recoverable export failure occurs.

Summary

Nested types

The Codec details.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
annotation ExportException.ErrorCode

Error codes that identify causes of Transformer errors.

Constants

const Int

Caused by an audio processing failure.

const Int

Caused by a decoder initialization failure.

const Int

Caused by a failure while trying to decode media samples.

const Int

Caused by trying to decode content whose format is not supported.

const Int

Caused by an encoder initialization failure.

const Int

Caused by a failure while trying to encode media samples.

const Int

Caused by trying to encode content whose format is not supported. *

const Int

Caused by a failed runtime check.

const Int

Caused by an HTTP server returning an unexpected HTTP response status code.

const Int

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.

const Int

Caused by a non-existent file.

const Int

Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.

const Int

Caused by a network connection failure.

const Int

Caused by a network timeout, meaning the server is taking too long to fulfill a request.

const Int

Caused by lack of permission to perform an IO operation.

const Int

Caused by reading data out of the data bound.

const Int

Caused by an Input/Output error which could not be identified.

const Int

Caused by mismatching formats in MuxerWrapper.

const Int

Caused by a failure while muxing media samples.

const Int

Caused by a timeout while muxing media samples.

const Int

Caused by an error whose cause could not be identified.

const Int

Caused by a video frame processing failure.

Public functions

java-static ExportException!
createForAssetLoader(cause: Throwable!, errorCode: Int)

Creates an instance for an AssetLoader related exception.

java-static ExportException!

Creates an instance for an audio processing related exception.

java-static ExportException!
createForCodec(
    cause: Throwable!,
    @ExportException.ErrorCode errorCode: Int,
    codecInfo: ExportException.CodecInfo!
)

Creates an instance for a Codec related exception.

java-static ExportException!

Creates an instance for an unexpected exception.

Boolean

Returns whether the error data associated to this exception equals the error data associated to other.

String!

Equivalent to ExportException.getErrorCodeName(this.errorCode).

java-static String!

Returns the name of a given errorCode.

Public properties

ExportException.CodecInfo?

The CodecInfo for codec related exceptions, or null if the exception is not codec related.

Int

An error code which identifies the cause of the export failure.

Long

The value of elapsedRealtime when this exception was created.

Constants

ERROR_CODE_AUDIO_PROCESSING_FAILED

const val ERROR_CODE_AUDIO_PROCESSING_FAILED = 6001: Int

Caused by an audio processing failure.

ERROR_CODE_DECODER_INIT_FAILED

const val ERROR_CODE_DECODER_INIT_FAILED = 3001: Int

Caused by a decoder initialization failure.

ERROR_CODE_DECODING_FAILED

const val ERROR_CODE_DECODING_FAILED = 3002: Int

Caused by a failure while trying to decode media samples.

ERROR_CODE_DECODING_FORMAT_UNSUPPORTED

const val ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 3003: Int

Caused by trying to decode content whose format is not supported.

ERROR_CODE_ENCODER_INIT_FAILED

const val ERROR_CODE_ENCODER_INIT_FAILED = 4001: Int

Caused by an encoder initialization failure.

ERROR_CODE_ENCODING_FAILED

const val ERROR_CODE_ENCODING_FAILED = 4002: Int

Caused by a failure while trying to encode media samples.

ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED

const val ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED = 4003: Int

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

const val ERROR_CODE_FAILED_RUNTIME_CHECK = 1001: Int

Caused by a failed runtime check.

This can happen when transformer reaches an invalid state.

ERROR_CODE_IO_BAD_HTTP_STATUS

const val ERROR_CODE_IO_BAD_HTTP_STATUS = 2004: Int

Caused by an HTTP server returning an unexpected HTTP response status code.

ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED

const val ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007: Int

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

const val ERROR_CODE_IO_FILE_NOT_FOUND = 2005: Int

Caused by a non-existent file.

ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE

const val ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003: Int

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

const val ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001: Int

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

const val ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002: Int

Caused by a network timeout, meaning the server is taking too long to fulfill a request.

ERROR_CODE_IO_NO_PERMISSION

const val ERROR_CODE_IO_NO_PERMISSION = 2006: Int

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

const val ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008: Int

Caused by reading data out of the data bound.

ERROR_CODE_IO_UNSPECIFIED

const val ERROR_CODE_IO_UNSPECIFIED = 2000: Int

Caused by an Input/Output error which could not be identified.

ERROR_CODE_MUXING_APPEND

const val ERROR_CODE_MUXING_APPEND = 7003: Int

Caused by mismatching formats in MuxerWrapper.

ERROR_CODE_MUXING_FAILED

const val ERROR_CODE_MUXING_FAILED = 7001: Int

Caused by a failure while muxing media samples.

ERROR_CODE_MUXING_TIMEOUT

const val ERROR_CODE_MUXING_TIMEOUT = 7002: Int

Caused by a timeout while muxing media samples.

ERROR_CODE_UNSPECIFIED

const val ERROR_CODE_UNSPECIFIED = 1000: Int

Caused by an error whose cause could not be identified.

ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED

const val ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 5001: Int

Caused by a video frame processing failure.

Public functions

createForAssetLoader

java-static fun createForAssetLoader(cause: Throwable!, errorCode: Int): ExportException!

Creates an instance for an AssetLoader related exception.

Parameters
cause: Throwable!

The cause of the failure.

errorCode: Int

See errorCode.

Returns
ExportException!

The created instance.

createForAudioProcessing

java-static fun createForAudioProcessing(
    exception: AudioProcessor.UnhandledAudioFormatException!,
    details: String!
): ExportException!

Creates an instance for an audio processing related exception.

Parameters
exception: AudioProcessor.UnhandledAudioFormatException!

The cause of the failure.

details: String!

The details associated with this exception.

Returns
ExportException!

The created instance.

createForCodec

java-static fun createForCodec(
    cause: Throwable!,
    @ExportException.ErrorCode errorCode: Int,
    codecInfo: ExportException.CodecInfo!
): ExportException!

Creates an instance for a Codec related exception.

Parameters
cause: Throwable!

The cause of the failure.

@ExportException.ErrorCode errorCode: Int

See errorCode.

codecInfo: ExportException.CodecInfo!

The CodecInfo.

Returns
ExportException!

The created instance.

createForUnexpected

java-static fun createForUnexpected(cause: Exception!): ExportException!

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
cause: Exception!

The cause of the failure.

Returns
ExportException!

The created instance.

errorInfoEquals

fun errorInfoEquals(other: ExportException?): Boolean

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

java-static fun getErrorCodeName(@ExportException.ErrorCode errorCode: Int): String!

Returns the name of a given errorCode.

Public properties

codecInfo

val codecInfoExportException.CodecInfo?

The CodecInfo for codec related exceptions, or null if the exception is not codec related.

errorCode

@ExportException.ErrorCode
val errorCodeInt

An error code which identifies the cause of the export failure.

timestampMs

val timestampMsLong

The value of elapsedRealtime when this exception was created.