XAppCaptureRecordDiagnosticClip

Records a diagnostic clip from your app.

Syntax

HRESULT XAppCaptureRecordDiagnosticClip(  
         time_t startTime,  
         uint32_t durationInMs,  
         const char* filenamePrefix,  
         XAppCaptureRecordClipResult* result  
)  

Parameters

startTime   _In_
Type: time_t

Timestamp for the beginning of the diagnostic clip.

durationInMs   _In_
Type: uint32_t

Duration in milliseconds of the diagnostic clip.

filenamePrefix   _In_opt_
Type: char*

Desired prefix for the file name, is optional, will be appended to the front of the diagnostic file name.

result   _Out_
Type: XAppCaptureRecordClipResult*

The resulting recorded diagnostic clip.

Return value

Type: HRESULT

Function result.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

Calling this function does not trigger a UI notification. Clips are saved to a game accessible partition. The XAppCaptureRecordDiagnosticClipResult contains a file path which you can use to access the clip. On Xbox, this function will only be available on development kits. On retail kits this api will return an error immediately.

On PC, you must enable background recording for your app for this function to work. The best way to do this is to bring up Game Bar by pressing Win+G, then click the Settings icon, go to the Capturing tab, and enable "Record in the background while I'm playing a game". Then, you must mark your app as a game. The best way to do this is by running your game first. While the game is in focus, bring up Game Bar by pressing Win+G, then click the Settings icon, go to the General tab, and check "Remember this is a game".

Requirements

Header: XAppCapture.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

GameDVR Overview
XAppCapture Members
XAppCaptureRecordDiagnosticClipResult