# SurfaceInfo

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

*** ** * ** ***


```
@UnstableApi
public final class SurfaceInfo
```

<br />

*** ** * ** ***

Immutable value class for a `https://developer.android.com/reference/android/view/Surface.html` and supporting information.

## Summary

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#height()` The height of frames rendered to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`, in pixels. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#isEncoderInputSurface()` Whether the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()` is an encoder input surface. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#orientationDegrees()` A counter-clockwise rotation to apply to frames before rendering them to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`. |
| `final https://developer.android.com/reference/android/view/Surface.html` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()` The `https://developer.android.com/reference/android/view/Surface.html`. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#width()` The width of frames rendered to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`, in pixels. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#SurfaceInfo(android.view.Surface,int,int)(https://developer.android.com/reference/android/view/Surface.html surface, int width, int height)` Creates a new instance. |
| `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#SurfaceInfo(android.view.Surface,int,int,int)( https://developer.android.com/reference/android/view/Surface.html surface, int width, int height, int orientationDegrees )` Creates a new instance. |
| `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#SurfaceInfo(android.view.Surface,int,int,int,boolean)( https://developer.android.com/reference/android/view/Surface.html surface, int width, int height, int orientationDegrees, boolean isEncoderInputSurface )` Creates a new instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#hashCode()()` |

## Public fields

### height

```
public final int height
```

The height of frames rendered to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`, in pixels.

### isEncoderInputSurface

```
public final boolean isEncoderInputSurface
```

Whether the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()` is an encoder input surface.

### orientationDegrees

```
public final int orientationDegrees
```

A counter-clockwise rotation to apply to frames before rendering them to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`.

Must be 0, 90, 180, or 270 degrees. Default is 0.

### surface

```
public final Surface surface
```

The `https://developer.android.com/reference/android/view/Surface.html`.

### width

```
public final int width
```

The width of frames rendered to the `https://developer.android.com/reference/androidx/media3/common/SurfaceInfo#surface()`, in pixels.

## Public constructors

### SurfaceInfo

```
public SurfaceInfo(Surface surface, int width, int height)
```

Creates a new instance.

### SurfaceInfo

```
public SurfaceInfo(
    Surface surface,
    int width,
    int height,
    int orientationDegrees
)
```

Creates a new instance.

### SurfaceInfo

```
public SurfaceInfo(
    Surface surface,
    int width,
    int height,
    int orientationDegrees,
    boolean isEncoderInputSurface
)
```

Creates a new instance.

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### hashCode

```
public int hashCode()
```