From be00432071c0a24b3e4d65a7921291660366f4f1 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Thu, 14 Jul 2016 19:54:50 -0700 Subject: [PATCH] media: clarify MediaFormat.KEY_I_FRAME_INTERVAL Bug: 30096321 Change-Id: I908b669caf5443fb272a2d274b7cbf7227913b3e --- media/java/android/media/MediaFormat.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index d7a18d97874db..c1412661c6492 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -49,7 +49,9 @@ import java.util.Map; * {@link #KEY_FRAME_RATE}Integer or Floatrequired for encoders, * optional for decoders * {@link #KEY_CAPTURE_RATE}Integer - * {@link #KEY_I_FRAME_INTERVAL}Integerencoder-only + * {@link #KEY_I_FRAME_INTERVAL}Integer (or Float)encoder-only, + * 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_MAX_WIDTH}Integerdecoder-only, optional, max-resolution width * {@link #KEY_MAX_HEIGHT}Integerdecoder-only, optional, max-resolution height @@ -258,9 +260,20 @@ public final class MediaFormat { public static final String KEY_CAPTURE_RATE = "capture-rate"; /** - * A key describing the frequency of I frames expressed in secs - * between I frames. - * The associated value is an integer. + * A key describing the frequency of key frames expressed in seconds between key frames. + *

+ * This key is used by video encoders. + * A negative value means no key frames are requested after the first frame. + * A zero value means a stream containing all key frames is requested. + *

+ * Most video encoders will convert this value of the number of non-key-frames between + * key-frames, using the {@linkplain #KEY_FRAME_RATE frame rate} information; therefore, + * if the actual frame rate differs (e.g. input frames are dropped or the frame rate + * changes), the time interval between key frames will not be the + * configured value. + *

+ * The associated value is an integer (or float since + * {@link android.os.Build.VERSION_CODES#N_MR1}). */ public static final String KEY_I_FRAME_INTERVAL = "i-frame-interval";