|Public Member Functions inherited from io.agora.rtc.mediaio.IVideoFrameConsumer|
|void||consumeByteBufferFrame (ByteBuffer buffer, int format, int width, int height, int rotation, long timestamp)|
|void||consumeByteArrayFrame (byte data, int format, int width, int height, int rotation, long timestamp)|
|void||consumeTextureFrame (int textureId, int format, int width, int height, int rotation, long timestamp, float matrix)|
The IVideoSink interface.
Defines a set of protocols to implement the custom video sink and pass it to the media engine to replace the default video sink. By default, when you try to enable real-time communications, the Agora SDK enables the default video sink to start video rendering. However, by calling setLocalVideoRenderer and setRemoteVideoRenderer, you can change the default video sink. The IVideoSink interface defines a set of protocols to create a customized video sink and pass it to the media engine to replace the default video renderer. Once you have implemented this interface, you will receive callbacks from the media engine indicating the state of the custom video sink and the underlying media engine and to enable their synchronization. Follow each callback to handle the resource allocation and to release and receive the video frame from the media engine.
Initializes the video sink.
This callback initializes the video sink. You can also initialize the video sink before this method is called and return true to the media engine in this method. You need to pass true or false in this method to tell the media engine if the video sink is initialized.
Enables the video sink.
This callback is triggered when the media engine starts streaming.
Stops the video sink.
This callback is triggered when the media engine stops video streaming. You should then stop the video sink.
Releases the video source.
This callback is triggered when the media engine wants to release the video sink.
Gets the EGLContextHandle.
This callback returns the native handle of the EGLContext if you are using OpenGL and have your own EGLContext. You can share your EGLContext using the Texture ID returned by the SDK in your own EGLContext. If you do not have an EGLContext, this callback returns 0; if the buffer type is set to Texture, the media engine will create an EGLContext internally and return the Texture ID.
Gets the buffer type.
This callback gets the buffer type of the video frame when it is being initialized. You need to specify one buffer type and then pass it to the media engine.
Gets the pixel format.
This callback gets the pixel format of the video frame when it is being initialized. You need to specify one pixel format and then pass it to the media engine.