> Documentation index: https://developer.android.com/reference/llms.txt

# PlaceholderSurfaceInterface

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/video/PlaceholderSurfaceInterface.java+class:androidx.media3.exoplayer.video.PlaceholderSurfaceInterface)

*** ** * ** ***


```
@UnstableApi
interface PlaceholderSurfaceInterface
```

<br />

Known direct subclasses [PlaceholderSurface](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/PlaceholderSurface.md.txt)

|---|---|
| `PlaceholderSurface` | A placeholder `Surface`. |

*** ** * ** ***

A placeholder `Surface`.

## Summary

| ### Public functions |
|---|---|
| `Surface!` | `getSurface()` Returns the placeholder `Surface`. |
| `Boolean` | `isSecure()` Returns whether the placeholder surface is secure. |
| `java-static Boolean` | `isSecureSupported(context: Context!)` Returns whether the device supports secure placeholder surfaces. |
| `java-static PlaceholderSurfaceInterface!` | `newInstance(context: Context!, secure: Boolean)` Returns a newly created placeholder surface. |
| `Unit` | `release()` 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.