Updated to use ColorInfo.Builder() and formatting issues

This commit is contained in:
microkatz 2023-09-06 13:05:55 +00:00
parent bbcf37dc9e
commit d206be74ef
10 changed files with 79 additions and 102 deletions

View File

@ -22,6 +22,9 @@ import androidx.media3.common.util.Util;
import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.Arrays; import java.util.Arrays;
import org.checkerframework.dataflow.qual.Pure; import org.checkerframework.dataflow.qual.Pure;
// copybara:exo-only import com.google.android.exoplayer2.Bundleable;
// copybara:exo-only import com.google.android.exoplayer2.C;
// copybara:exo-only import com.google.android.exoplayer2.Format;
/** /**
* Stores color info. * Stores color info.
@ -320,11 +323,6 @@ public final class ColorInfo implements Bundleable {
* @see Format#toLogString(Format) * @see Format#toLogString(Format)
*/ */
public String toLogString() { public String toLogString() {
if (!isValid()) {
return "NA";
}
String bitdepthsString = isBitdepthValid() ? lumaBitdepth + "/" + chromaBitdepth : "NA";
String dataspaceString = String dataspaceString =
isDataSpaceValid() isDataSpaceValid()
? Util.formatInvariant( ? Util.formatInvariant(
@ -332,8 +330,9 @@ public final class ColorInfo implements Bundleable {
colorSpaceToString(colorSpace), colorSpaceToString(colorSpace),
colorRangeToString(colorRange), colorRangeToString(colorRange),
colorTransferToString(colorTransfer)) colorTransferToString(colorTransfer))
: "NA"; : "NA/NA/NA";
return bitdepthsString + "/" + dataspaceString; String bitdepthsString = isBitdepthValid() ? lumaBitdepth + "/" + chromaBitdepth : "NA/NA";
return dataspaceString + "/" + bitdepthsString;
} }
@Override @Override
@ -353,13 +352,24 @@ public final class ColorInfo implements Bundleable {
&& chromaBitdepth == other.chromaBitdepth; && chromaBitdepth == other.chromaBitdepth;
} }
@Override
public int hashCode() {
if (hashCode == 0) {
int result = 17;
result = 31 * result + colorSpace;
result = 31 * result + colorRange;
result = 31 * result + colorTransfer;
result = 31 * result + Arrays.hashCode(hdrStaticInfo);
result = 31 * result + lumaBitdepth;
result = 31 * result + chromaBitdepth;
hashCode = result;
}
return hashCode;
}
@Override @Override
public String toString() { public String toString() {
return "ColorInfo(" return "ColorInfo("
+ lumaBitdepthToString(lumaBitdepth)
+ ", "
+ chromaBitdepthToString(chromaBitdepth)
+ ", "
+ colorSpaceToString(colorSpace) + colorSpaceToString(colorSpace)
+ ", " + ", "
+ colorRangeToString(colorRange) + colorRangeToString(colorRange)
@ -367,6 +377,10 @@ public final class ColorInfo implements Bundleable {
+ colorTransferToString(colorTransfer) + colorTransferToString(colorTransfer)
+ ", " + ", "
+ (hdrStaticInfo != null) + (hdrStaticInfo != null)
+ ", "
+ lumaBitdepthToString(lumaBitdepth)
+ ", "
+ chromaBitdepthToString(chromaBitdepth)
+ ")"; + ")";
} }
@ -392,6 +406,7 @@ public final class ColorInfo implements Bundleable {
default: default:
return "Undefined color space"; return "Undefined color space";
} }
// LINT.ThenChange(C.java:color_space)
} }
private static String colorTransferToString(@C.ColorTransfer int colorTransfer) { private static String colorTransferToString(@C.ColorTransfer int colorTransfer) {
@ -414,6 +429,7 @@ public final class ColorInfo implements Bundleable {
default: default:
return "Undefined color transfer"; return "Undefined color transfer";
} }
// LINT.ThenChange(C.java:color_transfer)
} }
private static String colorRangeToString(@C.ColorRange int colorRange) { private static String colorRangeToString(@C.ColorRange int colorRange) {
@ -428,21 +444,7 @@ public final class ColorInfo implements Bundleable {
default: default:
return "Undefined color range"; return "Undefined color range";
} }
} // LINT.ThenChange(C.java:color_range)
@Override
public int hashCode() {
if (hashCode == 0) {
int result = 17;
result = 31 * result + colorSpace;
result = 31 * result + colorRange;
result = 31 * result + colorTransfer;
result = 31 * result + Arrays.hashCode(hdrStaticInfo);
result = 31 * result + lumaBitdepth;
result = 31 * result + chromaBitdepth;
hashCode = result;
}
return hashCode;
} }
// Bundleable implementation // Bundleable implementation

