Package io.agora.rtc2.video
Class VideoCanvas
java.lang.Object
io.agora.rtc2.video.VideoCanvas
The VideoCanvas class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintA RGBA value indicates background color of the render view.booleandefault false.intThe media player id of AgoraMediaPlayer.intThe video mirror mode: - `VIDEO_MIRROR_MODE_AUTO(0)`: (Default) The mirror mode determined by the SDK.The video frame position in pipeline.RectIf you want to display a certain part of a video frame, you can set this value to crop the video frame to show.static final int3: This mode is deprecated and Agora does not recommend using it.static final int2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit).static final int1: Uniformly scale the video until it fills the visible boundaries (cropped).intThe video render mode: - `RENDER_MODE_HIDDEN(1)`: (Default)Uniformly scale the video until it fills the visible boundaries (cropped).intThe mode of setting up video view.intThe video source type.intThe user id of video stream composing the video stream from transcoder which will be drawn on this video canvas.SurfaceTextureSetsurfaceTexturemakes Agora SDK as a video content provider, like Camera.intThe user id of local video.ViewVideo display window.static final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionVideoCanvas(View view) VideoCanvas(View view, int renderMode, int uid) VideoCanvas(View view, int renderMode, int uid, int subviewUid) -
Method Summary
-
Field Details
-
uid
public int uidThe user id of local video. -
subviewUid
public int subviewUidThe user id of video stream composing the video stream from transcoder which will be drawn on this video canvas. -
RENDER_MODE_HIDDEN
public static final int RENDER_MODE_HIDDEN1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.- See Also:
-
RENDER_MODE_FIT
public static final int RENDER_MODE_FIT2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black.- See Also:
-
RENDER_MODE_ADAPTIVE
public static final int RENDER_MODE_ADAPTIVE3: This mode is deprecated and Agora does not recommend using it.- See Also:
-
VIEW_SETUP_MODE_REPLACE
public static final int VIEW_SETUP_MODE_REPLACE- See Also:
-
VIEW_SETUP_MODE_ADD
public static final int VIEW_SETUP_MODE_ADD- See Also:
-
VIEW_SETUP_MODE_REMOVE
public static final int VIEW_SETUP_MODE_REMOVE- See Also:
-
view
public View viewVideo display window. Must be SurfaceView or TextureView. -
surfaceTexture
public SurfaceTexture surfaceTextureSetsurfaceTexturemakes Agora SDK as a video content provider, like Camera. While setviewAgora SDK consumes video content using view. You need draw texture on OpenGL context youself. You may set view or surfaceTexture, BUT DO NOT BOTH in one VideoCanvas, otherwise only view is used. -
renderMode
public int renderModeThe video render mode: - `RENDER_MODE_HIDDEN(1)`: (Default)Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - `RENDER_MODE_FIT(2)`: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black. - `RENDER_MODE_ADAPTIVE(3)`: This mode is deprecated and Agora does not recommend using it. -
mirrorMode
public int mirrorModeThe video mirror mode: - `VIDEO_MIRROR_MODE_AUTO(0)`: (Default) The mirror mode determined by the SDK. If you use the front camera, the SDK enables the mirror mode; if you use the rear camera, the SDK disables the mirror mode. - `VIDEO_MIRROR_MODE_ENABLED(1)`: Enable the mirror mode. - `VIDEO_MIRROR_MODE_DISABLED(2)`: Disable the mirror mode. -
setupMode
public int setupModeThe mode of setting up video view. The default value is VIEW_SETUP_MODE_REPLAC. -
sourceType
public int sourceTypeThe video source type. The default value is VIDEO_SOURCE_CAMERA_PRIMARY. -
mediaPlayerId
public int mediaPlayerIdThe 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 \ref getMediaPlayerId(). -
rect
public Rect rectIf 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
public boolean enableAlphaMaskdefault false. if set to true, the video will apply alpha mask if exist.(Mac only) -
backgroundColor
public int backgroundColorA RGBA value indicates background color of the render view. Defaults to 0x00000000. -
position
The video frame position in pipeline. See \ref VIDEO_MODULE_POSITION "VIDEO_MODULE_POSITION". The default value is POSITION_POST_CAPTURER.
-
-
Constructor Details
-
VideoCanvas
public VideoCanvas(View view) -
VideoCanvas
public VideoCanvas(View view, int renderMode, int uid) -
VideoCanvas
public VideoCanvas(View view, int renderMode, int uid, int subviewUid)
-