VideoCanvas
Used to configure the properties of the video canvas.
struct VideoCanvas {
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;
};
Properties
- uid
- User ID of the published video source.
- subviewUid
- User ID of the specific sub-video stream published in video mixing.
- view
- Video display window.
Note: Only one of
vieworsurfaceTexturecan be set in a VideoCanvas. If both are set, onlyviewtakes effect. - backgroundColor
- Background color of the video canvas in RGBA format. Default is 0x00000000 (black).
- renderMode
- Video rendering mode. See RENDER_MODE_TYPE.
- mirrorMode
- Mirror mode of the view. See VIDEO_MIRROR_MODE_TYPE.
Note:
- Mirror mode for local video view: when using the front camera, the SDK enables mirror mode by default; when using the rear camera, the SDK disables mirror mode by default.
- Mirror mode is disabled by default for remote users.
- setupMode
- View setup mode. See VIDEO_VIEW_SETUP_MODE.
- sourceType
- Type of video source. See VIDEO_SOURCE_TYPE.
- mediaPlayerId
- ID of the media player. You can get the device ID by calling getMediaPlayerId.
- cropArea
- Display area of the video frame.
widthandheightindicate the pixel width and height of the area. Default is NULL (i.e.,widthorheightis 0), which means the actual resolution of the video frame is displayed. See Rectangle. - enableAlphaMask
-
Note:Whether to enable alpha mask rendering:
- The receiver can render alpha channel information only if the sender enables alpha channel transmission.
- To enable alpha channel transmission, contact technical support.
- true: Enable alpha mask rendering.
- false: (default) Disable alpha mask rendering.
- position
- Observation position of the video frame in the video pipeline. See VIDEO_MODULE_POSITION.