# TimestampWrapper

# TimestampWrapper

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/effect/TimestampWrapper "View this page in Java")

<br />

```
@UnstableApi
class TimestampWrapper : GlEffect
```

<br />

*** ** * ** ***

Applies a[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)from`startTimeUs`to`endTimeUs`, and no change on all other timestamps.

## Summary

|                                                                                                                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                                                                                                                  |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TimestampWrapper](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#TimestampWrapper(androidx.media3.effect.GlEffect,long,long))`(` ` glEffect: `[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)`!,` ` startTimeUs: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` endTimeUs: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Creates a new instance. |

|                                            ### Public functions                                             |
|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [isNoOp](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#isNoOp(int,int))`(inputWidth: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, inputHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns whether a[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)applies no change at every timestamp.                                             |
| [GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)`!` | [toGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#toGlShaderProgram(android.content.Context,boolean))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!, useHdr: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns a[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)that applies the effect. |

|                                     ### Public properties                                     |
|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                 | [endTimeUs](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#endTimeUs())     |
| [GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)`!` | [glEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#glEffect())       |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                 | [startTimeUs](https://developer.android.com/reference/kotlin/androidx/media3/effect/TimestampWrapper#startTimeUs()) |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.common.Effect](https://developer.android.com/reference/kotlin/androidx/media3/common/Effect) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [getDurationAfterEffectApplied](https://developer.android.com/reference/kotlin/androidx/media3/common/Effect#getDurationAfterEffectApplied(long))`(durationUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns the expected duration of the output stream when the effect is applied given a input`durationUs`. | |

## Public constructors

### TimestampWrapper

```
TimestampWrapper(
    glEffect: GlEffect!,
    startTimeUs: @IntRange(from = 0) Long,
    endTimeUs: @IntRange(from = 0) Long
)
```

Creates a new instance.  

|                                                                                            Parameters                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `glEffect: `[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)`!`                                                                                         | The[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)to apply, from`startTimeUs`to`endTimeUs`. This instance must not change the output dimensions. |
| `startTimeUs: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The time to begin applying`glEffect`on, in microseconds. Must be non-negative.                                                                                                              |
| `endTimeUs: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)   | The time to stop applying {code glEffect} on, in microseconds. Must be non-negative.                                                                                                        |

## Public functions

### isNoOp

```
fun isNoOp(inputWidth: Int, inputHeight: Int): Boolean
```

Returns whether a[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect)applies no change at every timestamp.

This can be used as a hint to skip this instance.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|------------------------------------|
| `inputWidth: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | The input frame width, in pixels.  |
| `inputHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The input frame height, in pixels. |

### toGlShaderProgram

```
fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!
```

Returns a[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)that applies the effect.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | A[Context](https://developer.android.com/reference/android/content/Context.html).                                                               |
| `useHdr: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether input textures come from an HDR source. If`true`, colors will be in linear RGB BT.2020. If`false`, colors will be in linear RGB BT.709. |

|                                                                           Throws                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| [androidx.media3.common.VideoFrameProcessingException](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException) | If an error occurs while creating the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram). |

## Public properties

### endTimeUs

```
val endTimeUs: Long
```  

### glEffect

```
val glEffect: GlEffect!
```  

### startTimeUs

```
val startTimeUs: Long
```