Fix metrics codec names collection

Previously, the codec names for the input were collected from `Format.codecs` which return the RFC 6381 string not the codec name used. This was changed to retain the decoder name from `ProcessedInput` instead.

PiperOrigin-RevId: 723129667
This commit is contained in:
shahddaghash 2025-02-04 10:02:37 -08:00 committed by Copybara-Service
parent a19f68c87e
commit 05e66d9cf6

View File

@ -256,6 +256,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
MediaItemInfo.Builder mediaItemInfoBuilder = new MediaItemInfo.Builder();
long durationMs = usToMs(processedInput.durationUs);
mediaItemInfoBuilder.setClipDurationMillis(durationMs);
if (processedInput.videoDecoderName != null) {
mediaItemInfoBuilder.addCodecName(processedInput.videoDecoderName);
}
if (processedInput.audioDecoderName != null) {
mediaItemInfoBuilder.addCodecName(processedInput.audioDecoderName);
}
@Nullable Format videoFormat = processedInput.videoFormat;
if (videoFormat != null) {
if (videoFormat.containerMimeType != null) {
@ -264,9 +270,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
if (videoFormat.sampleMimeType != null) {
mediaItemInfoBuilder.addSampleMimeType(videoFormat.sampleMimeType);
}
if (videoFormat.codecs != null) {
mediaItemInfoBuilder.addCodecName(videoFormat.codecs);
}
if (videoFormat.frameRate != Format.NO_VALUE) {
mediaItemInfoBuilder.setVideoFrameRate(videoFormat.frameRate);
}
@ -288,9 +291,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
if (audioFormat.sampleMimeType != null) {
mediaItemInfoBuilder.addSampleMimeType(audioFormat.sampleMimeType);
}
if (audioFormat.codecs != null) {
mediaItemInfoBuilder.addCodecName(audioFormat.codecs);
}
if (audioFormat.channelCount != Format.NO_VALUE) {
mediaItemInfoBuilder.setAudioChannelCount(audioFormat.channelCount);
}