EncoderNotUsePersistentInputSurfaceQuirk

@RequiresApi(21) open class EncoderNotUsePersistentInputSurfaceQuirk : Quirk
kotlin.Any
   ↳ androidx.camera.video.internal.compat.quirk.EncoderNotUsePersistentInputSurfaceQuirk

Quirk denotes that the encoder should create new input surface for every encoding instead of using MediaCodec#createPersistentInputSurface().

MediaCodec#createPersistentInputSurface() is introduced on API 23, which creates a reusable surface for multiple encodings and is the suggested approach. So for devices with API 21 and 22, a new surface has to be created for every encoding instead.

As describe in b/202798966, there is a device that has API 23+, but the recorded video is abnormal if using MediaCodec#createPersistentInputSurface(). Creating a new surface for new recording resolve the issue, hence this quirk is also applied to the problematic devices.

Summary

Public constructors

Quirk denotes that the encoder should create new input surface for every encoding instead of using MediaCodec#createPersistentInputSurface().

Public constructors

EncoderNotUsePersistentInputSurfaceQuirk

EncoderNotUsePersistentInputSurfaceQuirk()

Quirk denotes that the encoder should create new input surface for every encoding instead of using MediaCodec#createPersistentInputSurface().

MediaCodec#createPersistentInputSurface() is introduced on API 23, which creates a reusable surface for multiple encodings and is the suggested approach. So for devices with API 21 and 22, a new surface has to be created for every encoding instead.

As describe in b/202798966, there is a device that has API 23+, but the recorded video is abnormal if using MediaCodec#createPersistentInputSurface(). Creating a new surface for new recording resolve the issue, hence this quirk is also applied to the problematic devices.