# CameraFrameNumber

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

*** ** * ** ***


```
value 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 `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.jvm/-jvm-inline/index.html` value class, it has zero runtime overhead when compiled, as the compiler replaces instances of this class with the underlying `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` value where possible.

### Example

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

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraFrameNumber#value()` is negative. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureResultWrapper#frameNumber()` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraFrameNumber#CameraFrameNumber(kotlin.Long)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraFrameNumber#toString()()` Returns a string representation of the frame number in the format "Frame-{value}". |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraFrameNumber#value()` The non-negative `Long` representing the frame identifier. |

## Public constructors

### CameraFrameNumber

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

```
CameraFrameNumber(value: Long)
```

## Public functions

### toString

```
open fun toString(): String
```

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

## Public properties

### value

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

```
val value: Long
```

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