Rate this page:

ICustomVideoSource

Interface that represents alternative video frame source for a call. The interface may be used to send video frames from alternative to camera video source.

Methods

release

Copy URL

void

release()

Releases the CustomVideoSource instance.

Returns

  • type:

    void

sendFrame

Copy URL

void

sendFrame(

byte[]

frame,

int

width,

int

height
)

Sends a video frame. The video frame should be in the I420 format.

Parameters

  • frame:

    byte[]

    Video frame in the I420 format

  • width:

    int

    Video frame width

  • height:

    int

    Video frame height

Returns

  • type:

    void

Throws

IllegalArgumentException if width and height do not match video frame width and height

sendFrame

Copy URL

void

sendFrame(

int

textureId,

int

width,

int

height
)

Sends a video frame. The texture should be in the RGB format.

Parameters

  • textureId:

    int

    RGB Texture handle

  • width:

    int

    Video frame width

  • height:

    int

    Video frame height

Returns

  • type:

    void

setCustomVideoSourceListener

Copy URL

void

setCustomVideoSourceListener(

ICustomVideoSourceListener

listener
)

Sets an ICustomVideoSourceListener to monitor its events.

Parameters

Returns

  • type:

    void

setSurfaceTextureHelper

Copy URL

void

setSurfaceTextureHelper(

SurfaceTextureHelper

helper
)

Sets a WebRTC SurfaceTextureHelper created externally on the application side.

SurfaceTextureHelper may be used to send video frames previously rendered to a surface, for example, from external implementation of android Camera and its preview.

SurfaceTextureHelper should be created with a shared ClientConfig.eglBase context.

This context is used for video encoding/decoding and video rendering.

Parameters

  • helper:

    SurfaceTextureHelper

    SurfaceTextureHelper instance

Returns

  • type:

    void