Skip to content

Commit 0de9c00

Browse files
committed
Fix naming to reflect that CEA-708 is supported too
PiperOrigin-RevId: 312131816
1 parent be09840 commit 0de9c00

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

library/extractor/src/main/java/com/google/android/exoplayer2/extractor/CeaUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public final class CeaUtil {
3333
private static final int PROVIDER_CODE_DIRECTV = 0x2F;
3434

3535
/**
36-
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608 messages
37-
* as samples to all of the provided outputs.
36+
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608/708
37+
* messages as samples to all of the provided outputs.
3838
*
3939
* @param presentationTimeUs The presentation time in microseconds for any samples.
4040
* @param seiBuffer The unescaped SEI NAL unit data, excluding the NAL unit start code and type.

library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public class FragmentedMp4Extractor implements Extractor {
171171
// Extractor output.
172172
private @MonotonicNonNull ExtractorOutput extractorOutput;
173173
private TrackOutput[] emsgTrackOutputs;
174-
private TrackOutput[] cea608TrackOutputs;
174+
private TrackOutput[] ceaTrackOutputs;
175175

176176
// Whether extractorOutput.seekMap has been called.
177177
private boolean haveOutputSeekMap;
@@ -576,12 +576,12 @@ private void maybeInitExtraTracks() {
576576
eventMessageTrackOutput.format(EMSG_FORMAT);
577577
}
578578
}
579-
if (cea608TrackOutputs == null) {
580-
cea608TrackOutputs = new TrackOutput[closedCaptionFormats.size()];
581-
for (int i = 0; i < cea608TrackOutputs.length; i++) {
579+
if (ceaTrackOutputs == null) {
580+
ceaTrackOutputs = new TrackOutput[closedCaptionFormats.size()];
581+
for (int i = 0; i < ceaTrackOutputs.length; i++) {
582582
TrackOutput output = extractorOutput.track(trackBundles.size() + 1 + i, C.TRACK_TYPE_TEXT);
583583
output.format(closedCaptionFormats.get(i));
584-
cea608TrackOutputs[i] = output;
584+
ceaTrackOutputs[i] = output;
585585
}
586586
}
587587
}
@@ -1328,8 +1328,9 @@ private boolean readSample(ExtractorInput input) throws IOException {
13281328
output.sampleData(nalStartCode, 4);
13291329
// Write the NAL unit type byte.
13301330
output.sampleData(nalPrefix, 1);
1331-
processSeiNalUnitPayload = cea608TrackOutputs.length > 0
1332-
&& NalUnitUtil.isNalUnitSei(track.format.sampleMimeType, nalPrefixData[4]);
1331+
processSeiNalUnitPayload =
1332+
ceaTrackOutputs.length > 0
1333+
&& NalUnitUtil.isNalUnitSei(track.format.sampleMimeType, nalPrefixData[4]);
13331334
sampleBytesWritten += 5;
13341335
sampleSize += nalUnitLengthFieldLengthDiff;
13351336
} else {
@@ -1345,7 +1346,7 @@ private boolean readSample(ExtractorInput input) throws IOException {
13451346
// If the format is H.265/HEVC the NAL unit header has two bytes so skip one more byte.
13461347
nalBuffer.setPosition(MimeTypes.VIDEO_H265.equals(track.format.sampleMimeType) ? 1 : 0);
13471348
nalBuffer.setLimit(unescapedLength);
1348-
CeaUtil.consume(sampleTimeUs, nalBuffer, cea608TrackOutputs);
1349+
CeaUtil.consume(sampleTimeUs, nalBuffer, ceaTrackOutputs);
13491350
} else {
13501351
// Write the payload of the NAL unit.
13511352
writtenBytes = output.sampleData(input, sampleCurrentNalBytesRemaining, false);

library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/SeiReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import com.google.android.exoplayer2.util.ParsableByteArray;
2828
import java.util.List;
2929

30-
/** Consumes SEI buffers, outputting contained CEA-608 messages to a {@link TrackOutput}. */
30+
/** Consumes SEI buffers, outputting contained CEA-608/708 messages to a {@link TrackOutput}. */
3131
public final class SeiReader {
3232

3333
private final List<Format> closedCaptionFormats;

0 commit comments

Comments
 (0)