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

Commit 31fd707a authored by Girish Shetty's avatar Girish Shetty Committed by Gerrit Code Review
Browse files

Merge "media: adding MediaFormat.KEY_IMPORTANCE" into main

parents 7522c845 39e5dad7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ aconfig_srcjars = [
    ":com.android.hardware.input-aconfig-java{.generated_srcjars}",
    ":com.android.text.flags-aconfig-java{.generated_srcjars}",
    ":com.android.net.flags-aconfig-java{.generated_srcjars}",
    ":aconfig_mediacodec_flags_java_lib{.generated_srcjars}",
]

filegroup {
+1 −0
Original line number Diff line number Diff line
@@ -23631,6 +23631,7 @@ package android.media {
    field public static final String KEY_HDR10_PLUS_INFO = "hdr10-plus-info";
    field public static final String KEY_HDR_STATIC_INFO = "hdr-static-info";
    field public static final String KEY_HEIGHT = "height";
    field @FlaggedApi("com.android.media.codec.flags.codec_importance") public static final String KEY_IMPORTANCE = "importance";
    field public static final String KEY_INTRA_REFRESH_PERIOD = "intra-refresh-period";
    field public static final String KEY_IS_ADTS = "is-adts";
    field public static final String KEY_IS_AUTOSELECT = "is-autoselect";
+31 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package android.media;

import static com.android.media.codec.flags.Flags.FLAG_CODEC_IMPORTANCE;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1635,6 +1638,34 @@ public final class MediaFormat {
     */
    public static final String KEY_ALLOW_FRAME_DROP = "allow-frame-drop";

    /**
     * A key describing the desired codec importance for the application.
     * <p>
     * The associated value is a positive integer including zero.
     * Higher value means lesser importance.
     * <p>
     * The resource manager may use the codec importance, along with other factors
     * when reclaiming codecs from an application.
     * The specifics of reclaim policy is device dependent, but specifying the codec importance,
     * will allow the resource manager to prioritize reclaiming less important codecs
     * (assigned higher values) from the (reclaim) requesting application first.
     * So, the codec importance is only relevant within the context of that application.
     * <p>
     * The codec importance can be set:
     * <ul>
     * <li>through {@link MediaCodec#configure}. </li>
     * <li>through {@link MediaCodec#setParameters} if the codec has been configured already,
     * which allows the users to change the codec importance multiple times.
     * </ul>
     * Any change/update in codec importance is guaranteed upon the completion of the function call
     * that sets the codec importance. So, in case of concurrent codec operations,
     * make sure to wait for the change in codec importance, before using another codec.
     * Note that unless specified, by default the codecs will have highest importance (of value 0).
     *
     */
    @FlaggedApi(FLAG_CODEC_IMPORTANCE)
    public static final String KEY_IMPORTANCE = "importance";

    /* package private */ MediaFormat(@NonNull Map<String, Object> map) {
        mMap = map;
    }