FScreenCaptureSourceInfo
可共享窗口或屏幕的信息。在 IScreenCaptureSourceList
中返回。
C++
USTRUCT(BlueprintType)
struct FScreenCaptureSourceInfo {
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FENUMWRAP_ScreenCaptureSourceType type = FENUMWRAP_ScreenCaptureSourceType();
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
int64 sourceId = 0;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FString sourceName = "";
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FThumbImageBuffer thumbImage = FThumbImageBuffer();
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FThumbImageBuffer iconImage = FThumbImageBuffer();
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FString processPath = "";
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FString sourceTitle = "";
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
bool primaryMonitor = false;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
bool isOccluded = false;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
FRectangle position = FRectangle();
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
bool minimizeWindow = false;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|FScreenCaptureSourceInfo")
int64 sourceDisplayId = 0;
#if defined(_WIN32) || (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE)
FScreenCaptureSourceInfo(){}
FScreenCaptureSourceInfo(const agora::rtc::ScreenCaptureSourceInfo & AgoraData){
type = AgoraData.type;
sourceId = UABT::FromViewToInt(AgoraData.sourceId);
sourceName = UTF8_TO_TCHAR(AgoraData.sourceName);
thumbImage = FThumbImageBuffer(AgoraData.thumbImage);
iconImage = FThumbImageBuffer(AgoraData.iconImage);
processPath = UTF8_TO_TCHAR(AgoraData.processPath);
sourceTitle = UTF8_TO_TCHAR(AgoraData.sourceTitle);
primaryMonitor = AgoraData.primaryMonitor;
isOccluded = AgoraData.isOccluded;
position = FRectangle(AgoraData.position);
#if defined(_WIN32)
minimizeWindow = AgoraData.minimizeWindow;
sourceDisplayId = UABT::FromViewToInt(AgoraData.sourceDisplayId);
#endif
}
agora::rtc::ScreenCaptureSourceInfo CreateAgoraData() const {
agora::rtc::ScreenCaptureSourceInfo AgoraData;
AgoraData.type = static_cast<agora::rtc::ScreenCaptureSourceType>(type.GetRawValue());
AgoraData.sourceId = UABT::ToView(sourceId);
SET_UABT_FSTRING_TO_CONST_CHAR___MEMALLOC(AgoraData.sourceName, sourceName)
AgoraData.thumbImage = thumbImage.CreateAgoraData();
AgoraData.iconImage = iconImage.CreateAgoraData();
SET_UABT_FSTRING_TO_CONST_CHAR___MEMALLOC(AgoraData.processPath, processPath)
SET_UABT_FSTRING_TO_CONST_CHAR___MEMALLOC(AgoraData.sourceTitle, sourceTitle)
AgoraData.primaryMonitor = primaryMonitor;
AgoraData.isOccluded = isOccluded;
AgoraData.position = position.CreateAgoraData();
#if defined(_WIN32)
AgoraData.minimizeWindow = minimizeWindow;
AgoraData.sourceDisplayId = UABT::ToView(sourceDisplayId);
#endif
return AgoraData;
}
void FreeAgoraData(agora::rtc::ScreenCaptureSourceInfo & AgoraData) const {
SET_UABT_FSTRING_TO_CONST_CHAR___MEMFREE(AgoraData.sourceName)
thumbImage.FreeAgoraData(AgoraData.thumbImage);
thumbImage.FreeAgoraData(AgoraData.iconImage);
SET_UABT_FSTRING_TO_CONST_CHAR___MEMFREE(AgoraData.processPath)
SET_UABT_FSTRING_TO_CONST_CHAR___MEMFREE(AgoraData.sourceTitle)
position.FreeAgoraData(AgoraData.position);
}
#endif
};
type
共享目标的类型。详见 FENUMWRAP_ScreenCaptureSourceType。
sourceId
对于窗口,表示窗口 ID(Window ID);对于屏幕,表示屏幕 ID(Display ID)。
sourceName
窗口或屏幕的名称。UTF-8 编码。
thumbImage
缩略图的图像内容。详见 FThumbImageBuffer。
iconImage
图标的图像内容。详见 FThumbImageBuffer。
processPath
窗口所属的进程。UTF-8 编码。
sourceTitle
窗口标题。UTF-8 编码。
primaryMonitor
屏幕是否为主显示屏:
true
: 屏幕为主显示屏。false
: 屏幕不是主显示屏。
position
窗口相对于整个屏幕空间(包含所有可共享屏幕)的位置。详见 FRectangle。
minimizeWindow
(仅适用于 Windows) 窗口是否已最小化:
true
: 窗口已最小化。false
: 窗口未最小化。
sourceDisplayId
(仅适用于 Windows) 窗口所在的屏幕 ID。如果窗口为跨屏幕显示,则表示与该窗口相交面积最大的屏幕 ID。如果窗口位于可见屏幕之外,则该成员的值为 -2。