HwdecPolicy

sealed class HwdecPolicy

Whether to decode on a hardware device, and what to do when one is not available.

A backend applies this policy when it creates a video decoder. The policy controls whether hardware may be tried and whether a software fallback is legal; PlaybackStats.hardwareDecode reports what the decoder is actually using after open and after any runtime fallback.

Inheritors

Types

Link copied to clipboard
data object Auto : HwdecPolicy

Try hardware, fall back to software with a warning. The right default.

Link copied to clipboard
data object Off : HwdecPolicy

Never use hardware decoding.

Link copied to clipboard
data class Prefer(val order: List<HwdecKind>) : HwdecPolicy

Only these kinds, tried in this order.

Link copied to clipboard
data object Require : HwdecPolicy

Fail to open rather than fall back to software. For an application that must not decode 4K on a phone's CPU under any circumstances.