Transformer.Listener


public interface Transformer.Listener


A listener for the export events.

If the export is not cancelled, either onError or onCompleted will be called once for each export.

Summary

Public methods

default void
onCompleted(Composition composition, ExportResult exportResult)

Called when the export is completed successfully.

default void
onError(
    Composition composition,
    ExportResult exportResult,
    ExportException exportException
)

Called if an exception occurs during the export.

default void
onFallbackApplied(
    Composition composition,
    TransformationRequest originalTransformationRequest,
    TransformationRequest fallbackTransformationRequest
)

Called when falling back to an alternative TransformationRequest or changing the video frames' resolution is necessary to comply with muxer or device constraints.

default void
onFallbackApplied(
    MediaItem inputMediaItem,
    TransformationRequest originalTransformationRequest,
    TransformationRequest fallbackTransformationRequest
)

This method is deprecated.

Use onFallbackApplied instead.

default void

This method is deprecated.

Use onCompleted instead.

default void
onTransformationCompleted(
    MediaItem inputMediaItem,
    TransformationResult result
)

This method is deprecated.

Use onCompleted instead.

default void
onTransformationError(MediaItem inputMediaItem, Exception exception)

This method is deprecated.

Use onError instead.

default void
onTransformationError(
    MediaItem inputMediaItem,
    TransformationException exception
)

This method is deprecated.

Use onError instead.

default void
onTransformationError(
    MediaItem inputMediaItem,
    TransformationResult result,
    TransformationException exception
)

This method is deprecated.

Use onError instead.

Public methods

onCompleted

default void onCompleted(Composition composition, ExportResult exportResult)

Called when the export is completed successfully.

Parameters
Composition composition

The Composition for which the export is completed.

ExportResult exportResult

The ExportResult of the export.

onError

default void onError(
    Composition composition,
    ExportResult exportResult,
    ExportException exportException
)

Called if an exception occurs during the export.

The export output file (if any) is not deleted in this case.

Parameters
Composition composition

The Composition for which the exception occurs.

ExportResult exportResult

The ExportResult of the export.

ExportException exportException

The ExportException describing the exception. This is the same instance as the exception in result.

onFallbackApplied

default void onFallbackApplied(
    Composition composition,
    TransformationRequest originalTransformationRequest,
    TransformationRequest fallbackTransformationRequest
)

Called when falling back to an alternative TransformationRequest or changing the video frames' resolution is necessary to comply with muxer or device constraints.

Parameters
Composition composition

The Composition for which the export is requested.

TransformationRequest originalTransformationRequest

The unsupported TransformationRequest used when building Transformer.

TransformationRequest fallbackTransformationRequest

The alternative TransformationRequest, with supported audioMimeType, videoMimeType, outputHeight, and hdrMode values set.

onFallbackApplied

default void onFallbackApplied(
    MediaItem inputMediaItem,
    TransformationRequest originalTransformationRequest,
    TransformationRequest fallbackTransformationRequest
)

onTransformationCompleted

default void onTransformationCompleted(MediaItem inputMediaItem)

onTransformationCompleted

default void onTransformationCompleted(
    MediaItem inputMediaItem,
    TransformationResult result
)

onTransformationError

default void onTransformationError(MediaItem inputMediaItem, Exception exception)

onTransformationError

default void onTransformationError(
    MediaItem inputMediaItem,
    TransformationException exception
)

onTransformationError

default void onTransformationError(
    MediaItem inputMediaItem,
    TransformationResult result,
    TransformationException exception
)