#include <AgoraMediaBase.h>
Public 类型 | |
enum | VIDEO_FRAME_PROCESS_MODE { PROCESS_MODE_READ_ONLY , PROCESS_MODE_READ_WRITE } |
typedef media::base::VideoFrame | VideoFrame |
Public 成员函数 | |
virtual | ~IVideoFrameObserver () |
virtual bool | onPreEncodeVideoFrame (VideoFrame &videoFrame)=0 |
virtual bool | onRenderVideoFrame (const char *channelId, rtc::uid_t remoteUid, VideoFrame &videoFrame)=0 |
virtual bool | onTranscodedVideoFrame (VideoFrame &videoFrame)=0 |
virtual VIDEO_FRAME_PROCESS_MODE | getVideoFrameProcessMode () |
virtual base::VIDEO_PIXEL_FORMAT | getVideoPixelFormatPreference () |
virtual bool | getRotationApplied () |
virtual bool | getMirrorApplied () |
virtual uint32_t | getObservedFramePosition () |
virtual bool | isExternal () |
视频 observer。
|
inlinevirtual |
|
inlinevirtual |
设置视频数据镜像。
|
inlinevirtual |
Sets the frame position for the video observer.
After you successfully register the video observer, the SDK triggers this callback each time it receives a video frame. You can determine which position to observe by setting the return value. The SDK provides 3 positions for observer. Each position corresponds to a callback function:
POSITION_POST_CAPTURER(1 << 0): The position after capturing the video data, which corresponds to the onCaptureVideoFrame callback. POSITION_PRE_RENDERER(1 << 1): The position before receiving the remote video data, which corresponds to the onRenderVideoFrame callback. POSITION_PRE_ENCODER(1 << 2): The position before encoding the video data, which corresponds to the onPreEncodeVideoFrame callback.
To observe multiple frame positions, use '|' (the OR operator). This callback observes POSITION_POST_CAPTURER(1 << 0) and POSITION_PRE_RENDERER(1 << 1) by default. To conserve the system consumption, you can reduce the number of frame positions that you want to observe.
|
inlinevirtual |
Occurs each time needs to get rotation angle.
|
inlinevirtual |
Indicate the video frame mode of the observer.
|
inlinevirtual |
|
inlinevirtual |
Indicate if the observer is for internal use. Note: Never override this function
|
pure virtual |
获取本地视频编码前的视频数据。
成功注册视频数据 observer后,SDK 会在捕捉到每个视频帧时触发该回调。你可以在回调中获取编码前的视频数据,然后根据场景需要,对视频数据进行处理。
完成处理后,你可以在该回调中,传入处理后的视频数据将其发送回 SDK。
videoFrame | 视频帧数据。 |
|
pure virtual |
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.
channelId | The channel name |
remoteUid | ID of the remote user who sends the current video frame. |
videoFrame | A pointer to the video frame: VideoFrame |
|
pure virtual |