#include <NGIAgoraVideoFrame.h>
|
OPTIONAL_ENUM_CLASS | Type |
|
OPTIONAL_ENUM_CLASS | Format |
|
The IVideoFrame class defines the interface to send video frame data to the SDK or get video frame data from the SDK.
◆ 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
-
rotation | Rotation 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
-
timestampUs | Timestamp 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.
◆ Type
OPTIONAL_ENUM_CLASS agora::rtc::IVideoFrame::Type |
Initial value: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.