diff --git a/api/current.txt b/api/current.txt index 723ffec5916b9..37173e49cdb78 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26238,6 +26238,7 @@ package android.media { field public static final String KEY_ROTATION = "rotation-degrees"; field public static final String KEY_SAMPLE_RATE = "sample-rate"; field public static final String KEY_SLICE_HEIGHT = "slice-height"; + field public static final String KEY_SLOW_MOTION_MARKERS = "slow-motion-markers"; field public static final String KEY_STRIDE = "stride"; field public static final String KEY_TEMPORAL_LAYERING = "ts-schema"; field public static final String KEY_TILE_HEIGHT = "tile-height"; diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 755bbfb943628..1a49b85403e44 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -20,10 +20,12 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; +import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.util.AbstractSet; import java.util.HashMap; import java.util.Iterator; @@ -435,6 +437,52 @@ public final class MediaFormat { */ public static final String KEY_CAPTURE_RATE = "capture-rate"; + /** + * A key for retrieving the slow-motion marker information associated with a video track. + *
+ * The associated value is a ByteBuffer in {@link ByteOrder#BIG_ENDIAN} + * (networking order) of the following format: + *
+ *
+ * float(32) playbackRate;
+ * unsigned int(32) numMarkers;
+ * for (i = 0;i < numMarkers; i++) {
+ * int(64) timestampUs;
+ * float(32) speedRatio;
+ * }
+ * The meaning of each field is as follows:
+ * | playbackRate | + *The frame rate at which the playback should happen (or the flattened + * clip should be). | + *
| numMarkers | + *The number of slow-motion markers that follows. | + *
| timestampUs | + *The starting point of a new segment. | + *
| speedRatio | + *The playback speed for that segment. The playback speed is a floating + * point number, indicating how fast the time progresses relative to that + * written in the container. (Eg. 4.0 means time goes 4x as fast, which + * makes 30fps become 120fps.) | + *
+ * The following constraints apply to the timestampUs of the markers: + *
+ *diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index 26a0ad917c99a..b13aa096b5df4 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -26196,6 +26196,7 @@ package android.media { field public static final String KEY_ROTATION = "rotation-degrees"; field public static final String KEY_SAMPLE_RATE = "sample-rate"; field public static final String KEY_SLICE_HEIGHT = "slice-height"; + field public static final String KEY_SLOW_MOTION_MARKERS = "slow-motion-markers"; field public static final String KEY_STRIDE = "stride"; field public static final String KEY_TEMPORAL_LAYERING = "ts-schema"; field public static final String KEY_TILE_HEIGHT = "tile-height";