# TimestampAdjustmentShaderProgram

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/TimestampAdjustmentShaderProgram.java+class:androidx.media3.effect.TimestampAdjustmentShaderProgram)

*** ** * ** ***


```
@UnstableApi
public class TimestampAdjustmentShaderProgram implements GlShaderProgram
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use `EditedMediaItem.Builder#setSpeed(SpeedProvider)` instead.

Changes the frame timestamps using the `https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustment.TimestampMap`.

## Summary

| ### Public constructors |
|---|
| `[TimestampAdjustmentShaderProgram](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#TimestampAdjustmentShaderProgram(androidx.media3.effect.TimestampAdjustment.TimestampMap))( https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustment.TimestampMap timestampMap )` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `void` | `[flush](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#flush())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[queueInputFrame](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#queueInputFrame(androidx.media3.common.GlObjectsProvider,androidx.media3.common.GlTextureInfo,long))( https://developer.android.com/reference/androidx/media3/common/GlObjectsProvider glObjectsProvider, https://developer.android.com/reference/androidx/media3/common/GlTextureInfo inputTexture, long presentationTimeUs )` **This method is deprecated.** Deprecated in Java |
| `void` | `[release](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#release())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[releaseOutputFrame](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#releaseOutputFrame(androidx.media3.common.GlTextureInfo))(https://developer.android.com/reference/androidx/media3/common/GlTextureInfo outputTexture)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setErrorListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setErrorListener(java.util.concurrent.Executor,androidx.media3.effect.GlShaderProgram.ErrorListener))( https://developer.android.com/reference/java/util/concurrent/Executor.html executor, https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.ErrorListener errorListener )` **This method is deprecated.** Deprecated in Java |
| `void` | `[setInputListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setInputListener(androidx.media3.effect.GlShaderProgram.InputListener))(https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener inputListener)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setOutputListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setOutputListener(androidx.media3.effect.GlShaderProgram.OutputListener))(https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.OutputListener outputListener)` **This method is deprecated.** Deprecated in Java |
| `void` | `[signalEndOfCurrentInputStream](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#signalEndOfCurrentInputStream())()` **This method is deprecated.** Deprecated in Java |

## Public constructors

### TimestampAdjustmentShaderProgram

```
public [TimestampAdjustmentShaderProgram](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#TimestampAdjustmentShaderProgram(androidx.media3.effect.TimestampAdjustment.TimestampMap))(
    TimestampAdjustment.TimestampMap timestampMap
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

## Public methods

### flush

```
public void [flush](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#flush())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Flushes the `GlShaderProgram`.

The `GlShaderProgram` should reclaim the ownership of its allocated textures, `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener#onFlush()` its `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener` about the flush event, and `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener#onReadyToAcceptInputFrame()` if necessary.

The implementation must not `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.OutputListener#onOutputFrameAvailable(androidx.media3.common.GlTextureInfo,long)` until after this method returns.

### queueInputFrame

```
public void [queueInputFrame](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#queueInputFrame(androidx.media3.common.GlObjectsProvider,androidx.media3.common.GlTextureInfo,long))(
    GlObjectsProvider glObjectsProvider,
    GlTextureInfo inputTexture,
    long presentationTimeUs
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Processes an input frame if possible.

The `GlShaderProgram` owns the accepted frame until it calls `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener#onInputFrameProcessed(androidx.media3.common.GlTextureInfo)`. The caller should not overwrite or release the texture before the `GlShaderProgram` has finished processing it.

This method must only be called when the `GlShaderProgram` can `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener#onReadyToAcceptInputFrame()`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/GlObjectsProvider glObjectsProvider` | The `https://developer.android.com/reference/androidx/media3/common/GlObjectsProvider` for using EGL and GLES. |
| `https://developer.android.com/reference/androidx/media3/common/GlTextureInfo inputTexture` | A `https://developer.android.com/reference/androidx/media3/common/GlTextureInfo` describing the texture containing the input frame. |
| `long presentationTimeUs` | The presentation timestamp of the input frame, in microseconds. |

### release

```
public void [release](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#release())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Releases all resources.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessingException` | If an error occurs while releasing resources. |

### releaseOutputFrame

```
public void [releaseOutputFrame](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#releaseOutputFrame(androidx.media3.common.GlTextureInfo))(GlTextureInfo outputTexture)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Notifies the `GlShaderProgram` that the frame on the given output texture is no longer used and can be overwritten.

### setErrorListener

```
public void [setErrorListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setErrorListener(java.util.concurrent.Executor,androidx.media3.effect.GlShaderProgram.ErrorListener))(
    Executor executor,
    GlShaderProgram.ErrorListener errorListener
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.ErrorListener`.

The `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.ErrorListener` is invoked on the provided `https://developer.android.com/reference/java/util/concurrent/Executor.html`.

### setInputListener

```
public void [setInputListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setInputListener(androidx.media3.effect.GlShaderProgram.InputListener))(GlShaderProgram.InputListener inputListener)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener`.

The `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener` should be invoked on the thread that owns the parent OpenGL context. For example, `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor` invokes the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.InputListener` methods on its internal thread.

### setOutputListener

```
public void [setOutputListener](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#setOutputListener(androidx.media3.effect.GlShaderProgram.OutputListener))(GlShaderProgram.OutputListener outputListener)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.OutputListener`.

The `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.OutputListener` should be invoked on the thread that owns the parent OpenGL context. For example, `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor` invokes the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram.OutputListener` methods on its internal thread.

### signalEndOfCurrentInputStream

```
public void [signalEndOfCurrentInputStream](https://developer.android.com/reference/androidx/media3/effect/TimestampAdjustmentShaderProgram#signalEndOfCurrentInputStream())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Notifies the `GlShaderProgram` that no further input frames belonging to the current input stream will be queued.

Input frames that are queued after this method is called belong to a different input stream.