Server Gateway SDK v3.7.200.21 for Linux Java
Public Member Functions | List of all members
io.agora.rtc.IVideoFrameObserver Interface Reference

Public Member Functions

int onPreEncodeVideoFrame (AgoraVideoFrameObserver agora_video_frame_observer, VideoFrame frame)
 
int onRenderVideoFrame (AgoraVideoFrameObserver agora_video_frame_observer, String channel_id, int uid, VideoFrame frame)
 

Detailed Description

The IVideoFrameObserver class.

Member Function Documentation

◆ onPreEncodeVideoFrame()

int io.agora.rtc.IVideoFrameObserver.onPreEncodeVideoFrame ( AgoraVideoFrameObserver  agora_video_frame_observer,
VideoFrame  frame 
)

Occurs each time the SDK receives a video frame before encoding.

After you successfully register the video frame observer, the SDK triggers this callback each time when it receives a video frame. In this callback, you can get the video data before encoding. You can then process the data according to your particular scenarios.

After processing, you can send the processed video data back to the SDK by setting the videoFrame parameter in this callback.

The video data that this callback gets has been pre-processed, with its content cropped, rotated, and the image enhanced.

Parameters
agora_video_frame_observerAn AgoraVideoFrameObserver object.
frameThe video frame.
Returns
Whether to ignore the current video frame if the pre-processing fails:
  • 0: Do not ignore.
  • 1: Ignore, in which case this method does not sent the current video frame to the SDK.

◆ onRenderVideoFrame()

int io.agora.rtc.IVideoFrameObserver.onRenderVideoFrame ( AgoraVideoFrameObserver  agora_video_frame_observer,
String  channel_id,
int  uid,
VideoFrame  frame 
)

Occurs each time the SDK receives a video frame sent by the remote user.

After you successfully register the video frame observer, the SDK triggers this callback each time a video frame is received. In this callback, you can get the video data sent by the remote user. You can then post-process the data according to your scenarios.

After post-processing, you can send the processed data back to the SDK by setting the videoFrame parameter in this callback.

Parameters
agora_video_frame_observerAn AgoraVideoFrameObserver object.
channel_idThe channel name.
uidID of the remote user who sends the current video frame.
frameThe video frame.
Returns
Determines whether to ignore the current video frame if the post-processing fails:
  • true: Do not ignore.
  • false: Ignore, in which case this method does not sent the current video frame to the SDK.

The documentation for this interface was generated from the following file: