Format with google-java-format

This commit is contained in:
Tianyi Feng 2023-05-16 10:49:00 +00:00
parent 424b5d8d0e
commit 47b0726ea9
3 changed files with 14 additions and 20 deletions

View File

@ -256,9 +256,7 @@ public final class C {
@UnstableApi public static final int ENCODING_DTS = AudioFormat.ENCODING_DTS;
/** See {@link AudioFormat#ENCODING_DTS_HD}. */
@UnstableApi public static final int ENCODING_DTS_HD = AudioFormat.ENCODING_DTS_HD;
/**
* TODO: To replace with AudioFormat.ENCODING_DTS_UHD_P2 when Android 14.0 is released.
*/
/** TODO: To replace with AudioFormat.ENCODING_DTS_UHD_P2 when Android 14.0 is released. */
@UnstableApi public static final int ENCODING_DTS_UHD_P2 = 0x0000001e;
/** See {@link AudioFormat#ENCODING_DOLBY_TRUEHD}. */
@UnstableApi public static final int ENCODING_DOLBY_TRUEHD = AudioFormat.ENCODING_DOLBY_TRUEHD;

View File

@ -57,7 +57,7 @@ public final class AudioCapabilities {
/** Encodings supported when the device specifies external surround sound. */
private static final int[] EXTERNAL_SURROUND_SOUND_ENCODINGS =
new int[]{
new int[] {
AudioFormat.ENCODING_PCM_16BIT, AudioFormat.ENCODING_AC3, AudioFormat.ENCODING_E_AC3
};
@ -116,19 +116,18 @@ public final class AudioCapabilities {
}
if (intent != null && intent.getIntExtra(AudioManager.EXTRA_AUDIO_PLUG_STATE, 0) == 1) {
supportedEncodings.addAll(Ints.asList(
intent.getIntArrayExtra(AudioManager.EXTRA_ENCODINGS)));
supportedEncodings.addAll(Ints.asList(intent.getIntArrayExtra(AudioManager.EXTRA_ENCODINGS)));
return new AudioCapabilities(
Ints.toArray(supportedEncodings.build()),
intent.getIntExtra(AudioManager.EXTRA_MAX_CHANNEL_COUNT, /* defaultValue= */
DEFAULT_MAX_CHANNEL_COUNT));
intent.getIntExtra(
AudioManager.EXTRA_MAX_CHANNEL_COUNT, /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT));
}
if (supportedEncodings.build().isEmpty()) {
return DEFAULT_AUDIO_CAPABILITIES;
} else {
return new AudioCapabilities(Ints.toArray(supportedEncodings.build()), /* defaultValue= */
DEFAULT_MAX_CHANNEL_COUNT);
return new AudioCapabilities(
Ints.toArray(supportedEncodings.build()), /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT);
}
}
@ -211,8 +210,8 @@ public final class AudioCapabilities {
if (encoding == C.ENCODING_E_AC3_JOC && !supportsEncoding(C.ENCODING_E_AC3_JOC)) {
// E-AC3 receivers support E-AC3 JOC streams (but decode only the base layer).
encoding = C.ENCODING_E_AC3;
} else if ((encoding == C.ENCODING_DTS_HD && !supportsEncoding(C.ENCODING_DTS_HD)) ||
(encoding == C.ENCODING_DTS_UHD_P2 && !supportsEncoding(C.ENCODING_DTS_UHD_P2))) {
} else if ((encoding == C.ENCODING_DTS_HD && !supportsEncoding(C.ENCODING_DTS_HD))
|| (encoding == C.ENCODING_DTS_UHD_P2 && !supportsEncoding(C.ENCODING_DTS_UHD_P2))) {
// DTS receivers support DTS-HD streams (but decode only the core layer).
encoding = C.ENCODING_DTS;
}
@ -411,9 +410,7 @@ public final class AudioCapabilities {
return 0;
}
/**
* Returns an array list of surround encodings that maybe supported.
*/
/** Returns an array list of surround encodings that maybe supported. */
@DoNotInline
private static int[] getAllSurroundEncodingsMaybeSupported() {
ImmutableList.Builder<Integer> encodings = new ImmutableList.Builder<>();

View File

@ -47,10 +47,10 @@ public final class DtsUtil {
*/
private static final int SYNC_EXT_SUB_LE = 0x25205864;
/**
* DTS FTOC Sync words (in different Endianness). See ETSI TS 103 491 (V1.2.1)
* Section 6.4.4.1.
* DTS FTOC Sync words (in different Endianness). See ETSI TS 103 491 (V1.2.1) Section 6.4.4.1.
*/
private static final int SYNC_FTOC_LE = 0xF21B4140;
private static final int SYNC_FTOC_NON_SYNC_LE = 0xE842C471;
private static final byte FIRST_BYTE_BE = (byte) (SYNC_VALUE_BE >>> 24);
private static final byte FIRST_BYTE_14B_BE = (byte) (SYNC_VALUE_14B_BE >>> 24);
@ -163,8 +163,7 @@ public final class DtsUtil {
// Check for DTS:X Profile 2 sync or non sync word and return
// 1024 if found. This is the only audio sample count that is used by DTS:X Streaming Encoder.
if ((buffer.getInt(0) == SYNC_FTOC_LE) ||
(buffer.getInt(0) == SYNC_FTOC_NON_SYNC_LE)) {
if ((buffer.getInt(0) == SYNC_FTOC_LE) || (buffer.getInt(0) == SYNC_FTOC_NON_SYNC_LE)) {
return 1024;
}