io.agora.rtc

## Class DefaultVideoFrameObserver2

- java.lang.Object
- - io.agora.rtc.DefaultVideoFrameObserver2

- All Implemented Interfaces:
    IVideoFrameObserver2

      public class DefaultVideoFrameObserver2
      extends java.lang.Object
      implements IVideoFrameObserver2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultVideoFrameObserver2()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onFrame(AgoraVideoFrameObserver2 agoraVideoFrameObserver2, java.lang.String channelId, java.lang.String remoteUserId, VideoFrame frame)` Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultVideoFrameObserver2

          public DefaultVideoFrameObserver2()

  - ### Method Detail

    - #### onFrame

          public void onFrame(AgoraVideoFrameObserver2 agoraVideoFrameObserver2,
                              java.lang.String channelId,
                              java.lang.String remoteUserId,
                              VideoFrame frame)

      Note: To improve data transmission efficiency, the buffer of the frame object is a DirectByteBuffer. Be sure to extract the byte array value in the callback synchronously and then transfer it to the asynchronous thread for processing. You can refer to `Utils.getBytes(ByteBuffer)`.
      Specified by:
        `onFrame` in interface `IVideoFrameObserver2`
      Parameters:
        `agoraVideoFrameObserver2` - the video frame observer
        `channelId` - the channel id
        `remoteUserId` - the remote user id
        `frame` - the video frame