View File

@ -28,6 +28,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
// copybara:exo-only import com.google.android.exoplayer2.drm.DrmInitData;
// copybara:exo-only import com.google.android.exoplayer2.util.MimeTypes;
// copybara:exo-only import com.google.android.exoplayer2.video.ColorInfo;
// copybara:exo-only import com.google.android.exoplayer2.metadata.Metadata;
/** Unit test for {@link Format}. */ /** Unit test for {@link Format}. */
@RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class)

View File

@ -33,25 +33,18 @@ import java.util.Arrays;
public final class NalUnitUtil { public final class NalUnitUtil {
private static final String TAG = "NalUnitUtil"; private static final String TAG = "NalUnitUtil";
/** Coded slice of a non-IDR picture. */ /** Coded slice of a non-IDR picture. */
public static final int NAL_UNIT_TYPE_NON_IDR = 1; public static final int NAL_UNIT_TYPE_NON_IDR = 1;
/** Coded slice data partition A. */ /** Coded slice data partition A. */
public static final int NAL_UNIT_TYPE_PARTITION_A = 2; public static final int NAL_UNIT_TYPE_PARTITION_A = 2;
/** Coded slice of an IDR picture. */ /** Coded slice of an IDR picture. */
public static final int NAL_UNIT_TYPE_IDR = 5; public static final int NAL_UNIT_TYPE_IDR = 5;
/** Supplemental enhancement information. */ /** Supplemental enhancement information. */
public static final int NAL_UNIT_TYPE_SEI = 6; public static final int NAL_UNIT_TYPE_SEI = 6;
/** Sequence parameter set. */ /** Sequence parameter set. */
public static final int NAL_UNIT_TYPE_SPS = 7; public static final int NAL_UNIT_TYPE_SPS = 7;
/** Picture parameter set. */ /** Picture parameter set. */
public static final int NAL_UNIT_TYPE_PPS = 8; public static final int NAL_UNIT_TYPE_PPS = 8;
/** Access unit delimiter. */ /** Access unit delimiter. */
public static final int NAL_UNIT_TYPE_AUD = 9; public static final int NAL_UNIT_TYPE_AUD = 9;

View File

@ -51,7 +51,6 @@ import com.google.common.collect.ImmutableMap;
// Format specific parameter names. // Format specific parameter names.
private static final String PARAMETER_PROFILE_LEVEL_ID = "profile-level-id"; private static final String PARAMETER_PROFILE_LEVEL_ID = "profile-level-id";
private static final String PARAMETER_SPROP_PARAMS = "sprop-parameter-sets"; private static final String PARAMETER_SPROP_PARAMS = "sprop-parameter-sets";
private static final String PARAMETER_AMR_OCTET_ALIGN = "octet-align"; private static final String PARAMETER_AMR_OCTET_ALIGN = "octet-align";
private static final String PARAMETER_AMR_INTERLEAVING = "interleaving"; private static final String PARAMETER_AMR_INTERLEAVING = "interleaving";
private static final String PARAMETER_H265_SPROP_SPS = "sprop-sps"; private static final String PARAMETER_H265_SPROP_SPS = "sprop-sps";
@ -60,16 +59,12 @@ import com.google.common.collect.ImmutableMap;
private static final String PARAMETER_H265_SPROP_MAX_DON_DIFF = "sprop-max-don-diff"; private static final String PARAMETER_H265_SPROP_MAX_DON_DIFF = "sprop-max-don-diff";
private static final String PARAMETER_MP4A_CONFIG = "config"; private static final String PARAMETER_MP4A_CONFIG = "config";
private static final String PARAMETER_MP4A_C_PRESENT = "cpresent"; private static final String PARAMETER_MP4A_C_PRESENT = "cpresent";
/** Prefix for the RFC6381 codecs string for AAC formats. */ /** Prefix for the RFC6381 codecs string for AAC formats. */
private static final String AAC_CODECS_PREFIX = "mp4a.40."; private static final String AAC_CODECS_PREFIX = "mp4a.40.";
/** Prefix for the RFC6381 codecs string for AVC formats. */ /** Prefix for the RFC6381 codecs string for AVC formats. */
private static final String H264_CODECS_PREFIX = "avc1."; private static final String H264_CODECS_PREFIX = "avc1.";
/** Prefix for the RFC6416 codecs string for MPEG4V-ES formats. */ /** Prefix for the RFC6416 codecs string for MPEG4V-ES formats. */
private static final String MPEG4_CODECS_PREFIX = "mp4v."; private static final String MPEG4_CODECS_PREFIX = "mp4v.";
private static final String GENERIC_CONTROL_ATTR = "*"; private static final String GENERIC_CONTROL_ATTR = "*";
/** /**
@ -101,7 +96,6 @@ import com.google.common.collect.ImmutableMap;
* software VP8 decoder</a>. * software VP8 decoder</a>.
*/ */
private static final int DEFAULT_VP8_WIDTH = 320; private static final int DEFAULT_VP8_WIDTH = 320;
/** /**
* Default height for VP8. * Default height for VP8.
* *
@ -125,7 +119,6 @@ import com.google.common.collect.ImmutableMap;
* software VP9 decoder</a>. * software VP9 decoder</a>.
*/ */
private static final int DEFAULT_VP9_WIDTH = 320; private static final int DEFAULT_VP9_WIDTH = 320;
/** /**
* Default height for VP9. * Default height for VP9.
* *
@ -146,7 +139,6 @@ import com.google.common.collect.ImmutableMap;
* >Android's software H263 decoder</a>. * >Android's software H263 decoder</a>.
*/ */
private static final int DEFAULT_H263_WIDTH = 352; private static final int DEFAULT_H263_WIDTH = 352;
/** /**
* Default height for H263. * Default height for H263.
* *
@ -159,7 +151,6 @@ import com.google.common.collect.ImmutableMap;
/** The track's associated {@link RtpPayloadFormat}. */ /** The track's associated {@link RtpPayloadFormat}. */
public final RtpPayloadFormat payloadFormat; public final RtpPayloadFormat payloadFormat;
/** The track's URI. */ /** The track's URI. */
public final Uri uri; public final Uri uri;
@ -422,14 +413,13 @@ import com.google.common.collect.ImmutableMap;
formatBuilder.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio); formatBuilder.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio);
formatBuilder.setHeight(spsData.height); formatBuilder.setHeight(spsData.height);
formatBuilder.setWidth(spsData.width); formatBuilder.setWidth(spsData.width);
formatBuilder.setColorInfo( formatBuilder.setColorInfo(new ColorInfo.Builder()
new ColorInfo( .setColorSpace(spsData.colorSpace)
spsData.colorSpace, .setColorRange(spsData.colorRange)
spsData.colorRange, .setColorTransfer(spsData.colorTransfer)
spsData.colorTransfer, .setLumaBitdepth(spsData.bitDepthLumaMinus8 + 8)
null, .setChromaBitdepth(spsData.bitDepthChromaMinus8 + 8)
spsData.bitDepthLumaMinus8 + 8, .build());
spsData.bitDepthChromaMinus8 + 8));
@Nullable String profileLevel = fmtpAttributes.get(PARAMETER_PROFILE_LEVEL_ID); @Nullable String profileLevel = fmtpAttributes.get(PARAMETER_PROFILE_LEVEL_ID);
if (profileLevel != null) { if (profileLevel != null) {
@ -473,14 +463,13 @@ import com.google.common.collect.ImmutableMap;
spsNalDataWithStartCode, NAL_START_CODE.length, spsNalDataWithStartCode.length); spsNalDataWithStartCode, NAL_START_CODE.length, spsNalDataWithStartCode.length);
formatBuilder.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio); formatBuilder.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio);
formatBuilder.setHeight(spsData.height).setWidth(spsData.width); formatBuilder.setHeight(spsData.height).setWidth(spsData.width);
formatBuilder.setColorInfo( formatBuilder.setColorInfo(new ColorInfo.Builder()
new ColorInfo( .setColorSpace(spsData.colorSpace)
spsData.colorSpace, .setColorRange(spsData.colorRange)
spsData.colorRange, .setColorTransfer(spsData.colorTransfer)
spsData.colorTransfer, .setLumaBitdepth(spsData.bitDepthLumaMinus8 + 8)
null, .setChromaBitdepth(spsData.bitDepthChromaMinus8 + 8)
spsData.bitDepthLumaMinus8 + 8, .build());
spsData.bitDepthChromaMinus8 + 8));
formatBuilder.setCodecs( formatBuilder.setCodecs(
CodecSpecificDataUtil.buildHevcCodecString( CodecSpecificDataUtil.buildHevcCodecString(

View File

@ -26,6 +26,7 @@ import androidx.media3.container.NalUnitUtil;
import androidx.media3.container.NalUnitUtil.SpsData; import androidx.media3.container.NalUnitUtil.SpsData;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
// copybara:exo-only import com.google.android.exoplayer2.util.NalUnitUtil;
/** AVC configuration data. */ /** AVC configuration data. */
@UnstableApi @UnstableApi

View File

@ -25,6 +25,7 @@ import androidx.media3.common.util.UnstableApi;
import androidx.media3.container.NalUnitUtil; import androidx.media3.container.NalUnitUtil;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
// copybara:exo-only import com.google.android.exoplayer2.util.NalUnitUtil;
/** HEVC configuration data. */ /** HEVC configuration data. */
@UnstableApi @UnstableApi

View File

@ -94,7 +94,6 @@ public class MatroskaExtractor implements Extractor {
flag = true, flag = true,
value = {FLAG_DISABLE_SEEK_FOR_CUES}) value = {FLAG_DISABLE_SEEK_FOR_CUES})
public @interface Flags {} public @interface Flags {}
/** /**
* Flag to disable seeking for cues. * Flag to disable seeking for cues.
* *
@ -260,7 +259,6 @@ public class MatroskaExtractor implements Extractor {
* https://www.matroska.org/technical/codec_specs.html. * https://www.matroska.org/technical/codec_specs.html.
*/ */
private static final int BLOCK_ADD_ID_TYPE_DVCC = 0x64766343; private static final int BLOCK_ADD_ID_TYPE_DVCC = 0x64766343;
/** /**
* BlockAddIdType value for Dolby Vision configuration with profile > 7. See also * BlockAddIdType value for Dolby Vision configuration with profile > 7. See also
* https://www.matroska.org/technical/codec_specs.html. * https://www.matroska.org/technical/codec_specs.html.
@ -292,10 +290,8 @@ public class MatroskaExtractor implements Extractor {
49, 10, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48, 49, 10, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48,
48, 58, 48, 48, 44, 48, 48, 48, 10 48, 58, 48, 48, 44, 48, 48, 48, 10
}; };
/** The byte offset of the end timecode in {@link #SUBRIP_PREFIX}. */ /** The byte offset of the end timecode in {@link #SUBRIP_PREFIX}. */
private static final int SUBRIP_PREFIX_END_TIMECODE_OFFSET = 19; private static final int SUBRIP_PREFIX_END_TIMECODE_OFFSET = 19;
/** /**
* The value by which to divide a time in microseconds to convert it to the unit of the last value * The value by which to divide a time in microseconds to convert it to the unit of the last value
* in a subrip timecode (milliseconds). * in a subrip timecode (milliseconds).
@ -310,7 +306,6 @@ public class MatroskaExtractor implements Extractor {
Util.getUtf8Bytes( Util.getUtf8Bytes(
"Format: Start, End, " "Format: Start, End, "
+ "ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text"); + "ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
/** /**
* A template for the prefix that must be added to each SSA sample. * A template for the prefix that must be added to each SSA sample.
* *
@ -327,16 +322,13 @@ public class MatroskaExtractor implements Extractor {
68, 105, 97, 108, 111, 103, 117, 101, 58, 32, 48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44, 68, 105, 97, 108, 111, 103, 117, 101, 58, 32, 48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44,
48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44 48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44
}; };
/** The byte offset of the end timecode in {@link #SSA_PREFIX}. */ /** The byte offset of the end timecode in {@link #SSA_PREFIX}. */
private static final int SSA_PREFIX_END_TIMECODE_OFFSET = 21; private static final int SSA_PREFIX_END_TIMECODE_OFFSET = 21;
/** /**
* The value by which to divide a time in microseconds to convert it to the unit of the last value * The value by which to divide a time in microseconds to convert it to the unit of the last value
* in an SSA timecode (1/100ths of a second). * in an SSA timecode (1/100ths of a second).
*/ */
private static final long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10_000; private static final long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10_000;
/** The format of an SSA timecode. */ /** The format of an SSA timecode. */
private static final String SSA_TIMECODE_FORMAT = "%01d:%02d:%02d:%02d"; private static final String SSA_TIMECODE_FORMAT = "%01d:%02d:%02d:%02d";
@ -359,13 +351,11 @@ public class MatroskaExtractor implements Extractor {
/** The byte offset of the end timecode in {@link #VTT_PREFIX}. */ /** The byte offset of the end timecode in {@link #VTT_PREFIX}. */
private static final int VTT_PREFIX_END_TIMECODE_OFFSET = 25; private static final int VTT_PREFIX_END_TIMECODE_OFFSET = 25;
/** /**
* The value by which to divide a time in microseconds to convert it to the unit of the last value * The value by which to divide a time in microseconds to convert it to the unit of the last value
* in a VTT timecode (milliseconds). * in a VTT timecode (milliseconds).
*/ */
private static final long VTT_TIMECODE_LAST_VALUE_SCALING_FACTOR = 1000; private static final long VTT_TIMECODE_LAST_VALUE_SCALING_FACTOR = 1000;
/** The format of a VTT timecode. */ /** The format of a VTT timecode. */
private static final String VTT_TIMECODE_FORMAT = "%02d:%02d:%02d.%03d"; private static final String VTT_TIMECODE_FORMAT = "%02d:%02d:%02d.%03d";
@ -374,10 +364,8 @@ public class MatroskaExtractor implements Extractor {
/** Format tag indicating a WAVEFORMATEXTENSIBLE structure. */ /** Format tag indicating a WAVEFORMATEXTENSIBLE structure. */
private static final int WAVE_FORMAT_EXTENSIBLE = 0xFFFE; private static final int WAVE_FORMAT_EXTENSIBLE = 0xFFFE;
/** Format tag for PCM. */ /** Format tag for PCM. */
private static final int WAVE_FORMAT_PCM = 1; private static final int WAVE_FORMAT_PCM = 1;
/** Sub format for PCM. */ /** Sub format for PCM. */
private static final UUID WAVE_SUBFORMAT_PCM = new UUID(0x0100000000001000L, 0x800000AA00389B71L); private static final UUID WAVE_SUBFORMAT_PCM = new UUID(0x0100000000001000L, 0x800000AA00389B71L);
@ -1996,7 +1984,6 @@ public class MatroskaExtractor implements Extractor {
private static final int DISPLAY_UNIT_PIXELS = 0; private static final int DISPLAY_UNIT_PIXELS = 0;
private static final int MAX_CHROMATICITY = 50_000; // Defined in CTA-861.3. private static final int MAX_CHROMATICITY = 50_000; // Defined in CTA-861.3.
/** Default max content light level (CLL) that should be encoded into hdrStaticInfo. */ /** Default max content light level (CLL) that should be encoded into hdrStaticInfo. */
private static final int DEFAULT_MAX_CLL = 1000; // nits. private static final int DEFAULT_MAX_CLL = 1000; // nits.
@ -2308,14 +2295,14 @@ public class MatroskaExtractor implements Extractor {
@Nullable ColorInfo colorInfo = null; @Nullable ColorInfo colorInfo = null;
if (hasColorInfo) { if (hasColorInfo) {
@Nullable byte[] hdrStaticInfo = getHdrStaticInfo(); @Nullable byte[] hdrStaticInfo = getHdrStaticInfo();
colorInfo = colorInfo = new ColorInfo.Builder()
new ColorInfo( .setColorSpace(colorSpace)
colorSpace, .setColorRange(colorRange)
colorRange, .setColorTransfer(colorTransfer)
colorTransfer, .setHdrStaticInfo(hdrStaticInfo)
hdrStaticInfo, .setLumaBitdepth(bitsPerChannel)
bitsPerChannel, .setChromaBitdepth(bitsPerChannel)
bitsPerChannel); .build();
} }
int rotationDegrees = Format.NO_VALUE; int rotationDegrees = Format.NO_VALUE;

View File

@ -1225,7 +1225,6 @@ import java.util.List;
mimeType = MimeTypes.VIDEO_AV1; mimeType = MimeTypes.VIDEO_AV1;
parent.setPosition(childStartPosition + Atom.HEADER_SIZE); parent.setPosition(childStartPosition + Atom.HEADER_SIZE);
parent.skipBytes(1); parent.skipBytes(1);
; // marker(1), version(7)
int byte2 = parent.readUnsignedByte(); int byte2 = parent.readUnsignedByte();
int seqProfile = byte2 >> 5; int seqProfile = byte2 >> 5;
int byte3 = parent.readUnsignedByte(); int byte3 = parent.readUnsignedByte();
@ -1368,13 +1367,14 @@ import java.util.List;
// Note that if either mdcv or clli are missing, we leave the corresponding HDR static // Note that if either mdcv or clli are missing, we leave the corresponding HDR static
// metadata bytes with value zero. See [Internal ref: b/194535665]. // metadata bytes with value zero. See [Internal ref: b/194535665].
.setColorInfo( .setColorInfo(
new ColorInfo( new ColorInfo.Builder()
colorSpace, .setColorSpace(colorSpace)
colorRange, .setColorRange(colorRange)
colorTransfer, .setColorTransfer(colorTransfer)
hdrStaticInfo != null ? hdrStaticInfo.array() : null, .setHdrStaticInfo(hdrStaticInfo != null ? hdrStaticInfo.array() : null)
bitdepthLuma, .setLumaBitdepth(bitdepthLuma)
bitdepthChroma)); .setChromaBitdepth(bitdepthChroma)
.build());
if (esdsData != null) { if (esdsData != null) {
formatBuilder formatBuilder

View File

@ -221,13 +221,13 @@ public final class H264Reader implements ElementaryStreamReader {
.setWidth(spsData.width) .setWidth(spsData.width)
.setHeight(spsData.height) .setHeight(spsData.height)
.setColorInfo( .setColorInfo(
new ColorInfo( new ColorInfo.Builder()
spsData.colorSpace, .setColorSpace(spsData.colorSpace)
spsData.colorRange, .setColorRange(spsData.colorRange)
spsData.colorTransfer, .setColorTransfer(spsData.colorTransfer)
null, .setLumaBitdepth(spsData.bitDepthLumaMinus8 + 8)
spsData.bitDepthLumaMinus8 + 8, .setChromaBitdepth(spsData.bitDepthChromaMinus8 + 8)
spsData.bitDepthChromaMinus8 + 8)) .build())
.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio) .setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio)
.setInitializationData(initializationData) .setInitializationData(initializationData)
.build()); .build());

View File

@ -266,13 +266,13 @@ public final class H265Reader implements ElementaryStreamReader {
.setWidth(spsData.width) .setWidth(spsData.width)
.setHeight(spsData.height) .setHeight(spsData.height)
.setColorInfo( .setColorInfo(
new ColorInfo( new ColorInfo.Builder()
spsData.colorSpace, .setColorSpace(spsData.colorSpace)
spsData.colorRange, .setColorRange(spsData.colorRange)
spsData.colorTransfer, .setColorTransfer(spsData.colorTransfer)
null, .setLumaBitdepth(spsData.bitDepthLumaMinus8 + 8)
spsData.bitDepthLumaMinus8 + 8, .setChromaBitdepth(spsData.bitDepthChromaMinus8 + 8)
spsData.bitDepthChromaMinus8 + 8)) .build())
.setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio) .setPixelWidthHeightRatio(spsData.pixelWidthHeightRatio)
.setInitializationData(Collections.singletonList(csdData)) .setInitializationData(Collections.singletonList(csdData))
.build(); .build();