Make NalUnitTargetBuffer public

This class is a useful utility for custom TS parsers that operate
on NAL units.

PiperOrigin-RevId: 664795988
This commit is contained in:
tonihei 2024-08-19 07:20:06 -07:00 committed by Copybara-Service
parent cd0a7e1143
commit ba00798451

View File

@ -16,13 +16,15 @@
package androidx.media3.extractor.ts; package androidx.media3.extractor.ts;
import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.UnstableApi;
import java.util.Arrays; import java.util.Arrays;
/** /**
* A buffer that fills itself with data corresponding to a specific NAL unit, as it is encountered * A buffer that fills itself with data corresponding to a specific NAL unit, as it is encountered
* in the stream. * in the stream.
*/ */
/* package */ final class NalUnitTargetBuffer { @UnstableApi
public final class NalUnitTargetBuffer {
private final int targetType; private final int targetType;
@ -32,6 +34,12 @@ import java.util.Arrays;
public byte[] nalData; public byte[] nalData;
public int nalLength; public int nalLength;
/**
* Creates the buffer.
*
* @param targetType The type of the NAL unit.
* @param initialCapacity The initial capacity of the buffer in bytes.
*/
public NalUnitTargetBuffer(int targetType, int initialCapacity) { public NalUnitTargetBuffer(int targetType, int initialCapacity) {
this.targetType = targetType; this.targetType = targetType;