Agora Server Gateway SDK C++ API Reference
Public Types | Public Member Functions | List of all members
IVideoFrameObserver Class Referenceabstract

#include <AgoraMediaBase.h>

Public Types

enum  VIDEO_FRAME_PROCESS_MODE { PROCESS_MODE_READ_ONLY , PROCESS_MODE_READ_WRITE }
 
typedef media::base::VideoFrame VideoFrame
 

Public Member Functions

virtual ~IVideoFrameObserver ()
 
virtual bool onPreEncodeVideoFrame (VideoFrame &videoFrame)=0
 
virtual bool getMirrorApplied ()
 

Detailed Description

The IVideoFrameObserver class.

Member Typedef Documentation

◆ VideoFrame

typedef media::base::VideoFrame IVideoFrameObserver::VideoFrame

Member Enumeration Documentation

◆ VIDEO_FRAME_PROCESS_MODE

Enumerator
PROCESS_MODE_READ_ONLY 
PROCESS_MODE_READ_WRITE 

Constructor & Destructor Documentation

◆ ~IVideoFrameObserver()

virtual IVideoFrameObserver::~IVideoFrameObserver ( )
inlinevirtual

Member Function Documentation

◆ getMirrorApplied()

virtual bool IVideoFrameObserver::getMirrorApplied ( )
inlinevirtual

Occurs each time needs to get whether mirror is applied or not.

Returns
Determines whether to mirror.
  • true: need to mirror.
  • false: no mirror.

◆ onPreEncodeVideoFrame()

virtual bool IVideoFrameObserver::onPreEncodeVideoFrame ( VideoFrame videoFrame)
pure virtual

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
videoFrameA pointer to the video frame: VideoFrame
Returns
Determines whether to ignore the current video frame if the pre-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 class was generated from the following file: