文档中心
语音通话 (Legacy)
API 参考
AgoraScreenCaptureParameters Class Reference
Objective-C API Reference for iOS/macOS
AgoraScreenCaptureParameters Class Reference
Inherits from |
NSObject |
Declared in |
AgoraObjects.h |
Overview
设置屏幕共享编码配置的类
共享游戏画面时,声网推荐你根据下表设置 AgoraScreenCaptureParameters
中的 dimensions
、frameRate
、bitrate
。
分辨率 |
帧率(fps) |
码率(Kbps) |
160 × 120 |
15 |
130 |
120 × 120 |
15 |
100 |
320 × 180 |
15 |
280 |
180 × 180 |
15 |
200 |
240 × 180 |
15 |
240 |
320 × 240 |
15 |
400 |
240 × 240 |
15 |
280 |
424 × 240 |
15 |
440 |
640 × 360 |
15 |
800 |
360 × 360 |
15 |
520 |
640 × 360 |
30 |
1200 |
360 × 360 |
30 |
800 |
480 × 360 |
15 |
640 |
480 × 360 |
30 |
980 |
640 × 480 |
15 |
1000 |
480 × 480 |
15 |
800 |
640 × 480 |
30 |
1500 |
480 × 480 |
30 |
1200 |
848 × 480 |
15 |
1220 |
848 × 480 |
30 |
1860 |
640 × 480 |
10 |
800 |
1280 × 720 |
15 |
2260 |
1280 × 720 |
30 |
3420 |
960 × 720 |
15 |
1820 |
960 × 720 |
30 |
2760 |
1920 × 1080 |
15 |
4160 |
1920 × 1080 |
30 |
6300 |
1920 × 1080 |
60 |
6500 |
@property (assign, nonatomic) CGSize dimensions
Discussion
默认值为 1920 * 1080,即 2073600 像素。该像素值为计费标准。
当共享的屏幕分辨率宽高比与该值设置不一致时,SDK 按如下策略进行编码。假设 dimensions 为 1920 * 1080:
- 如果屏幕分辨率小于 dimensions,如 1000 * 1000,SDK 直接按 1000 * 1000 进行编码。
- 如果屏幕分辨率大于 dimensions,如 2000 * 1500,SDK 按屏幕分辨率的宽高比,即 4:3,取 dimensions 以内的最大分辨率进行编码,即 1440 * 1080。
无论实际编码分辨率如何,均按 dimensions 设置的值计费。
Declared In
AgoraObjects.h
共享的屏幕流的视频编码帧率,单位为 fps;默认值为 5,建议不要超过 15。
@property (assign, nonatomic) NSInteger frameRate
Declared In
AgoraObjects.h
共享的屏幕流的视频编码码率,单位为 Kbps;默认值为 0,表示由 SDK 根据当前共享的分辨率计算出一个合理的值。
@property (assign, nonatomic) NSInteger bitrate
Declared In
AgoraObjects.h
@property (assign, nonatomic) BOOL captureMouseCursor
Declared In
AgoraObjects.h
@property (assign, nonatomic) BOOL windowFocus
Discussion
- YES: 前置窗口。
- NO: (默认)不前置窗口。
Note: 因系统限制,windowFocus
仅支持将应用的主窗口前置。
Declared In
AgoraObjects.h
@property (copy, nonatomic) NSArray *excludeWindowList
Declared In
AgoraObjects.h
(仅适用于 macOS)是否对共享的窗口或屏幕进行描边:
@property (assign, nonatomic) BOOL highLighted
Discussion
Note: 当你共享窗口或屏幕的部分区域时,如果设置描边,SDK 会对整个窗口或屏幕进行描边。
Declared In
AgoraObjects.h
(仅适用于 macOS)描边的 ARGB 颜色。默认值为 0xFF8CBF26。
@property (strong, nonatomic) COLOR_CLASS *highLightColor
Discussion
在 macOS 平台上,COLOR_CLASS
指 NSColor
。
Declared In
AgoraObjects.h
(仅适用于 macOS)描边的宽度 (px)。默认值为 0,取值范围为 [0,50]。
@property (assign, nonatomic) NSUInteger highLightWidth
Declared In
AgoraObjects.h