package androidx.media3.extractor.ts; import androidx.media3.common.Format; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.ParsableByteArray; import androidx.media3.extractor.CeaUtil; import androidx.media3.extractor.ExtractorOutput; import androidx.media3.extractor.TrackOutput; import androidx.media3.extractor.ts.TsPayloadReader; import java.util.List; /* loaded from: classes2.dex */ public final class SeiReader { private final List closedCaptionFormats; private final TrackOutput[] outputs; public SeiReader(List list) { this.closedCaptionFormats = list; this.outputs = new TrackOutput[list.size()]; } public void createTracks(ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator trackIdGenerator) { for (int i = 0; i < this.outputs.length; i++) { trackIdGenerator.generateNewId(); TrackOutput track = extractorOutput.track(trackIdGenerator.getTrackId(), 3); Format format = this.closedCaptionFormats.get(i); String str = format.sampleMimeType; Assertions.checkArgument("application/cea-608".equals(str) || "application/cea-708".equals(str), "Invalid closed caption MIME type provided: " + str); track.format(new Format.Builder().setId(format.id != null ? format.id : trackIdGenerator.getFormatId()).setSampleMimeType(str).setSelectionFlags(format.selectionFlags).setLanguage(format.language).setAccessibilityChannel(format.accessibilityChannel).setInitializationData(format.initializationData).build()); this.outputs[i] = track; } } public void consume(long j, ParsableByteArray parsableByteArray) { CeaUtil.consume(j, parsableByteArray, this.outputs); } }