Interface Transformer.Listener
-
- Enclosing class:
- Transformer
public static interface Transformer.Listener
A listener for the export events.If the export is not cancelled, either
onError(com.google.android.exoplayer2.transformer.Composition, com.google.android.exoplayer2.transformer.ExportResult, com.google.android.exoplayer2.transformer.ExportException)
oronCompleted(com.google.android.exoplayer2.transformer.Composition, com.google.android.exoplayer2.transformer.ExportResult)
will be called once for each export.
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description 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(MediaItem inputMediaItem, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)
Deprecated.default void
onFallbackApplied(Composition composition, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)
Called when falling back to an alternativeTransformationRequest
or changing the video frames' resolution is necessary to comply with muxer or device constraints.default void
onTransformationCompleted(MediaItem inputMediaItem)
Deprecated.UseonCompleted(Composition, ExportResult)
instead.default void
onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result)
Deprecated.UseonCompleted(Composition, ExportResult)
instead.default void
onTransformationError(MediaItem inputMediaItem, TransformationException exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.default void
onTransformationError(MediaItem inputMediaItem, TransformationResult result, TransformationException exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.default void
onTransformationError(MediaItem inputMediaItem, Exception exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.
-
-
-
Method Detail
-
onTransformationCompleted
@Deprecated default void onTransformationCompleted(MediaItem inputMediaItem)
Deprecated.UseonCompleted(Composition, ExportResult)
instead.
-
onTransformationCompleted
@Deprecated default void onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result)
Deprecated.UseonCompleted(Composition, ExportResult)
instead.
-
onCompleted
default void onCompleted(Composition composition, ExportResult exportResult)
Called when the export is completed successfully.- Parameters:
composition
- TheComposition
for which the export is completed.exportResult
- TheExportResult
of the export.
-
onTransformationError
@Deprecated default void onTransformationError(MediaItem inputMediaItem, Exception exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.
-
onTransformationError
@Deprecated default void onTransformationError(MediaItem inputMediaItem, TransformationException exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.
-
onTransformationError
@Deprecated default void onTransformationError(MediaItem inputMediaItem, TransformationResult result, TransformationException exception)
Deprecated.UseonError(Composition, ExportResult, ExportException)
instead.
-
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
- TheComposition
for which the exception occurs.exportResult
- TheExportResult
of the export.exportException
- TheExportException
describing the exception. This is the same instance as the exception inresult
.
-
onFallbackApplied
@Deprecated default void onFallbackApplied(MediaItem inputMediaItem, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)
Deprecated.
-
onFallbackApplied
default void onFallbackApplied(Composition composition, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)
Called when falling back to an alternativeTransformationRequest
or changing the video frames' resolution is necessary to comply with muxer or device constraints.- Parameters:
composition
- TheComposition
for which the export is requested.originalTransformationRequest
- The unsupportedTransformationRequest
used when buildingTransformer
.fallbackTransformationRequest
- The alternativeTransformationRequest
, with supportedTransformationRequest.audioMimeType
,TransformationRequest.videoMimeType
,TransformationRequest.outputHeight
, andTransformationRequest.hdrMode
values set.
-
-