diff --git a/api/current.txt b/api/current.txt index b1d70c0ab7a7d..cf04eb755c33b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -22164,6 +22164,7 @@ package android.media { field public static final java.lang.String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle"; field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval"; field public static final java.lang.String KEY_LANGUAGE = "language"; + field public static final java.lang.String KEY_LATENCY = "latency"; field public static final java.lang.String KEY_LEVEL = "level"; field public static final java.lang.String KEY_MAX_HEIGHT = "max-height"; field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size"; diff --git a/api/system-current.txt b/api/system-current.txt index 924c79c9da180..b36da565fa3bc 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -23852,6 +23852,7 @@ package android.media { field public static final java.lang.String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle"; field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval"; field public static final java.lang.String KEY_LANGUAGE = "language"; + field public static final java.lang.String KEY_LATENCY = "latency"; field public static final java.lang.String KEY_LEVEL = "level"; field public static final java.lang.String KEY_MAX_HEIGHT = "max-height"; field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size"; diff --git a/api/test-current.txt b/api/test-current.txt index c8bd890e83b4e..a068b7ace4332 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -22260,6 +22260,7 @@ package android.media { field public static final java.lang.String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle"; field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval"; field public static final java.lang.String KEY_LANGUAGE = "language"; + field public static final java.lang.String KEY_LATENCY = "latency"; field public static final java.lang.String KEY_LEVEL = "level"; field public static final java.lang.String KEY_MAX_HEIGHT = "max-height"; field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 4791cf08dee26..e77c00b17365d 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -53,6 +53,7 @@ import java.util.Map; * time-interval between key frames. * Float support added in {@link android.os.Build.VERSION_CODES#N_MR1} * {@link #KEY_INTRA_REFRESH_PERIOD}Integerencoder-only, optional + * {@link #KEY_LATENCY}Integerencoder-only, optional * {@link #KEY_MAX_WIDTH}Integerdecoder-only, optional, max-resolution width * {@link #KEY_MAX_HEIGHT}Integerdecoder-only, optional, max-resolution height * {@link #KEY_REPEAT_PREVIOUS_FRAME_AFTER}Longencoder in surface-mode @@ -576,6 +577,18 @@ public final class MediaFormat { */ public static final String KEY_LEVEL = "level"; + /** + * An optional key describing the desired encoder latency in frames. This is an optional + * parameter that applies only to video encoders. If encoder supports it, it should ouput + * at least one output frame after being queued the specified number of frames. This key + * is ignored if the video encoder does not support the latency feature. Use the output + * format to verify that this feature was enabled and the actual value used by the encoder. + *

+ * If the key is not specified, the default latency will be implenmentation specific. + * The associated value is an integer. + */ + public static final String KEY_LATENCY = "latency"; + /** * A key describing the desired clockwise rotation on an output surface. * This key is only used when the codec is configured using an output surface.