TransformationException


@UnstableApi
class TransformationException : Exception


Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
annotation TransformationException.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 a failure 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 TransformationException!
createForAssetLoader(cause: Throwable!, errorCode: Int)

Creates an instance for an AssetLoader related exception.

java-static TransformationException!
createForAudioProcessing(
    cause: Throwable!,
    audioFormat: AudioProcessor.AudioFormat!
)

Creates an instance for an audio processing related exception.

java-static TransformationException!
createForCodec(
    cause: Throwable!,
    @TransformationException.ErrorCode errorCode: Int,
    isVideo: Boolean,
    isDecoder: Boolean,
    details: String!
)

Creates an instance for a Codec related exception.

java-static TransformationException!
createForCodec(
    cause: Throwable!,
    @TransformationException.ErrorCode errorCode: Int,
    isVideo: Boolean,
    isDecoder: Boolean,
    format: Format!
)

Creates an instance for a Codec related exception.

java-static TransformationException!

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 TransformationException.getErrorCodeName(this.errorCode).

java-static String!

Returns the name of a given errorCode.

Public properties

Int

An error code which identifies the cause of the transformation 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_FAILED

const val ERROR_CODE_MUXING_FAILED = 7001: Int

Caused by a failure 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): TransformationException!

Creates an instance for an AssetLoader related exception.

Parameters
cause: Throwable!

The cause of the failure.

errorCode: Int

See errorCode.

Returns
TransformationException!

The created instance.

createForAudioProcessing

java-static fun createForAudioProcessing(
    cause: Throwable!,
    audioFormat: AudioProcessor.AudioFormat!
): TransformationException!

Creates an instance for an audio processing related exception.

Parameters
cause: Throwable!

The cause of the failure.

audioFormat: AudioProcessor.AudioFormat!

The AudioFormat used.

Returns
TransformationException!

The created instance.

createForCodec

java-static fun createForCodec(
    cause: Throwable!,
    @TransformationException.ErrorCode errorCode: Int,
    isVideo: Boolean,
    isDecoder: Boolean,
    details: String!
): TransformationException!

Creates an instance for a Codec related exception.

Parameters
cause: Throwable!

The cause of the failure.

@TransformationException.ErrorCode errorCode: Int

See errorCode.

isVideo: Boolean

Whether the Codec is configured for video.

isDecoder: Boolean

Whether the exception is created for a decoder.

details: String!

The details associated with this exception.

Returns
TransformationException!

The created instance.

createForCodec

java-static fun createForCodec(
    cause: Throwable!,
    @TransformationException.ErrorCode errorCode: Int,
    isVideo: Boolean,
    isDecoder: Boolean,
    format: Format!
): TransformationException!

Creates an instance for a Codec related exception.

This method should be used when the cause occurs before the Codec is initialized.

Parameters
cause: Throwable!

The cause of the failure.

@TransformationException.ErrorCode errorCode: Int

See errorCode.

isVideo: Boolean

Whether the Codec is configured for video.

isDecoder: Boolean

Whether the exception is created for a decoder.

format: Format!

The Format used for configuring the Codec.

Returns
TransformationException!

The created instance.

createForUnexpected

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

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
TransformationException!

The created instance.

errorInfoEquals

fun errorInfoEquals(other: TransformationException?): 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(@TransformationException.ErrorCode errorCode: Int): String!

Returns the name of a given errorCode.

Public properties

errorCode

@TransformationException.ErrorCode
val errorCodeInt

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

timestampMs

val timestampMsLong

The value of elapsedRealtime when this exception was created.