registerVideoFrameObserver abstract method

void registerVideoFrameObserver(
  1. VideoFrameObserver observer
)

Registers a raw video frame observer object.

If you want to observe raw video frames (such as YUV or RGBA format), Agora recommends that you register a VideoFrameObserver class using this method. When registering a video frame observer using this method, you can register callbacks in the VideoFrameObserver class as needed. After successful registration, the SDK triggers the registered callbacks each time a video frame is captured. When handling the callback, you need to consider changes in the width and height parameters of the video frame, as the observed video frames may vary due to the following situations: When the network condition is poor, the resolution will drop step by step. When the user manually adjusts the resolution, the resolution reported in the callback will also change.

  • observer Instance of the interface object. See VideoFrameObserver.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions. < 0: Method call failed. See Error Codes for details and resolution suggestions.

Implementation

void registerVideoFrameObserver(VideoFrameObserver observer);