Voice SDK v3.7.1 API Reference for All Platforms (C++)
agora::media::IVideoFrame Class Referenceabstract

Public Types

enum  PLANE_TYPE { Y_PLANE = 0, U_PLANE = 1, V_PLANE = 2, NUM_OF_PLANES = 3 }
 
enum  VIDEO_TYPE {
  VIDEO_TYPE_UNKNOWN = 0, VIDEO_TYPE_I420 = 1, VIDEO_TYPE_IYUV = 2, VIDEO_TYPE_RGB24 = 3,
  VIDEO_TYPE_ABGR = 4, VIDEO_TYPE_ARGB = 5, VIDEO_TYPE_ARGB4444 = 6, VIDEO_TYPE_RGB565 = 7,
  VIDEO_TYPE_ARGB1555 = 8, VIDEO_TYPE_YUY2 = 9, VIDEO_TYPE_YV12 = 10, VIDEO_TYPE_UYVY = 11,
  VIDEO_TYPE_MJPG = 12, VIDEO_TYPE_NV21 = 13, VIDEO_TYPE_NV12 = 14, VIDEO_TYPE_BGRA = 15,
  VIDEO_TYPE_RGBA = 16, VIDEO_TYPE_I422 = 17
}
 

Public Member Functions

virtual void release ()=0
 
virtual const unsigned char * buffer (PLANE_TYPE type) const =0
 
virtual int copyFrame (IVideoFrame **dest_frame) const =0
 
virtual int convertFrame (VIDEO_TYPE dst_video_type, int dst_sample_size, unsigned char *dst_frame) const =0
 
virtual int allocated_size (PLANE_TYPE type) const =0
 
virtual int stride (PLANE_TYPE type) const =0
 
virtual int width () const =0
 
virtual int height () const =0
 
virtual unsigned int timestamp () const =0
 
virtual int64_t render_time_ms () const =0
 
virtual bool IsZeroSize () const =0
 
virtual VIDEO_TYPE GetVideoType () const =0
 

Member Enumeration Documentation

◆ PLANE_TYPE

Enumerator
Y_PLANE 
U_PLANE 
V_PLANE 
NUM_OF_PLANES 

◆ VIDEO_TYPE

Enumerator
VIDEO_TYPE_UNKNOWN 
VIDEO_TYPE_I420 
VIDEO_TYPE_IYUV 
VIDEO_TYPE_RGB24 
VIDEO_TYPE_ABGR 
VIDEO_TYPE_ARGB 
VIDEO_TYPE_ARGB4444 
VIDEO_TYPE_RGB565 
VIDEO_TYPE_ARGB1555 
VIDEO_TYPE_YUY2 
VIDEO_TYPE_YV12 
VIDEO_TYPE_UYVY 
VIDEO_TYPE_MJPG 
VIDEO_TYPE_NV21 
VIDEO_TYPE_NV12 
VIDEO_TYPE_BGRA 
VIDEO_TYPE_RGBA 
VIDEO_TYPE_I422 

Member Function Documentation

◆ release()

virtual void agora::media::IVideoFrame::release ( )
pure virtual

◆ buffer()

virtual const unsigned char* agora::media::IVideoFrame::buffer ( PLANE_TYPE  type) const
pure virtual

◆ copyFrame()

virtual int agora::media::IVideoFrame::copyFrame ( IVideoFrame **  dest_frame) const
pure virtual

Copies the frame.

If the required size is larger than the allocated size, new buffers of the adequate size will be allocated.

Parameters
dest_frameAddress of the returned destination frame. See IVideoFrame.
Returns
  • 0: Success.
  • -1: Failure.

◆ convertFrame()

virtual int agora::media::IVideoFrame::convertFrame ( VIDEO_TYPE  dst_video_type,
int  dst_sample_size,
unsigned char *  dst_frame 
) const
pure virtual

Converts the frame.

Note
The source and destination frames have equal heights.
Parameters
dst_video_typeType of the output video.
dst_sample_sizeRequired only for the parsing of M-JPEG.
dst_framePointer to a destination frame. See IVideoFrame.
Returns
  • 0: Success.
  • < 0: Failure.

◆ allocated_size()

virtual int agora::media::IVideoFrame::allocated_size ( PLANE_TYPE  type) const
pure virtual

Gets the specified component in the YUV space.

Parameters
typeComponent type: PLANE_TYPE

◆ stride()

virtual int agora::media::IVideoFrame::stride ( PLANE_TYPE  type) const
pure virtual

Gets the stride of the specified component in the YUV space.

Parameters
typeComponent type: PLANE_TYPE

◆ width()

virtual int agora::media::IVideoFrame::width ( ) const
pure virtual

Gets the width of the frame.

◆ height()

virtual int agora::media::IVideoFrame::height ( ) const
pure virtual

Gets the height of the frame.

◆ timestamp()

virtual unsigned int agora::media::IVideoFrame::timestamp ( ) const
pure virtual

Gets the timestamp (ms) of the frame.

◆ render_time_ms()

virtual int64_t agora::media::IVideoFrame::render_time_ms ( ) const
pure virtual

Gets the render time (ms).

◆ IsZeroSize()

virtual bool agora::media::IVideoFrame::IsZeroSize ( ) const
pure virtual

Checks if a plane is of zero size.

Returns
  • true: The plane is of zero size.
  • false: The plane is not of zero size.

◆ GetVideoType()

virtual VIDEO_TYPE agora::media::IVideoFrame::GetVideoType ( ) const
pure virtual