diff --git a/api/current.txt b/api/current.txt index 001d9b99fa8e3..5de5c8b8fd61c 100644 --- a/api/current.txt +++ b/api/current.txt @@ -14972,7 +14972,14 @@ package android.media { method public final void setInteger(java.lang.String, int); method public final void setLong(java.lang.String, long); method public final void setString(java.lang.String, java.lang.String); + 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_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"; + field public static final java.lang.String KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count"; field public static final java.lang.String KEY_AAC_PROFILE = "aac-profile"; + field public static final java.lang.String KEY_AAC_SBR_MODE = "aac-sbr-mode"; field public static final java.lang.String KEY_BITRATE_MODE = "bitrate-mode"; field public static final java.lang.String KEY_BIT_RATE = "bitrate"; field public static final java.lang.String KEY_CHANNEL_COUNT = "channel-count"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 16a2235a76102..e2825bb5fe9b1 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -65,6 +65,14 @@ import java.util.Map; *
This key is only used during encoding. + */ + public static final String KEY_AAC_SBR_MODE = "aac-sbr-mode"; + + /** + * A key describing the maximum number of channels that can be output by the AAC decoder. + * By default, the decoder will output the same number of channels as present in the encoded + * stream, if supported. Set this value to limit the number of output channels, and use + * the downmix information in the stream, if available. + *
Values larger than the number of channels in the content to decode are ignored. + *
This key is only used during decoding. + */ + public static final String KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count"; + + /** + * A key describing a gain to be applied so that the output loudness matches the + * Target Reference Level. This is typically used to normalize loudness across program items. + * The gain is derived as the difference between the Target Reference Level and the + * Program Reference Level. The latter can be given in the bitstream and indicates the actual + * loudness value of the program item. + *
The value is given as an integer value between + * 0 and 127, and is calculated as -0.25 * Target Reference Level in dBFS. + * Therefore, it represents the range of Full Scale (0 dBFS) to -31.75 dBFS. + *
This key is only used during decoding. + */ + public static final String KEY_AAC_DRC_TARGET_REFERENCE_LEVEL = "aac-target-ref-level"; + + /** + * 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 + * if it is known, otherwise a worst-case assumption is used. + *
The value is given as an integer value between + * 0 and 127, and is calculated as -0.25 * Target Reference Level in dBFS. + * Therefore, it represents the range of Full Scale (0 dBFS) to -31.75 dBFS. + * The default value is the worst-case assumption of 127. + *
The value is ignored when heavy compression is used (see + * {@link #KEY_AAC_DRC_HEAVY_COMPRESSION}). + *
This key is only used during decoding. + */ + public static final String KEY_AAC_ENCODED_TARGET_LEVEL = "aac-encoded-target-level"; + + /** + * A key describing the boost factor allowing to adapt the dynamics of the output to the + * actual listening requirements. This relies on DRC gain sequences that can be transmitted in + * the encoded bitstream to be able to reduce the dynamics of the output signal upon request. + * This factor enables the user to select how much of the gains are applied. + *
Positive gains (boost) and negative gains (attenuation, see + * {@link #KEY_AAC_DRC_ATTENUATION_FACTOR}) can be controlled separately for a better match + * to different use-cases. + *
Typically, attenuation gains are sent for loud signal segments, and boost gains are sent + * for soft signal segments. If the output is listened to in a noisy environment, for example, + * the boost factor is used to enable the positive gains, i.e. to amplify soft signal segments + * beyond the noise floor. But for listening late at night, the attenuation + * factor is used to enable the negative gains, to prevent loud signal from surprising + * the listener. In applications which generally need a low dynamic range, both the boost factor + * and the attenuation factor are used in order to enable all DRC gains. + *
In order to prevent clipping, it is also recommended to apply the attenuation factors + * in case of a downmix and/or loudness normalization to high target reference levels. + *
Both the boost and the attenuation factor parameters are given as integer values + * between 0 and 127, representing the range of the factor of 0 (i.e. don't apply) + * to 1 (i.e. fully apply boost/attenuation factors respectively). + *
This key is only used during decoding. + */ + public static final String KEY_AAC_DRC_BOOST_FACTOR = "aac-drc-boost-level"; + + /** + * A key describing the attenuation factor allowing to adapt the dynamics of the output to the + * actual listening requirements. + * See {@link #KEY_AAC_DRC_BOOST_FACTOR} for a description of the role of this attenuation + * factor and the value range. + *
This key is only used during decoding. + */ + public static final String KEY_AAC_DRC_ATTENUATION_FACTOR = "aac-drc-cut-level"; + + /** + * A key describing the selection of the heavy compression profile for DRC. + * Two separate DRC gain sequences can be transmitted in one bitstream: MPEG-4 DRC light + * compression, and DVB-specific heavy compression. When selecting the application of the heavy + * compression, one of the sequences is selected: + *
The default is light compression. + *
This key is only used during decoding. + */ + public static final String KEY_AAC_DRC_HEAVY_COMPRESSION = "aac-drc-heavy-compression"; + /** * A key describing the FLAC compression level to be used (FLAC audio format only). * The associated value is an integer ranging from 0 (fastest, least compression)