From 590e248491f6b39cc13b431c25285fb9ce573225 Mon Sep 17 00:00:00 2001 From: Santiago Seifert Date: Mon, 9 Dec 2019 18:25:21 +0000 Subject: [PATCH] Add KEY_CAPTION_SERVICE_NUMBER to MediaFormat Bug: 132153067 Bug: 134057371 Test: Not applicable. Change-Id: I20eb77ad60f9e5e6cefd591ad168795ce0755b3f --- api/current.txt | 1 + media/java/android/media/MediaFormat.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index 4887c66660bbf..ded62ba48db47 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26126,6 +26126,7 @@ package android.media { field public static final String KEY_AUDIO_SESSION_ID = "audio-session-id"; field public static final String KEY_BITRATE_MODE = "bitrate-mode"; field public static final String KEY_BIT_RATE = "bitrate"; + field public static final String KEY_CAPTION_SERVICE_NUMBER = "caption-service-number"; field public static final String KEY_CAPTURE_RATE = "capture-rate"; field public static final String KEY_CHANNEL_COUNT = "channel-count"; field public static final String KEY_CHANNEL_MASK = "channel-mask"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 57405d762b76a..b57182e036751 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -20,8 +20,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; -import android.media.MediaCodec; -import android.media.MediaParser; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -116,6 +114,7 @@ import java.util.stream.Collectors; * * * + * *
{@link #KEY_MIME}StringThe type of the format.
{@link #KEY_LANGUAGE}StringThe language of the content.
{@link #KEY_CAPTION_SERVICE_NUMBER}intoptional, the closed-caption service or channel number.
* * Image formats have the following keys: @@ -244,6 +243,13 @@ public final class MediaFormat { */ public static final String KEY_LANGUAGE = "language"; + /** + * A key describing the closed caption service number. For CEA-608 caption tracks, holds the + * channel number. For CEA-708, holds the service number. + * The associated value is an int. + */ + public static final String KEY_CAPTION_SERVICE_NUMBER = "caption-service-number"; + /** * A key describing the sample rate of an audio format. * The associated value is an integer