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.

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.