diff options
author | Andy Hung <hunga@google.com> | 2021-03-03 02:37:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-03 02:37:13 +0000 |
commit | 2c27a789023671e8cb6d598eb172e2b325dc2188 (patch) | |
tree | 37428d4dad569dd9733f8da50797ce07f9fcf615 /media/java | |
parent | 56b1b24940c0f0d57a262cd6bc9274117246f71f (diff) | |
parent | 9ff0a7375cca92e767fb3a2910d49453790e23d3 (diff) |
Merge "Add AudioMetadata keys related to active audio presentation"
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioMetadata.java | 55 | ||||
-rw-r--r-- | media/java/android/media/AudioPresentation.java | 58 |
2 files changed, 113 insertions, 0 deletions
diff --git a/media/java/android/media/AudioMetadata.java b/media/java/android/media/AudioMetadata.java index ff9fd4187272..ca175b4853a6 100644 --- a/media/java/android/media/AudioMetadata.java +++ b/media/java/android/media/AudioMetadata.java @@ -195,6 +195,61 @@ public final class AudioMetadata { @NonNull public static final Key<Integer> KEY_AUDIO_ENCODING = createKey("audio-encoding", Integer.class); + + /** + * A key representing the audio presentation id being decoded by a next generation + * audio decoder. + * + * An Integer value representing presentation id. + * + * @see AudioPresentation#getPresentationId() + */ + @NonNull public static final Key<Integer> KEY_PRESENTATION_ID = + createKey("presentation-id", Integer.class); + + /** + * A key representing the audio program id being decoded by a next generation + * audio decoder. + * + * An Integer value representing program id. + * + * @see AudioPresentation#getProgramId() + */ + @NonNull public static final Key<Integer> KEY_PROGRAM_ID = + createKey("program-id", Integer.class); + + + /** + * A key representing the audio presentation content classifier being rendered + * by a next generation audio decoder. + * + * An Integer value representing presentation content classifier. + * + * @see AudioPresentation.ContentClassifier + * One of {@link AudioPresentation#CONTENT_UNKNOWN}, + * {@link AudioPresentation#CONTENT_MAIN}, + * {@link AudioPresentation#CONTENT_MUSIC_AND_EFFECTS}, + * {@link AudioPresentation#CONTENT_VISUALLY_IMPAIRED}, + * {@link AudioPresentation#CONTENT_HEARING_IMPAIRED}, + * {@link AudioPresentation#CONTENT_DIALOG}, + * {@link AudioPresentation#CONTENT_COMMENTARY}, + * {@link AudioPresentation#CONTENT_EMERGENCY}, + * {@link AudioPresentation#CONTENT_VOICEOVER}. + */ + @NonNull public static final Key<Integer> KEY_PRESENTATION_CONTENT_CLASSIFIER = + createKey("presentation-content-classifier", Integer.class); + + /** + * A key representing the audio presentation language being rendered by a next + * generation audio decoder. + * + * A String value representing ISO 639-2 (three letter code). + * + * @see AudioPresentation#getLocale() + */ + @NonNull public static final Key<String> KEY_PRESENTATION_LANGUAGE = + createKey("presentation-language", String.class); + private Format() {} // delete constructor } diff --git a/media/java/android/media/AudioPresentation.java b/media/java/android/media/AudioPresentation.java index 894fbba6c983..47358be3e926 100644 --- a/media/java/android/media/AudioPresentation.java +++ b/media/java/android/media/AudioPresentation.java @@ -57,6 +57,64 @@ public final class AudioPresentation { /** @hide */ @IntDef( value = { + CONTENT_UNKNOWN, + CONTENT_MAIN, + CONTENT_MUSIC_AND_EFFECTS, + CONTENT_VISUALLY_IMPAIRED, + CONTENT_HEARING_IMPAIRED, + CONTENT_DIALOG, + CONTENT_COMMENTARY, + CONTENT_EMERGENCY, + CONTENT_VOICEOVER, + }) + + /** + * The ContentClassifier int definitions represent the AudioPresentation content + * classifier (as per TS 103 190-1 v1.2.1 4.3.3.8.1) + */ + @Retention(RetentionPolicy.SOURCE) + public @interface ContentClassifier {} + + /** + * Audio presentation classifier: Unknown. + */ + public static final int CONTENT_UNKNOWN = -1; + /** + * Audio presentation classifier: Complete main. + */ + public static final int CONTENT_MAIN = 0; + /** + * Audio presentation content classifier: Music and effects. + */ + public static final int CONTENT_MUSIC_AND_EFFECTS = 1; + /** + * Audio presentation content classifier: Visually impaired. + */ + public static final int CONTENT_VISUALLY_IMPAIRED = 2; + /** + * Audio presentation content classifier: Hearing impaired. + */ + public static final int CONTENT_HEARING_IMPAIRED = 3; + /** + * Audio presentation content classifier: Dialog. + */ + public static final int CONTENT_DIALOG = 4; + /** + * Audio presentation content classifier: Commentary. + */ + public static final int CONTENT_COMMENTARY = 5; + /** + * Audio presentation content classifier: Emergency. + */ + public static final int CONTENT_EMERGENCY = 6; + /** + * Audio presentation content classifier: Voice over. + */ + public static final int CONTENT_VOICEOVER = 7; + + /** @hide */ + @IntDef( + value = { MASTERING_NOT_INDICATED, MASTERED_FOR_STEREO, MASTERED_FOR_SURROUND, |