Pass output media items's video size and frame count to MediaItemInfo

PiperOrigin-RevId: 722613631
This commit is contained in:
shahddaghash 2025-02-03 05:07:13 -08:00 committed by Copybara-Service
parent 4ed9abd05b
commit 35d5bd9675

View File

@ -308,6 +308,16 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
if (exportResult.durationMs != C.TIME_UNSET) { if (exportResult.durationMs != C.TIME_UNSET) {
mediaItemInfoBuilder.setDurationMillis(exportResult.durationMs); mediaItemInfoBuilder.setDurationMillis(exportResult.durationMs);
} }
mediaItemInfoBuilder.setVideoSampleCount(exportResult.videoFrameCount);
Size videoSize =
new Size(
exportResult.width != C.LENGTH_UNSET
? exportResult.width
: MediaItemInfo.VALUE_UNSPECIFIED,
exportResult.height != C.LENGTH_UNSET
? exportResult.height
: MediaItemInfo.VALUE_UNSPECIFIED);
mediaItemInfoBuilder.setVideoSize(videoSize);
if (exportResult.colorInfo != null) { if (exportResult.colorInfo != null) {
mediaItemInfoBuilder.setVideoDataSpace(getVideoDataSpace(exportResult.colorInfo)); mediaItemInfoBuilder.setVideoDataSpace(getVideoDataSpace(exportResult.colorInfo));
} }