FScreenCaptureParameters
Screen sharing configurations.
USTRUCT(BlueprintType) struct FScreenCaptureParameters { GENERATED_BODY() public: UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") FVideoDimensions dimensions = FVideoDimensions(); UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int frameRate = 5; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int bitrate = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") bool captureMouseCursor = true; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") bool windowFocus = false; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int64 excludeWindowList = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int excludeWindowCount = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int highLightWidth = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") int highLightColor = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|ScreenCaptureParameters") bool enableHighLight = false; FScreenCaptureParameters(){} FScreenCaptureParameters(const agora::rtc::ScreenCaptureParameters & AgoraData){ dimensions = FVideoDimensions(AgoraData.dimensions); frameRate = AgoraData.frameRate; bitrate = AgoraData.bitrate; captureMouseCursor = AgoraData.captureMouseCursor; windowFocus = AgoraData.windowFocus; highLightWidth = AgoraData.highLightWidth; highLightColor = AgoraData.highLightColor; enableHighLight = AgoraData.enableHighLight; } agora::rtc::ScreenCaptureParameters CreateAgoraData() const { agora::rtc::ScreenCaptureParameters AgoraData; AgoraData.dimensions = dimensions.CreateAgoraData(); AgoraData.frameRate = frameRate; AgoraData.bitrate = bitrate; AgoraData.captureMouseCursor = captureMouseCursor; AgoraData.windowFocus = windowFocus; AgoraData.highLightWidth = highLightWidth; AgoraData.highLightColor = highLightColor; AgoraData.enableHighLight = enableHighLight; return AgoraData; } void FreeAgoraData(agora::rtc::ScreenCaptureParameters& AgoraData) const { dimensions.FreeAgoraData(AgoraData.dimensions); } };
Attributes
- dimensions
-
The video encoding resolution of the screen sharing stream. See FUABT_VideoDimensions. The default value is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges.
If the screen dimensions are different from the value of this parameter, Agora applies the following strategies for encoding. Suppose dimensions is set to 1920 × 1080:- If the value of the screen dimensions is lower than that of dimensions, for example, 1000 × 1000 pixels, the SDK uses the screen dimensions, that is, 1000 × 1000 pixels, for encoding.
- If the value of the screen dimensions is higher than that of dimensions, for example, 2000 × 1500, the SDK uses the maximum value under dimensions with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080.
Note: When setting the encoding resolution in the scenario of sharing documents (SCREEN_SCENARIO_DOCUMENT), choose one of the following two methods:- If you require the best image quality, it is recommended to set the encoding resolution to be the same as the capture resolution.
- If you wish to achieve a relative balance between image quality, bandwidth, and system performance, then:
- When the capture resolution is greater than 1920 × 1080, it is recommended that the encoding resolution is not less than 1920 × 1080.
- When the capture resolution is less than 1920 × 1080, it is recommended that the encoding resolution is not less than 1280 × 720.
- frameRate
- On Windows and macOS, this represents the video encoding frame rate (fps) of the screen sharing stream. The frame rate (fps) of the shared region. The default value is 5. Agora does not recommend setting this to a value greater than 15.
- bitrate
- On Windows and macOS, this represents the video encoding bitrate of the screen sharing stream. The bitrate (Kbps) of the shared region. The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen).
- captureMouseCursor
-
Whether to capture the mouse in screen sharing:
true
: (Default) Capture the mouse.false
: Do not capture the mouse.
- windowFocus
-
Whether to bring the window to the front when calling the StartScreenCaptureByWindowId method to share it:
true
: Bring the window to the front.false
: (Default) Do not bring the window to the front.
Note: Due to macOS system limitations, when setting this member to bring the window to the front, if the current app has multiple windows, only the main window will be brought to the front. - excludeWindowList
- The ID list of the windows to be blocked. When calling StartScreenCaptureByDisplayId to start screen sharing, you can use this parameter to block a specified window. When calling UpdateScreenCaptureParameters to update screen sharing configurations, you can use this parameter to dynamically block a specified window.
- enableHighLight
- (For macOS and Windows only) Whether to place a border around the shared window or screen:
true
: Place a border.false
: (Default) Do not place a border.
Note: When you share a part of a window or screen, the SDK places a border around the entire window or screen if you set this parameter totrue
. - highLightColor
- (For macOS and Windows only)
- On Windows platforms, the color of the border in ARGB format. The default value is 0xFF8CBF26.
- On macOS,
COLOR_CLASS
refers toNSColor
.
- highLightWidth
- (For macOS and Windows only) The width (px) of the border. The default value is 5, and the value range is (0, 50].Note: This parameter only takes effect when highLighted is set to
true
. - excludeWindowCount
- The number of windows to be excluded.Note: On the Windows platform, the maximum value of this parameter is 24; if this value is exceeded, excluding the window fails.