mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix naming to reflect that CEA-708 is supported too
PiperOrigin-RevId: 312131816
This commit is contained in:
parent
be098401e9
commit
0de9c007af
@ -33,8 +33,8 @@ public final class CeaUtil {
|
||||
private static final int PROVIDER_CODE_DIRECTV = 0x2F;
|
||||
|
||||
/**
|
||||
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608 messages
|
||||
* as samples to all of the provided outputs.
|
||||
* Consumes the unescaped content of an SEI NAL unit, writing the content of any CEA-608/708
|
||||
* messages as samples to all of the provided outputs.
|
||||
*
|
||||
* @param presentationTimeUs The presentation time in microseconds for any samples.
|
||||
* @param seiBuffer The unescaped SEI NAL unit data, excluding the NAL unit start code and type.
|
||||
|
@ -171,7 +171,7 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
// Extractor output.
|
||||
private @MonotonicNonNull ExtractorOutput extractorOutput;
|
||||
private TrackOutput[] emsgTrackOutputs;
|
||||
private TrackOutput[] cea608TrackOutputs;
|
||||
private TrackOutput[] ceaTrackOutputs;
|
||||
|
||||
// Whether extractorOutput.seekMap has been called.
|
||||
private boolean haveOutputSeekMap;
|
||||
@ -576,12 +576,12 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
eventMessageTrackOutput.format(EMSG_FORMAT);
|
||||
}
|
||||
}
|
||||
if (cea608TrackOutputs == null) {
|
||||
cea608TrackOutputs = new TrackOutput[closedCaptionFormats.size()];
|
||||
for (int i = 0; i < cea608TrackOutputs.length; i++) {
|
||||
if (ceaTrackOutputs == null) {
|
||||
ceaTrackOutputs = new TrackOutput[closedCaptionFormats.size()];
|
||||
for (int i = 0; i < ceaTrackOutputs.length; i++) {
|
||||
TrackOutput output = extractorOutput.track(trackBundles.size() + 1 + i, C.TRACK_TYPE_TEXT);
|
||||
output.format(closedCaptionFormats.get(i));
|
||||
cea608TrackOutputs[i] = output;
|
||||
ceaTrackOutputs[i] = output;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1328,8 +1328,9 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
output.sampleData(nalStartCode, 4);
|
||||
// Write the NAL unit type byte.
|
||||
output.sampleData(nalPrefix, 1);
|
||||
processSeiNalUnitPayload = cea608TrackOutputs.length > 0
|
||||
&& NalUnitUtil.isNalUnitSei(track.format.sampleMimeType, nalPrefixData[4]);
|
||||
processSeiNalUnitPayload =
|
||||
ceaTrackOutputs.length > 0
|
||||
&& NalUnitUtil.isNalUnitSei(track.format.sampleMimeType, nalPrefixData[4]);
|
||||
sampleBytesWritten += 5;
|
||||
sampleSize += nalUnitLengthFieldLengthDiff;
|
||||
} else {
|
||||
@ -1345,7 +1346,7 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
// If the format is H.265/HEVC the NAL unit header has two bytes so skip one more byte.
|
||||
nalBuffer.setPosition(MimeTypes.VIDEO_H265.equals(track.format.sampleMimeType) ? 1 : 0);
|
||||
nalBuffer.setLimit(unescapedLength);
|
||||
CeaUtil.consume(sampleTimeUs, nalBuffer, cea608TrackOutputs);
|
||||
CeaUtil.consume(sampleTimeUs, nalBuffer, ceaTrackOutputs);
|
||||
} else {
|
||||
// Write the payload of the NAL unit.
|
||||
writtenBytes = output.sampleData(input, sampleCurrentNalBytesRemaining, false);
|
||||
|
@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import java.util.List;
|
||||
|
||||
/** Consumes SEI buffers, outputting contained CEA-608 messages to a {@link TrackOutput}. */
|
||||
/** Consumes SEI buffers, outputting contained CEA-608/708 messages to a {@link TrackOutput}. */
|
||||
public final class SeiReader {
|
||||
|
||||
private final List<Format> closedCaptionFormats;
|
||||
|
Loading…
x
Reference in New Issue
Block a user