PlaceholderSurfaceInterface


@UnstableApi
interface PlaceholderSurfaceInterface

Known direct subclasses
PlaceholderSurface

A placeholder Surface.


A placeholder Surface.

Summary

Public functions

Surface!

Returns the placeholder Surface.

Boolean

Returns whether the placeholder surface is secure.

java-static Boolean

Returns whether the device supports secure placeholder surfaces.

java-static PlaceholderSurfaceInterface!
newInstance(context: Context!, secure: Boolean)

Returns a newly created placeholder surface.

Unit

Releases the placeholder surface and its underlying resources.

Public functions

getSurface

fun getSurface(): Surface!

Returns the placeholder Surface.

isSecure

fun isSecure(): Boolean

Returns whether the placeholder surface is secure.

isSecureSupported

java-static fun isSecureSupported(context: Context!): Boolean

Returns whether the device supports secure placeholder surfaces.

Parameters
context: Context!

Any Context.

Returns
Boolean

Whether the device supports secure placeholder surfaces.

newInstance

java-static fun newInstance(context: Context!, secure: Boolean): PlaceholderSurfaceInterface!

Returns a newly created placeholder surface. The placeholder must be released by calling release when it's no longer required.

When FLAG_IMAGE_READER_PLACEHOLDER_SURFACE is enabled on API 29+, non-secure placeholder surfaces are backed by an android.media.ImageReader instead of an EGL pbuffer surface. Secure placeholder surfaces always use the OpenGL-backed PlaceholderSurface because android.media.ImageReader requires USAGE_PROTECTED_CONTENT in its consumer usage bits to mark the surface as protected, which causes some OMX secure decoders to crash when pushing CPU-locked blank buffers to the placeholder surface on surface switch or shutdown.

Parameters
context: Context!

Any Context.

secure: Boolean

Whether a secure surface is required. Must only be requested if isSecureSupported returns true.

Throws
java.lang.IllegalStateException

If a secure surface is requested on a device for which isSecureSupported returns false.

release

fun release(): Unit

Releases the placeholder surface and its underlying resources.