From bba1e9f24db90c77fa3426638cd6103430b3f41d Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 16 Feb 2018 21:04:48 -0800 Subject: MediaFormat: declare key for AAC decoder DRC effect type Bug: 71430241 Test: CTS AAC decoder test Change-Id: I077bdccf2b3ce935feaa6f14c75640d2f20affb7 --- api/current.txt | 1 + media/java/android/media/MediaFormat.java | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/api/current.txt b/api/current.txt index 63bc2ecaca13..66a1af1a6443 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23615,6 +23615,7 @@ package android.media { field public static final int COLOR_TRANSFER_ST2084 = 6; // 0x6 field public static final java.lang.String KEY_AAC_DRC_ATTENUATION_FACTOR = "aac-drc-cut-level"; field public static final java.lang.String KEY_AAC_DRC_BOOST_FACTOR = "aac-drc-boost-level"; + field public static final java.lang.String KEY_AAC_DRC_EFFECT_TYPE = "aac-drc-effect-type"; field public static final java.lang.String KEY_AAC_DRC_HEAVY_COMPRESSION = "aac-drc-heavy-compression"; field public static final java.lang.String KEY_AAC_DRC_TARGET_REFERENCE_LEVEL = "aac-target-ref-level"; field public static final java.lang.String KEY_AAC_ENCODED_TARGET_LEVEL = "aac-encoded-target-level"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index e9128e4c827d..b50aa477d511 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -87,6 +87,7 @@ import java.util.Map; * {@link #KEY_AAC_DRC_ATTENUATION_FACTOR}Integerdecoder-only, optional, if content is AAC audio, specifies the DRC attenuation factor. * {@link #KEY_AAC_DRC_HEAVY_COMPRESSION}Integerdecoder-only, optional, if content is AAC audio, specifies whether to use heavy compression. * {@link #KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT}Integerdecoder-only, optional, if content is AAC audio, specifies the maximum number of channels the decoder outputs. + * {@link #KEY_AAC_DRC_EFFECT_TYPE}Integerdecoder-only, optional, if content is AAC audio, specifies the DRC effect type to use. * {@link #KEY_CHANNEL_MASK}Integeroptional, a mask of audio channel assignments * {@link #KEY_FLAC_COMPRESSION_LEVEL}Integerencoder-only, optional, if content is FLAC audio, specifies the desired compression level. * @@ -511,6 +512,31 @@ public final class MediaFormat { */ public static final String KEY_AAC_DRC_TARGET_REFERENCE_LEVEL = "aac-target-ref-level"; + /** + * A key describing for selecting the DRC effect type for MPEG-D DRC. + * The supported values are defined in ISO/IEC 23003-4:2015 and are described as follows: + * + * + * + * + * + * + * + * + * + * + *
ValueEffect
-1Off
0None
1Late night
2Noisy environment
3Limited playback range
4Low playback level
5Dialog enhancement
6General compression
+ *

The value -1 (Off) disables DRC processing, while loudness normalization may still be + * active and dependent on KEY_AAC_DRC_TARGET_REFERENCE_LEVEL.
+ * The value 0 (None) automatically enables DRC processing if necessary to prevent signal + * clipping
+ * The value 6 (General compression) can be used for enabling MPEG-D DRC without particular + * DRC effect type request.
+ * The default is DRC effect type "None". + *

This key is only used during decoding. + */ + public static final String KEY_AAC_DRC_EFFECT_TYPE = "aac-drc-effect-type"; + /** * A key describing the target reference level that was assumed at the encoder for * calculation of attenuation gains for clipping prevention. This information can be provided -- cgit v1.2.3-59-g8ed1b