mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
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:
parent
a19f68c87e
commit
05e66d9cf6
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user