Commit 03bb9140 by samrobinson Committed by christosts

Refactor `MuxerWrapper` handling of track details.

This brings together the multiple details about a muxer track, and
reduces the need for additional variables and more complicated track
tracking.

PiperOrigin-RevId: 499872145
parent 9835e914
...@@ -78,10 +78,10 @@ public interface Muxer { ...@@ -78,10 +78,10 @@ public interface Muxer {
} }
/** /**
* Adds a track with the specified format, and returns its index (to be passed in subsequent calls * Adds a track with the specified format.
* to {@link #writeSampleData(int, ByteBuffer, boolean, long)}).
* *
* @param format The {@link Format} of the track. * @param format The {@link Format} of the track.
* @return The index for this track, which should be passed to {@link #writeSampleData}.
* @throws MuxerException If the muxer encounters a problem while adding the track. * @throws MuxerException If the muxer encounters a problem while adding the track.
*/ */
int addTrack(Format format) throws MuxerException; int addTrack(Format format) throws MuxerException;
......
...@@ -465,7 +465,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -465,7 +465,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// MuxerWrapper.Listener implementation. // MuxerWrapper.Listener implementation.
@Override @Override
public void onTrackEnded(@C.TrackType int trackType, int averageBitrate, int sampleCount) { public void onTrackEnded(
@C.TrackType int trackType, Format format, int averageBitrate, int sampleCount) {
if (trackType == C.TRACK_TYPE_AUDIO) { if (trackType == C.TRACK_TYPE_AUDIO) {
transformationResultBuilder.setAverageAudioBitrate(averageBitrate); transformationResultBuilder.setAverageAudioBitrate(averageBitrate);
} else if (trackType == C.TRACK_TYPE_VIDEO) { } else if (trackType == C.TRACK_TYPE_VIDEO) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment