Package com.google.android.exoplayer2.effect

## Class GlEffectsFrameProcessor

- java.lang.Object
- - com.google.android.exoplayer2.effect.GlEffectsFrameProcessor

- All Implemented Interfaces:
    `FrameProcessor`

      public final class GlEffectsFrameProcessor
      extends Object
      implements FrameProcessor

  A `FrameProcessor` implementation that applies `GlEffect` instances using OpenGL on a background thread.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `GlEffectsFrameProcessor.Factory` | A factory for `GlEffectsFrameProcessor` instances.

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.util.FrameProcessor

      `FrameProcessor.Listener`

  - ### Field Summary

    - ### Fields inherited from interface com.google.android.exoplayer2.util.FrameProcessor

      `DROP_OUTPUT_FRAME, RELEASE_OUTPUT_FRAME_IMMEDIATELY`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Surface` | `getInputSurface()` | Returns the input `Surface`, where `FrameProcessor` consumes input frames from.
    `int` | `getPendingInputFrameCount()` | Returns the number of input frames that have been registered but not processed off the input surface yet.
    `void` | `registerInputFrame()` | Informs the `FrameProcessor` that a frame will be queued to its input surface.
    `void` | `release()` | Releases all resources.
    `void` | `releaseOutputFrame​(long releaseTimeNs)` | Releases the oldest unreleased output frame that has become available at the given `releaseTimeNs`.
    `void` | `setInputFrameInfo​(FrameInfo inputFrameInfo)` | Sets information about the input frames.
    `void` | `setOutputSurfaceInfo​(SurfaceInfo outputSurfaceInfo)` | Sets the output surface and supporting information.
    `void` | `signalEndOfInput()` | Informs the `FrameProcessor` that no further input frames should be accepted.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInputSurface

          public Surface getInputSurface()

      Description copied from interface: `FrameProcessor`
      Returns the input `Surface`, where `FrameProcessor` consumes input frames from.
      Specified by:
        `getInputSurface` in interface `FrameProcessor`

    - #### setInputFrameInfo

          public void setInputFrameInfo​(FrameInfo inputFrameInfo)

      Description copied from interface: `FrameProcessor`
      Sets information about the input frames.

      The new input information is applied from the next frame registered onwards.

      Pixels are expanded using the `FrameInfo.pixelWidthHeightRatio` so that the output frames' pixels have a ratio of 1.

      The caller should update `FrameInfo.streamOffsetUs` when switching input streams to ensure that frame timestamps are always monotonically increasing.

      Specified by:
        `setInputFrameInfo` in interface `FrameProcessor`

    - #### registerInputFrame

          public void registerInputFrame()

      Description copied from interface: `FrameProcessor`
      Informs the `FrameProcessor` that a frame will be queued to its input surface.

      Must be called before rendering a frame to the frame processor's input surface.

      Specified by:
        `registerInputFrame` in interface `FrameProcessor`

    - #### getPendingInputFrameCount

          public int getPendingInputFrameCount()

      Description copied from interface: `FrameProcessor`
      Returns the number of input frames that have been registered but not processed off the input surface yet.
      Specified by:
        `getPendingInputFrameCount` in interface `FrameProcessor`

    - #### setOutputSurfaceInfo

          public void setOutputSurfaceInfo​(@Nullable
                                           SurfaceInfo outputSurfaceInfo)

      Description copied from interface: `FrameProcessor`
      Sets the output surface and supporting information. When output frames are released and not dropped, they will be rendered to this output `SurfaceInfo`.

      The new output `SurfaceInfo` is applied from the next output frame rendered onwards. If the output `SurfaceInfo` is `null`, the `FrameProcessor` will stop rendering pending frames and resume rendering once a non-null `SurfaceInfo` is set.

      If the dimensions given in `SurfaceInfo` do not match the output size after applying the final effect the frames are resized before rendering to the surface and letter/pillar-boxing is applied.

      The caller is responsible for tracking the lifecycle of the `SurfaceInfo.surface` including calling this method with a new surface if it is destroyed. When this method returns, the previous output surface is no longer being used and can safely be released by the caller.

      Specified by:
        `setOutputSurfaceInfo` in interface `FrameProcessor`

    - #### releaseOutputFrame

          public void releaseOutputFrame​(long releaseTimeNs)

      Description copied from interface: `FrameProcessor`
      Releases the oldest unreleased output frame that has become available at the given `releaseTimeNs`.

      This will either render the output frame to the output surface, or drop the frame, per `releaseTimeNs`.

      This method must only be called if `releaseFramesAutomatically` was set to `false` using the `FrameProcessor.Factory` and should be called exactly once for each frame that becomes available.

      The `releaseTimeNs` may be passed to `EGLExt.eglPresentationTimeANDROID(android.opengl.EGLDisplay, android.opengl.EGLSurface, long)` depending on the implementation.

      Specified by:
        `releaseOutputFrame` in interface `FrameProcessor`
      Parameters:
        `releaseTimeNs` - The release time to use for the frame, in nanoseconds. The release time can be before of after the current system time. Use `FrameProcessor.DROP_OUTPUT_FRAME` to drop the frame, or `FrameProcessor.RELEASE_OUTPUT_FRAME_IMMEDIATELY` to release the frame immediately.

    - #### signalEndOfInput

          public void signalEndOfInput()

      Description copied from interface: `FrameProcessor`
      Informs the `FrameProcessor` that no further input frames should be accepted.
      Specified by:
        `signalEndOfInput` in interface `FrameProcessor`

    - #### release

          public void release()

      Description copied from interface: `FrameProcessor`
      Releases all resources.

      If the frame processor is released before it has ended, it will attempt to cancel processing any input frames that have already become available. Input frames that become available after release are ignored.

      This method blocks until all resources are released or releasing times out.

      Specified by:
        `release` in interface `FrameProcessor`