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

# CameraFrameNumber

Artifact: [androidx.camera:camera-common](https://developer.android.com/jetpack/androidx/releases/camera.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/camera/common/CameraFrameNumber.kt+class:androidx.camera.common.CameraFrameNumber) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/camera.md.txt#1.7.0)

*** ** * ** ***


```
value public final class CameraFrameNumber
```

<br />

*** ** * ** ***

A strongly typed identifier for a camera frame.

A frame number is a unique, monotonically increasing identifier assigned to each frame produced by a camera device. Wrapping this in a value class prevents type confusion with other `Long` identifiers (such as timestamps, request IDs, or camera IDs) and enforces type safety at compile time.

As a `JvmInline` value class, it has zero runtime overhead when compiled, as the compiler replaces instances of this class with the underlying `Long` value where possible.

### Example

```
val frameNumber = CameraFrameNumber(42L)
println(frameNumber.value) // Prints: 42
println(frameNumber)       // Prints: Frame-42
```

| Throws |
|---|---|
| `IllegalArgumentException` | If `value` is negative. |

| See also |
|---|---|
| `frameNumber` |   |

## Summary

| ### Public constructors |
|---|
| `CameraFrameNumber(long value)` |

| ### Public methods |
|---|---|
| `final long` | `getValue()` The non-negative `Long` representing the frame identifier. |
| `@NonNull String` | `toString()` Returns a string representation of the frame number in the format "Frame-{value}". |

## Public constructors

### CameraFrameNumber

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/camera.md.txt#1.7.0)

```
public CameraFrameNumber(long value)
```

## Public methods

### getValue

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/camera.md.txt#1.7.0)

```
public final long getValue()
```

The non-negative `Long` representing the frame identifier.

### toString

```
public @NonNull String toString()
```

Returns a string representation of the frame number in the format "Frame-{value}".