Agora Java API Reference for Android

Public Member Functions | Static Public Member Functions | List of all members
io.agora.base.TextureBufferHelper Class Reference

## Public Member Functions
Handler | getHandler ()
EglBase | getEglBase ()
VideoFrame.TextureBuffer | wrapTextureBuffer (int width, int height, VideoFrame.TextureBuffer.Type type, int id, Matrix transformMatrix)
VideoFrame.TextureBuffer | wrapTextureBuffer (int width, int height, VideoFrame.TextureBuffer.Type type, int id, long fenceObject, Matrix transformMatrix)
int | convertToRGBA (TextureBuffer buffer, int rotation)
ByteBuffer | parseAlphaData (TextureBuffer buffer, int rotation, boolean mirror)
boolean | isTextureInUse ()
void | dispose ()

## Static Public Member Functions
static TextureBufferHelper | create (final String threadName, final EglBase.Context sharedContext)

## Member Function Documentation

## ◆ create()

static TextureBufferHelper io.agora.base.TextureBufferHelper.create | ( | final String | threadName,
|  | final EglBase.Context | sharedContext
| ) |  |
| static

Construct a new TextureBufferHelper sharing OpenGL resources with |sharedContext|. A dedicated thread and handler is created for handling TextureBuffer. May return null if EGL fails to initialize a pixel buffer surface and make it current.

## ◆ getHandler()

Handler io.agora.base.TextureBufferHelper.getHandler | ( |  | ) |

Retrieve the handler. This handler is valid until dispose() is called.

## ◆ getEglBase()

EglBase io.agora.base.TextureBufferHelper.getEglBase | ( |  | ) |

Retrieve the EglBase instance. This EglBase instance is valid until dispose() is called.

## ◆ wrapTextureBuffer()

VideoFrame.TextureBuffer io.agora.base.TextureBufferHelper.wrapTextureBuffer | ( | int | width,
|  | int | height,
|  | VideoFrame.TextureBuffer.Type | type,
|  | int | id,
|  | Matrix | transformMatrix
| ) |  |

This can only be called from the |handler| thread.

## ◆ convertToRGBA()

int io.agora.base.TextureBufferHelper.convertToRGBA | ( | TextureBuffer | buffer,
|  | int | rotation
| ) |  |

This can only be called from the |handler| thread.

Parameters

  buffer | TextureBuffer with type of OES
  rotation | The angle of texture buffer should be rotated

Returns
  Texture id with RGBA format converted from OES buffer

## ◆ isTextureInUse()

boolean io.agora.base.TextureBufferHelper.isTextureInUse | ( |  | ) |

This can only be called from the |handler| thread.

## ◆ dispose()

void io.agora.base.TextureBufferHelper.dispose | ( |  | ) |

Call dispose() to stop receiving frames. OpenGL resources are released and the handler is stopped when the texture frame has been released.