Agora C++ API Reference for All Platforms

Public Member Functions | Public Attributes | List of all members
agora::rtc::VideoCanvas Struct Reference

## Public Member Functions
| VideoCanvas ()
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt)
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u)
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u, uid_t subu)

## Public Attributes
uid_t | uid
uid_t | subviewUid
view_t | view
uint32_t | backgroundColor
media::base::RENDER_MODE_TYPE | renderMode
VIDEO_MIRROR_MODE_TYPE | mirrorMode
VIDEO_VIEW_SETUP_MODE | setupMode
VIDEO_SOURCE_TYPE | sourceType
int | mediaPlayerId
Rectangle | cropArea
bool | enableAlphaMask
media::base::VIDEO_MODULE_POSITION | position

## Detailed Description

Attributes of video canvas object.

## Constructor & Destructor Documentation

## ◆ VideoCanvas() [1/4]

agora::rtc::VideoCanvas::VideoCanvas | ( |  | ) |
| inline

## ◆ VideoCanvas() [2/4]

agora::rtc::VideoCanvas::VideoCanvas | ( | view_t | v,
|  | media::base::RENDER_MODE_TYPE | m,
|  | VIDEO_MIRROR_MODE_TYPE | mt
| ) |  |
| inline

## ◆ VideoCanvas() [3/4]

agora::rtc::VideoCanvas::VideoCanvas | ( | view_t | v,
|  | media::base::RENDER_MODE_TYPE | m,
|  | VIDEO_MIRROR_MODE_TYPE | mt,
|  | uid_t | u
| ) |  |
| inline

## ◆ VideoCanvas() [4/4]

agora::rtc::VideoCanvas::VideoCanvas | ( | view_t | v,
|  | media::base::RENDER_MODE_TYPE | m,
|  | VIDEO_MIRROR_MODE_TYPE | mt,
|  | uid_t | u,
|  | uid_t | subu
| ) |  |
| inline

## Member Data Documentation

## ◆ uid

uid_t agora::rtc::VideoCanvas::uid

The user id of local video.

## ◆ subviewUid

uid_t agora::rtc::VideoCanvas::subviewUid

The uid of video stream composing the video stream from transcoder which will be drawn on this video canvas.

## ◆ view

view_t agora::rtc::VideoCanvas::view

Video display window.

## ◆ backgroundColor

uint32_t agora::rtc::VideoCanvas::backgroundColor

A RGBA value indicates background color of the render view. Defaults to 0x00000000.

## ◆ renderMode

media::base::RENDER_MODE_TYPE agora::rtc::VideoCanvas::renderMode

The video render mode. See RENDER_MODE_TYPE. The default value is RENDER_MODE_HIDDEN.

## ◆ mirrorMode

VIDEO_MIRROR_MODE_TYPE agora::rtc::VideoCanvas::mirrorMode

The video mirror mode. See VIDEO_MIRROR_MODE_TYPE. The default value is VIDEO_MIRROR_MODE_AUTO.

Note
  - For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
  - For the remote user: The mirror mode is disabled by default.

## ◆ setupMode

VIDEO_VIEW_SETUP_MODE agora::rtc::VideoCanvas::setupMode

The mode of setting up video view. See VIDEO_VIEW_SETUP_MODE The default value is VIDEO_VIEW_SETUP_REPLACE.

## ◆ sourceType

VIDEO_SOURCE_TYPE agora::rtc::VideoCanvas::sourceType

The video source type. See VIDEO_SOURCE_TYPE. The default value is VIDEO_SOURCE_CAMERA_PRIMARY.

## ◆ mediaPlayerId

int agora::rtc::VideoCanvas::mediaPlayerId

The media player id of AgoraMediaPlayer. It should set this parameter when the sourceType is VIDEO_SOURCE_MEDIA_PLAYER to show the video that AgoraMediaPlayer is playing. You can get this value by calling the method getMediaPlayerId().

## ◆ cropArea

Rectangle agora::rtc::VideoCanvas::cropArea

If you want to display a certain part of a video frame, you can set this value to crop the video frame to show. The default value is empty(that is, if it has zero width or height), which means no cropping.

## ◆ enableAlphaMask

bool agora::rtc::VideoCanvas::enableAlphaMask

Whether to apply alpha mask to the video frame if exsit: true: Apply alpha mask to video frame. false: (Default) Do not apply alpha mask to video frame.

## ◆ position

media::base::VIDEO_MODULE_POSITION agora::rtc::VideoCanvas::position

The video frame position in pipeline. See VIDEO_MODULE_POSITION. The default value is POSITION_POST_CAPTURER.