Agora Java API Reference for Android
Classes | Public Member Functions | Public Attributes | List of all members
agora::rtc::IVideoFrame Class Referenceabstract

#include <NGIAgoraVideoFrame.h>

Inheritance diagram for agora::rtc::IVideoFrame:
agora::RefCountInterface

Classes

struct  TextureId
 

Public Member Functions

virtual Type type () const =0
 
virtual Format format () const =0
 
virtual int width () const =0
 
virtual int height () const =0
 
virtual int size () const =0
 
virtual int rotation () const =0
 
virtual void setRotation (int rotation)=0
 
virtual int64_t timestampUs () const =0
 
virtual void setTimeStampUs (int64_t timestampUs)=0
 
virtual const uint8_t * data () const =0
 
virtual uint8_t * mutableData ()=0
 
virtual int resize (int width, int height)=0
 
virtual TextureId textureId () const =0
 
virtual int fill (Format format, int width, int height, int rotation, const uint8_t *src)=0
 
virtual int fill (Format format, int width, int height, int rotation, TextureId textureId)=0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Public Attributes

OPTIONAL_ENUM_CLASS Type
 
OPTIONAL_ENUM_CLASS Format
 

Detailed Description

The IVideoFrame class defines the interface to send video frame data to the SDK or get video frame data from the SDK.

Member Function Documentation

◆ type()

virtual Type agora::rtc::IVideoFrame::type ( ) const
pure virtual

Gets the Type of the frame.

Returns
The type of the frame. See Type.

◆ format()

virtual Format agora::rtc::IVideoFrame::format ( ) const
pure virtual

Gets the Format of the frame.

Returns
The format of the frame. See Format.

◆ width()

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

Gets the width of the frame in pixels.

Returns
The width (px) of the frame.

◆ height()

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

Gets the height of the frame in pixels.

Returns
The height of the frame in pixels.

◆ size()

virtual int agora::rtc::IVideoFrame::size ( ) const
pure virtual

Gets the size of the frame in pixels

Returns
The size of the frame in pixels

◆ rotation()

virtual int agora::rtc::IVideoFrame::rotation ( ) const
pure virtual

Gets the rotation angle of the frame

Returns
Rotation angle in degrees.

◆ setRotation()

virtual void agora::rtc::IVideoFrame::setRotation ( int  rotation)
pure virtual

Sets the rotation angle of the frame.

Parameters
rotationRotation angle in degrees, such as 0, 90, 180, or 270.

◆ timestampUs()

virtual int64_t agora::rtc::IVideoFrame::timestampUs ( ) const
pure virtual

Gets the timestamp of the frame in microseconds.

Returns
Timestamp of the frame in microseconds.

◆ setTimeStampUs()

virtual void agora::rtc::IVideoFrame::setTimeStampUs ( int64_t  timestampUs)
pure virtual

Sets the timestamp of the frame in microseconds.

Parameters
timestampUsTimestamp of the frame in microseconds.

◆ data()

virtual const uint8_t* agora::rtc::IVideoFrame::data ( ) const
pure virtual

Gets the constant raw data pointer to the beginning of the contigorous memory of the frame.

Returns
Constant pointer to the beginning of the underlying memory.

◆ mutableData()

virtual uint8_t* agora::rtc::IVideoFrame::mutableData ( )
pure virtual

Gets the mutable raw data pointer to the beginning of the contigorous memory of the frame.

User can modify the content of the frame's underlying memory pointed by the mutable pointer. Access to memory within the scope of the frame's size is ensured to be valid.

Returns
Mutable pointer to the beginning of the underlying memory.

◆ resize()

virtual int agora::rtc::IVideoFrame::resize ( int  width,
int  height 
)
pure virtual

Resizes the buffer to new width and height.

No reallocation happens if the new size is less than the frame's original size, otherwise, a reallocation-and-copy happens.

Returns
  • 0: The function call succeeds.
  • <0: The function call fails.

◆ textureId()

virtual TextureId agora::rtc::IVideoFrame::textureId ( ) const
pure virtual

Gets the texture id of the underlying buffer if type id texture.

Returns

◆ fill() [1/2]

virtual int agora::rtc::IVideoFrame::fill ( Format  format,
int  width,
int  height,
int  rotation,
const uint8_t *  src 
)
pure virtual

Fill the underlying buffer with source buffer content pointed by src and with new format, width, height & rotation.

This function first tries to fill in-place with no copy and reallocation. When it fails, a copy or copy-plus-reallocation may happen

Returns
  • 0: The function call succeeds.
  • <0: The function call fails.

◆ fill() [2/2]

virtual int agora::rtc::IVideoFrame::fill ( Format  format,
int  width,
int  height,
int  rotation,
TextureId  textureId 
)
pure virtual

Fill the underlying buffer with new texture.

Returns
  • 0: The function call succeeds.
  • <0: The function call fails.

Member Data Documentation

◆ Type

OPTIONAL_ENUM_CLASS agora::rtc::IVideoFrame::Type
Initial value:
{
kRawData,
kTexture,
}

Supported Video Frame memory types.

◆ Format

OPTIONAL_ENUM_CLASS agora::rtc::IVideoFrame::Format
Initial value:
{
kUnknown,
kI420,
kI420A,
kI422,
kNV21,
kNV12,
kRGBA,
kARGB,
kBGRA
}

Supported Video Frame Formats.