PlaceholderSurface


@UnstableApi
public final class PlaceholderSurface extends Surface


A placeholder Surface.

Summary

Public fields

final boolean

Whether the surface is secure.

Public methods

synchronized static boolean

Returns whether the device supports secure placeholder surfaces.

static PlaceholderSurface
newInstance(Context context, boolean secure)

Returns a newly created placeholder surface.

static PlaceholderSurface
@InlineMe(replacement = "PlaceholderSurface.newInstance(context, secure)", imports = "androidx.media3.exoplayer.video.PlaceholderSurface")
newInstanceV17(Context context, boolean secure)

This method is deprecated.

Use newInstance instead.

void

Inherited Constants

From android.os.Parcelable
static final int
static final int
From android.view.Surface
static final int
static final int
static final Parcelable.Creator<Surface>
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From android.view.Surface
void
int
void
boolean
Canvas
lockCanvas(Rect inOutDirty)
Canvas
void
void
setFrameRate(
    float frameRate,
    int compatibility,
    int changeFrameRateStrategy
)
String
void

This method is deprecated.

void
void
writeToParcel(Parcel dest, int flags)

Public fields

secure

public final boolean secure

Whether the surface is secure.

Public methods

isSecureSupported

synchronized public static boolean isSecureSupported(Context context)

Returns whether the device supports secure placeholder surfaces.

Parameters
Context context

Any Context.

Returns
boolean

Whether the device supports secure placeholder surfaces.

newInstance

public static PlaceholderSurface newInstance(Context context, boolean secure)

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

Parameters
Context context

Any Context.

boolean secure

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.

newInstanceV17

@InlineMe(replacement = "PlaceholderSurface.newInstance(context, secure)", imports = "androidx.media3.exoplayer.video.PlaceholderSurface")
public static PlaceholderSurface newInstanceV17(Context context, boolean secure)

release

public void release()