Fix WrongConstant
lint failure for IamfDecoder#OUTPUT_PCM_ENCODING
To avoid `WrongConstant` failures with methods that expect `C.@PcmEncoding`, `OUTPUT_PCM_ENCODING` now points to the constant in `C` instead of `AudioFormat`. #cherrypick PiperOrigin-RevId: 670251463
This commit is contained in:
parent
4562c781ed
commit
ebb550a9f1
@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
public final class IamfDecoder
|
public final class IamfDecoder
|
||||||
extends SimpleDecoder<DecoderInputBuffer, SimpleDecoderOutputBuffer, IamfDecoderException> {
|
extends SimpleDecoder<DecoderInputBuffer, SimpleDecoderOutputBuffer, IamfDecoderException> {
|
||||||
/* package */ static final int OUTPUT_SAMPLE_RATE = 48000;
|
/* package */ static final int OUTPUT_SAMPLE_RATE = 48000;
|
||||||
/* package */ static final int OUTPUT_PCM_ENCODING = AudioFormat.ENCODING_PCM_16BIT;
|
/* package */ static final int OUTPUT_PCM_ENCODING = C.ENCODING_PCM_16BIT;
|
||||||
/* package */ static final int SPATIALIZED_OUTPUT_LAYOUT = AudioFormat.CHANNEL_OUT_5POINT1;
|
/* package */ static final int SPATIALIZED_OUTPUT_LAYOUT = AudioFormat.CHANNEL_OUT_5POINT1;
|
||||||
|
|
||||||
// Matches IAMF_SoundSystem in IAMF_defines.h
|
// Matches IAMF_SoundSystem in IAMF_defines.h
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.decoder.iamf;
|
package androidx.media3.decoder.iamf;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioFormat;
|
import android.media.AudioFormat;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
@ -84,6 +85,8 @@ public class LibiamfAudioRenderer extends DecoderAudioRenderer<IamfDecoder> {
|
|||||||
return "LibiamfAudioRenderer";
|
return "LibiamfAudioRenderer";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IamfDecoder#OUTPUT_PCM_ENCODING indirectly points to AudioFormat#ENCODING_PCM_16BIT.
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
private boolean isSpatializationSupported() {
|
private boolean isSpatializationSupported() {
|
||||||
// Spatializer is only available on API 32 and above.
|
// Spatializer is only available on API 32 and above.
|
||||||
if (Util.SDK_INT < 32) {
|
if (Util.SDK_INT < 32) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user