mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Format with google-java-format
This commit is contained in:
parent
71673d65f3
commit
cfa7f1f0a7
2 changed files with 21 additions and 24 deletions
|
|
@ -51,8 +51,8 @@ public final class MpeghUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses an MHAS packet header. See ISO_IEC_23008-3;2022, 14.2.1, Table 222.
|
||||
* The reading position of {@code data} will be modified.
|
||||
* Parses an MHAS packet header. See ISO_IEC_23008-3;2022, 14.2.1, Table 222. The reading position
|
||||
* of {@code data} will be modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the MHAS packet header.
|
||||
* @return The {@link MhasPacketHeader} info.
|
||||
|
|
@ -97,7 +97,7 @@ public final class MpeghUtil {
|
|||
* The reading position of {@code data} will be modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the fields to obtain the sampling
|
||||
* rate from.
|
||||
* rate from.
|
||||
* @return The sampling frequency.
|
||||
* @throws ParserException if sampling frequency could not be obtained.
|
||||
*/
|
||||
|
|
@ -277,11 +277,10 @@ public final class MpeghUtil {
|
|||
|
||||
/**
|
||||
* Obtains the necessary info of the Mpegh3daConfig from an MPEG-H bit stream. See
|
||||
* ISO_IEC_23008-3;2022, 5.2.2.1, Table 15.
|
||||
* The reading position of {@code data} will be modified.
|
||||
* ISO_IEC_23008-3;2022, 5.2.2.1, Table 15. The reading position of {@code data} will be modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the payload of an Mpegh3daConfig
|
||||
* packet.
|
||||
* packet.
|
||||
* @return The {@link Mpegh3daConfig}.
|
||||
* @throws ParserException if a valid {@link Mpegh3daConfig} cannot be parsed.
|
||||
*/
|
||||
|
|
@ -337,11 +336,11 @@ public final class MpeghUtil {
|
|||
|
||||
/**
|
||||
* Obtains the number of truncated samples of the AudioTruncationInfo from an MPEG-H bit stream.
|
||||
* See ISO_IEC_23008-3;2022, 14.2.2, Table 225.
|
||||
* The reading position of {@code data} will be modified.
|
||||
* See ISO_IEC_23008-3;2022, 14.2.2, Table 225. The reading position of {@code data} will be
|
||||
* modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the payload of an AudioTruncation
|
||||
* packet.
|
||||
* packet.
|
||||
* @return The number of truncated samples.
|
||||
*/
|
||||
public static int parseAudioTruncationInfo(ParsableBitArray data) {
|
||||
|
|
@ -378,7 +377,7 @@ public final class MpeghUtil {
|
|||
* 5.2.2.2, Table 19. The reading position of {@code data} will be modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the Mpegh3daFlexibleSpeakerConfig
|
||||
* field.
|
||||
* field.
|
||||
*/
|
||||
private static void skipMpegh3daFlexibleSpeakerConfig(
|
||||
ParsableBitArray data, int numberOfSpeakers) {
|
||||
|
|
@ -545,8 +544,8 @@ public final class MpeghUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Skips the SbrConfig from an MPEG-H bit stream. See ISO_IEC_23003-3;2020, 5.2, Table 14.
|
||||
* The reading position of {@code data} will be modified.
|
||||
* Skips the SbrConfig from an MPEG-H bit stream. See ISO_IEC_23003-3;2020, 5.2, Table 14. The
|
||||
* reading position of {@code data} will be modified.
|
||||
*
|
||||
* @param data The data to parse, positioned at the start of the SbrConfig field.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -221,8 +221,7 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
* @param target The target into which data is to be read.
|
||||
* @param targetLength The target length of the read.
|
||||
*/
|
||||
private void copyData(
|
||||
ParsableByteArray source, ParsableByteArray target, int targetLength) {
|
||||
private void copyData(ParsableByteArray source, ParsableByteArray target, int targetLength) {
|
||||
int sourcePosition = source.getPosition();
|
||||
int bytesToRead = min(source.bytesLeft(), targetLength - target.getPosition());
|
||||
source.readBytes(target.getData(), target.getPosition(), bytesToRead);
|
||||
|
|
@ -261,8 +260,9 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** Parses the MHAS packet header.
|
||||
*
|
||||
/**
|
||||
* Parses the MHAS packet header.
|
||||
*
|
||||
* @throws ParserException if a valid {@link MpeghUtil.Mpegh3daConfig} cannot be parsed.
|
||||
*/
|
||||
private void parseHeader() throws ParserException {
|
||||
|
|
@ -304,8 +304,8 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
/**
|
||||
* Copies data to the data scratch buffer.
|
||||
*
|
||||
* @param data A {@link ParsableByteArray} from which to read the sample data. Its position
|
||||
* will not be changed.
|
||||
* @param data A {@link ParsableByteArray} from which to read the sample data. Its position will
|
||||
* not be changed.
|
||||
*/
|
||||
private void maybeCopyToDataScratchBuffer(ParsableByteArray data) {
|
||||
if (header.packetType == MpeghUtil.MhasPacketHeader.PACTYP_MPEGH3DACFG
|
||||
|
|
@ -328,8 +328,7 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
int bytesToRead;
|
||||
// read bytes from header scratch buffer and write them into the output
|
||||
if (headerScratchBytes.getPosition() != MpeghUtil.MAX_MHAS_PACKET_HEADER_SIZE) {
|
||||
bytesToRead =
|
||||
min(headerScratchBytes.bytesLeft(), header.packetLength - payloadBytesRead);
|
||||
bytesToRead = min(headerScratchBytes.bytesLeft(), header.packetLength - payloadBytesRead);
|
||||
output.sampleData(headerScratchBytes, bytesToRead);
|
||||
payloadBytesRead += bytesToRead;
|
||||
}
|
||||
|
|
@ -342,8 +341,8 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
/**
|
||||
* Parses the config and sets the output format.
|
||||
*
|
||||
* @param bitArray The data to parse, positioned at the start of the
|
||||
* {@link MpeghUtil.Mpegh3daConfig} field.
|
||||
* @param bitArray The data to parse, positioned at the start of the {@link
|
||||
* MpeghUtil.Mpegh3daConfig} field.
|
||||
* @throws ParserException if a valid {@link MpeghUtil.Mpegh3daConfig} cannot be parsed.
|
||||
*/
|
||||
private void parseConfig(ParsableBitArray bitArray) throws ParserException {
|
||||
|
|
@ -358,8 +357,7 @@ public final class MpeghReader implements ElementaryStreamReader {
|
|||
codecs += String.format(".%02X", config.profileLevelIndication);
|
||||
}
|
||||
@Nullable List<byte[]> initializationData = null;
|
||||
if (config.compatibleProfileLevelSet != null
|
||||
&& config.compatibleProfileLevelSet.length > 0) {
|
||||
if (config.compatibleProfileLevelSet != null && config.compatibleProfileLevelSet.length > 0) {
|
||||
// The first entry in initializationData is reserved for the audio specific
|
||||
// config.
|
||||
initializationData =
|
||||
|
|
|
|||
Loading…
Reference in a new issue