Partager via


MediaFormat.KeyImportance Field

Definition

A key describing the desired codec importance for the application.

[Android.Runtime.Register("KEY_IMPORTANCE", ApiSince=35)]
public const string KeyImportance;
[<Android.Runtime.Register("KEY_IMPORTANCE", ApiSince=35)>]
val mutable KeyImportance : string

Field Value

Attributes

Remarks

A key describing the desired codec importance for the application.

The associated value is a positive integer including zero. Higher value means lesser importance.

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.

The codec importance can be set: <ul> <li>through MediaCodec#configure. </li> <li>through 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).

Java documentation for android.media.MediaFormat.KEY_IMPORTANCE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to