diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2f1ff63ecf..5b33bdb1ce 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -24,6 +24,8 @@ video track are available. The default value is `false` which means selecting a video track is prioritized. * Extractors: + * Add AV1C parsing to MP4 extractor + ([#692](https://github.com/androidx/media/pull/692)). * Audio: * Video: * Add workaround for a device issue on Galaxy Tab S7 FE, Chromecast with diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/AtomParsers.java b/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/AtomParsers.java index a41165f4b6..51bc19b239 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/AtomParsers.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/AtomParsers.java @@ -1243,9 +1243,8 @@ import java.util.List; Av1BitstreamParser parser = new Av1BitstreamParser(parent); if (parser.parseSequenceHeader() && parser.colorDescriptionPresentFlag == 1) { colorSpace = ColorInfo.isoColorPrimariesToColorSpace(parser.colorPrimaries); - colorTransfer = ColorInfo.isoTransferCharacteristicsToColorTransfer( - parser.transferCharacteristics - ); + colorTransfer = + ColorInfo.isoTransferCharacteristicsToColorTransfer(parser.transferCharacteristics); colorRange = (parser.colorRange == 1) ? C.COLOR_RANGE_FULL : C.COLOR_RANGE_LIMITED; } } else if (childAtomType == Atom.TYPE_clli) { @@ -2185,7 +2184,7 @@ import java.util.List; /** * Helper class for parsing syntax elements from AV1 bitstream. * - * Bitstream specification: https://aomediacodec.github.io/av1-spec/av1-spec.pdf + *
Bitstream specification: https://aomediacodec.github.io/av1-spec/av1-spec.pdf */ private static final class Av1BitstreamParser { private static final String TAG = "Av1BitstreamParser"; @@ -2208,9 +2207,8 @@ import java.util.List; /** * Parses a fixed-length unsigned number. * - * See AV1 bitstream spec 4.10.2. - * f(n): Unsigned n-bit number appearing directly in the bitstream. - * The bits are read from high to low order. + *
See AV1 bitstream spec 4.10.2. f(n): Unsigned n-bit number appearing directly in the + * bitstream. The bits are read from high to low order. * * @param length The length (in bits) of the number to decode. * @return Parsed unsigned number. @@ -2225,8 +2223,7 @@ import java.util.List; int newBitCount = min(length, bitCount); bitCount -= newBitCount; length -= newBitCount; - result = (result << newBitCount) | - ((currentByte >> bitCount) & ((1 << newBitCount) - 1)); + result = (result << newBitCount) | ((currentByte >> bitCount) & ((1 << newBitCount) - 1)); } return result; } @@ -2234,8 +2231,7 @@ import java.util.List; /** * Parses the AV1 sequence header. * - * See AV1 bitstream spec 5.5.1. - * This method can only be called once. + *
See AV1 bitstream spec 5.5.1. This method can only be called once. */ public boolean parseSequenceHeader() { if (parseSequenceHeaderCalled) {