From 985bfbcc1dc582947a5142f84f7d9df27f4be454 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Thu, 15 Apr 2021 23:05:24 -0700 Subject: [PATCH] MediaFormat: Update constants for MPEG-H codecs Bug: 185842397 Test: atest MediaFormatTest Change-Id: I1f287ec9a1852a3c88ce3b3b22e8fb52add4f81c --- core/api/current.txt | 3 +++ media/java/android/media/MediaFormat.java | 33 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 2a16084f348ea..fa11a076bd16b 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -21404,6 +21404,9 @@ package android.media { field public static final String KEY_MAX_PTS_GAP_TO_ENCODER = "max-pts-gap-to-encoder"; field public static final String KEY_MAX_WIDTH = "max-width"; field public static final String KEY_MIME = "mime"; + field public static final String KEY_MPEGH_COMPATIBLE_SETS = "mpegh-compatible-sets"; + field public static final String KEY_MPEGH_PROFILE_LEVEL_INDICATION = "mpegh-profile-level-indication"; + field public static final String KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT = "mpegh-reference-channel-layout"; field public static final String KEY_OPERATING_RATE = "operating-rate"; field public static final String KEY_OUTPUT_REORDER_DEPTH = "output-reorder-depth"; field public static final String KEY_PCM_ENCODING = "pcm-encoding"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 1bfa9991e5d2f..13c690770f491 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -108,6 +108,15 @@ import java.util.stream.Collectors; * {@link #KEY_ENCODER_DELAY}Integeroptional, the number of frames to trim from the start of the decoded audio stream. * {@link #KEY_ENCODER_PADDING}Integeroptional, the number of frames to trim from the end of the decoded audio stream. * {@link #KEY_FLAC_COMPRESSION_LEVEL}Integerencoder-only, optional, if content is FLAC audio, specifies the desired compression level. + * {@link #KEY_MPEGH_PROFILE_LEVEL_INDICATION}Integer + * decoder-only, optional, if content is MPEG-H audio, + * specifies the profile and level of the stream. + * {@link #KEY_MPEGH_COMPATIBLE_SETS}ByteBuffer + * decoder-only, optional, if content is MPEG-H audio, + * specifies the compatible sets (profile and level) of the stream. + * {@link #KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT} + * Integerdecoder-only, optional, if content is MPEG-H audio, + * specifies the preferred reference channel layout of the stream. * * * Subtitle formats have the following keys: @@ -806,6 +815,30 @@ public final class MediaFormat { */ public static final String KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level"; + /** + * A key describing the MPEG-H stream profile-level indication. + * + * See ISO_IEC_23008-3;2019 MHADecoderConfigurationRecord mpegh3daProfileLevelIndication. + */ + public static final String KEY_MPEGH_PROFILE_LEVEL_INDICATION = + "mpegh-profile-level-indication"; + + /** + * A key describing the MPEG-H stream compatible sets. + * + * See FDAmd_2 of ISO_IEC_23008-3;2019 MHAProfileAndLevelCompatibilitySetBox. + */ + public static final String KEY_MPEGH_COMPATIBLE_SETS = "mpegh-compatible-sets"; + + /** + * A key describing the MPEG-H stream reference channel layout. + * + * See ISO_IEC_23008-3;2019 MHADecoderConfigurationRecord referenceChannelLayout + * and ISO_IEC_23001‐8 ChannelConfiguration value. + */ + public static final String KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT = + "mpegh-reference-channel-layout"; + /** * A key describing the encoding complexity. * The associated value is an integer. These values are device and codec specific,