mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Use dumper.addIfNonDefault
in CapturingAudioSink
If encoded audio is dumped, some of these values may not be set. Also add a related TODO PiperOrigin-RevId: 740357230
This commit is contained in:
parent
6e510c26df
commit
4338355422
@ -145,6 +145,7 @@ public final class OggOpusPlaybackTest {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: b/406216855 - Remove this and use CapturingAudioSink instead.
|
||||
private static final class DumpingAudioSink extends ForwardingAudioSink
|
||||
implements Dumper.Dumpable {
|
||||
/** All handleBuffer interactions recorded with this audio sink. */
|
||||
|
@ -168,10 +168,11 @@ public class CapturingAudioSink extends ForwardingAudioSink implements Dumper.Du
|
||||
&& !inputFormat.sampleMimeType.equals(MimeTypes.AUDIO_RAW)) {
|
||||
dumper.add("mimeType", inputFormat.sampleMimeType);
|
||||
}
|
||||
|
||||
dumper
|
||||
.add("pcmEncoding", inputFormat.pcmEncoding)
|
||||
.add("channelCount", inputFormat.channelCount)
|
||||
.add("sampleRate", inputFormat.sampleRate);
|
||||
.addIfNonDefault("pcmEncoding", inputFormat.pcmEncoding, Format.NO_VALUE)
|
||||
.addIfNonDefault("channelCount", inputFormat.channelCount, Format.NO_VALUE)
|
||||
.addIfNonDefault("sampleRate", inputFormat.sampleRate, Format.NO_VALUE);
|
||||
if (outputChannels != null) {
|
||||
dumper.add("outputChannels", Arrays.toString(outputChannels));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user