XAppCaptureGetVideoCaptureSettings

查询设备的 GameDVR 设置,这些设置包括编码类型、颜色格式、分辨率、可能的最大录制长度,以及当前用户是否允许按游戏捕获。

语法

HRESULT XAppCaptureGetVideoCaptureSettings(
  XAppCaptureVideoCaptureSettings * userCaptureSettings
)

参数

userCaptureSettings _Out_
Type: XAppCaptureVideoCaptureSettings *

函数返回时包含用于捕获解析的设备 GameDVR 设置。

返回值

类型:HRESULT

函数结果。

备注

用户随时可以更改 XAppCaptureGetVideoCaptureSettings 返回的值。 因此,建议在调用 XAppCaptureRecordTimespan 之前先调用 XAppCaptureGetVideoCaptureSettings,以确保检索到最新值。

可以像这样获取 XAppCaptureVideoCaptureSettings 结构。

XAppCaptureVideoCaptureSettings captureSettings = { 0 };

if (SUCCEEDED(XAppCaptureGetVideoCaptureSettings(&captureSettings)))
{
	appLog.AddLog("Color Format: %s , encoding: %s, Width: %lu, Height %lu, Max RecordTimespan duration: %llu, Capture Permitted: %d\n",
		(captureSettings.colorFormat == XAppCaptureVideoColorFormat::SDR) ? "SDR" : "HDR",
		(captureSettings.encoding == XAppCaptureVideoEncoding::H264) ? "H264" : "HEVC",
		captureSettings.width,
		captureSettings.height,
		captureSettings.maxRecordTimespanDurationInMs,
		captureSettings.isCaptureByGamesAllowed);
}

要求

头文件:XAppCapture.h

库:xgameruntime.lib

支持平台:Windows、Xbox One 系列主机和 Xbox Series 主机

另请参阅

XAppCapture 成员