Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c08386e9 authored by Yushin Cho's avatar Yushin Cho Committed by Automerger Merge Worker
Browse files

Merge "enc stat: Add feauture and its keys to MediaCodec" am: 93f84575 am:...

Merge "enc stat: Add feauture and its keys to MediaCodec" am: 93f84575 am: fc102697 am: e7d1145f

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891583

Change-Id: I8b6d2be7809e82a3e655d91404c1c86548761b3c
parents b4687397 e7d1145f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -21964,6 +21964,7 @@ package android.media {
    field @Deprecated public static final int COLOR_TI_FormatYUV420PackedSemiPlanar = 2130706688; // 0x7f000100
    field public static final String FEATURE_AdaptivePlayback = "adaptive-playback";
    field public static final String FEATURE_DynamicTimestamp = "dynamic-timestamp";
    field public static final String FEATURE_EncodingStatistics = "encoding-statistics";
    field public static final String FEATURE_FrameParsing = "frame-parsing";
    field public static final String FEATURE_IntraRefresh = "intra-refresh";
    field public static final String FEATURE_LowLatency = "low-latency";
@@ -22738,6 +22739,7 @@ package android.media {
    field public static final String KEY_OPERATING_RATE = "operating-rate";
    field public static final String KEY_OUTPUT_REORDER_DEPTH = "output-reorder-depth";
    field public static final String KEY_PCM_ENCODING = "pcm-encoding";
    field public static final String KEY_PICTURE_TYPE = "picture-type";
    field public static final String KEY_PIXEL_ASPECT_RATIO_HEIGHT = "sar-height";
    field public static final String KEY_PIXEL_ASPECT_RATIO_WIDTH = "sar-width";
    field public static final String KEY_PREPEND_HEADER_TO_SYNC_FRAMES = "prepend-sps-pps-to-idr-frames";
@@ -22755,6 +22757,8 @@ package android.media {
    field public static final String KEY_TILE_HEIGHT = "tile-height";
    field public static final String KEY_TILE_WIDTH = "tile-width";
    field public static final String KEY_TRACK_ID = "track-id";
    field public static final String KEY_VIDEO_ENCODING_STATISTICS_LEVEL = "video-encoding-statistics-level";
    field public static final String KEY_VIDEO_QP_AVERAGE = "video-qp-average";
    field public static final String KEY_VIDEO_QP_B_MAX = "video-qp-b-max";
    field public static final String KEY_VIDEO_QP_B_MIN = "video-qp-b-min";
    field public static final String KEY_VIDEO_QP_I_MAX = "video-qp-i-max";
@@ -22799,12 +22803,18 @@ package android.media {
    field public static final String MIMETYPE_VIDEO_SCRAMBLED = "video/scrambled";
    field public static final String MIMETYPE_VIDEO_VP8 = "video/x-vnd.on2.vp8";
    field public static final String MIMETYPE_VIDEO_VP9 = "video/x-vnd.on2.vp9";
    field public static final int PICTURE_TYPE_B = 3; // 0x3
    field public static final int PICTURE_TYPE_I = 1; // 0x1
    field public static final int PICTURE_TYPE_P = 2; // 0x2
    field public static final int PICTURE_TYPE_UNKNOWN = 0; // 0x0
    field public static final int TYPE_BYTE_BUFFER = 5; // 0x5
    field public static final int TYPE_FLOAT = 3; // 0x3
    field public static final int TYPE_INTEGER = 1; // 0x1
    field public static final int TYPE_LONG = 2; // 0x2
    field public static final int TYPE_NULL = 0; // 0x0
    field public static final int TYPE_STRING = 4; // 0x4
    field public static final int VIDEO_ENCODING_STATISTICS_LEVEL_1 = 1; // 0x1
    field public static final int VIDEO_ENCODING_STATISTICS_LEVEL_NONE = 0; // 0x0
  }
  public final class MediaMetadata implements android.os.Parcelable {
+13 −0
Original line number Diff line number Diff line
@@ -602,6 +602,18 @@ public final class MediaCodecInfo {
        @SuppressLint("AllUpper")
        public static final String FEATURE_QpBounds = "qp-bounds";

        /**
         * <b>video encoder only</b>: codec supports exporting encoding statistics.
         * Encoders with this feature can provide the App clients with the encoding statistics
         * information about the frame.
         * The scope of encoding statistics is controlled by
         * {@link MediaFormat#KEY_VIDEO_ENCODING_STATISTICS_LEVEL}.
         *
         * @see MediaFormat#KEY_VIDEO_ENCODING_STATISTICS_LEVEL
         */
        @SuppressLint("AllUpper") // for consistency with other FEATURE_* constants
        public static final String FEATURE_EncodingStatistics = "encoding-statistics";

        /**
         * Query codec feature capabilities.
         * <p>
@@ -641,6 +653,7 @@ public final class MediaCodecInfo {
            new Feature(FEATURE_MultipleFrames, (1 << 1), false),
            new Feature(FEATURE_DynamicTimestamp, (1 << 2), false),
            new Feature(FEATURE_QpBounds, (1 << 3), false),
            new Feature(FEATURE_EncodingStatistics, (1 << 4), false),
            // feature to exclude codec from REGULAR codec list
            new Feature(FEATURE_SpecialCodec,     (1 << 30), false, true),
        };
+70 −0
Original line number Diff line number Diff line
@@ -1114,6 +1114,76 @@ public final class MediaFormat {
     */
    public static final String KEY_VIDEO_QP_B_MIN = "video-qp-b-min";

    /**
     * A key describing the level of encoding statistics information emitted from video encoder.
     *
     * The associated value is an integer.
     */
    public static final String KEY_VIDEO_ENCODING_STATISTICS_LEVEL =
            "video-encoding-statistics-level";

    /**
     * Encoding Statistics Level None.
     * Encoder generates no information about Encoding statistics.
     */
    public static final int VIDEO_ENCODING_STATISTICS_LEVEL_NONE = 0;

    /**
     * Encoding Statistics Level 1.
     * Encoder generates {@link MediaFormat#KEY_PICTURE_TYPE} and
     * {@link MediaFormat#KEY_VIDEO_QP_AVERAGE} for each frame.
     */
    public static final int VIDEO_ENCODING_STATISTICS_LEVEL_1 = 1;

    /** @hide */
    @IntDef({
        VIDEO_ENCODING_STATISTICS_LEVEL_NONE,
        VIDEO_ENCODING_STATISTICS_LEVEL_1,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface VideoEncodingStatisticsLevel {}

    /**
     * A key describing the per-frame average block QP (Quantization Parameter).
     * This is a part of a video 'Encoding Statistics' export feature.
     * This value is emitted from video encoder for a video frame.
     * The average value is rounded down (using floor()) to integer value.
     *
     * The associated value is an integer.
     */
    public static final String KEY_VIDEO_QP_AVERAGE = "video-qp-average";

    /**
     * A key describing the picture type of the encoded frame.
     * This is a part of a video 'Encoding Statistics' export feature.
     * This value is emitted from video encoder for a video frame.
     *
     * The associated value is an integer.
     */
    public static final String KEY_PICTURE_TYPE = "picture-type";

    /** Picture Type is unknown. */
    public static final int PICTURE_TYPE_UNKNOWN = 0;

    /** Picture Type is I Frame. */
    public static final int PICTURE_TYPE_I = 1;

    /** Picture Type is P Frame. */
    public static final int PICTURE_TYPE_P = 2;

    /** Picture Type is B Frame. */
    public static final int PICTURE_TYPE_B = 3;

    /** @hide */
    @IntDef({
        PICTURE_TYPE_UNKNOWN,
        PICTURE_TYPE_I,
        PICTURE_TYPE_P,
        PICTURE_TYPE_B,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface PictureType {}

    /**
     * A key describing the audio session ID of the AudioTrack associated
     * to a tunneled video codec.