diff --git a/api/current.txt b/api/current.txt index 326ae6b54b0b0..2dfa2e54ce05d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -25986,6 +25986,7 @@ package android.media { 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"; + field public static final String KEY_CODECS_STRING = "codecs-string"; field public static final String KEY_COLOR_FORMAT = "color-format"; field public static final String KEY_COLOR_RANGE = "color-range"; field public static final String KEY_COLOR_STANDARD = "color-standard"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index f408ac344d7cf..f61d55ef2a30e 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -20,6 +20,8 @@ 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; @@ -45,6 +47,7 @@ import java.util.stream.Collectors; * * * + * * * * @@ -216,6 +219,15 @@ public final class MediaFormat { */ public static final String KEY_MIME = "mime"; + /** + * A key describing the codecs string of the MediaFormat. See RFC 6381 section 3.2 for the + * syntax of the value. The value does not hold {@link MediaCodec}-exposed codec names. + * The associated value is a string. + * + * @see MediaParser.TrackData#mediaFormat + */ + public static final String KEY_CODECS_STRING = "codecs-string"; + /** * An optional key describing the low latency decoding mode. This is an optional parameter * that applies only to decoders. If enabled, the decoder doesn't hold input and output
NameValue TypeDescription
{@link #KEY_MIME}StringThe type of the format.
{@link #KEY_CODECS_STRING}Stringoptional, the RFC 6381 codecs string of the MediaFormat
{@link #KEY_MAX_INPUT_SIZE}Integeroptional, maximum size of a buffer of input data
{@link #KEY_PIXEL_ASPECT_RATIO_WIDTH}Integeroptional, the pixel aspect ratio width
{@link #KEY_PIXEL_ASPECT_RATIO_HEIGHT}Integeroptional, the pixel aspect ratio height