mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add mediaItem durationUs
to Transformer's ExportResult.ProcessedInput
This will allow us to access the duration of the input media items and collect them for metrics. PiperOrigin-RevId: 713686613
This commit is contained in:
parent
b225383958
commit
64462b99fc
@ -284,6 +284,9 @@ public final class ExportResult {
|
||||
/** The processed {@link MediaItem}. */
|
||||
public final MediaItem mediaItem;
|
||||
|
||||
/** The duration of the media item, in microseconds. */
|
||||
public final long durationUs;
|
||||
|
||||
/**
|
||||
* The name of the audio decoder used to process {@code mediaItem}. This field is {@code null}
|
||||
* if no audio decoder was used.
|
||||
@ -298,8 +301,12 @@ public final class ExportResult {
|
||||
|
||||
/** Creates an instance. */
|
||||
public ProcessedInput(
|
||||
MediaItem mediaItem, @Nullable String audioDecoderName, @Nullable String videoDecoderName) {
|
||||
MediaItem mediaItem,
|
||||
long durationUs,
|
||||
@Nullable String audioDecoderName,
|
||||
@Nullable String videoDecoderName) {
|
||||
this.mediaItem = mediaItem;
|
||||
this.durationUs = durationUs;
|
||||
this.audioDecoderName = audioDecoderName;
|
||||
this.videoDecoderName = videoDecoderName;
|
||||
}
|
||||
|
@ -191,7 +191,10 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
ImmutableMap<Integer, String> decoders = getDecoderNames();
|
||||
processedInputsBuilder.add(
|
||||
new ExportResult.ProcessedInput(
|
||||
mediaItem, decoders.get(C.TRACK_TYPE_AUDIO), decoders.get(C.TRACK_TYPE_VIDEO)));
|
||||
mediaItem,
|
||||
currentAssetDurationUs,
|
||||
decoders.get(C.TRACK_TYPE_AUDIO),
|
||||
decoders.get(C.TRACK_TYPE_VIDEO)));
|
||||
processedInputsSize++;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user