> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XAppCaptureRecordDiagnosticClip

> XAppCaptureRecordDiagnosticClip

# XAppCaptureRecordDiagnosticClip

アプリから診断クリップを録画します。

## 構文

```cpp theme={null}
HRESULT XAppCaptureRecordDiagnosticClip(  
         time_t startTime,  
         uint32_t durationInMs,  
         const char* filenamePrefix,  
         XAppCaptureRecordClipResult* result  
)  
```

### パラメーター

*startTime*   \_In\_\
型: time\_t

診断クリップの開始タイムスタンプです。

*durationInMs*   \_In\_\
型: uint32\_t

診断クリップの長さ (ミリ秒) です。

*filenamePrefix*   \_In\_opt\_\
型: char\*

ファイル名の希望のプレフィックスです。任意で、診断ファイル名の先頭に追加されます。

*result*   \_Out\_\
型: [XAppCaptureRecordClipResult\*](/reference/system/xappcapture/structs/xappcapturerecordclipresult)

結果として録画される診断クリップです。

### 戻り値

型: HRESULT

関数の結果です。

## 解説

<Note>この関数は、時間依存スレッドで呼び出しても安全ではありません。 詳細については、「[Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)」を参照してください。</Note>

この関数を呼び出しても、UI 通知はトリガーされません。 クリップはゲームがアクセスできるパーティションに保存されます。 [XAppCaptureRecordDiagnosticClipResult](/reference/system/xappcapture/structs/xappcapturerecordclipresult) には、クリップへのアクセスに使用できるファイル パスが含まれています。
XBOX では、この関数は開発キットでのみ使用可能です。 小売キットでは、この API は直ちにエラーを返します。

PC では、この関数を動作させるためにアプリのバックグラウンド録画を有効にする必要があります。 これを行う最良の方法は、Win+G キーを押して Game Bar を表示し、\[設定] アイコンをクリックし、\[キャプチャ] タブに移動して、\[ゲームのプレイ中にバックグラウンドで録画する] を有効にすることです。
次に、アプリをゲームとしてマークする必要があります。 これを行う最良の方法は、まずゲームを実行することです。 ゲームがフォーカスされている間に Win+G キーを押して Game Bar を表示し、\[設定] アイコンをクリックし、\[全般] タブに移動して、\[これはゲームであることを覚えておく] をオンにします。

## 要件

**ヘッダー:** XAppCapture.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 概念ドキュメント

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 関連項目

[GameDVR の概要](/build/console-features/game-dvr/gamedvr-broadcast)\
[XAppCapture メンバー](/reference/system/xappcapture/xappcapture_members)\
[XAppCaptureRecordDiagnosticClipResult](/reference/system/xappcapture/structs/xappcapturerecordclipresult)


## Related topics

- [XAppCaptureRecordClipResult](/ja-jp/reference/system/xappcapture/structs/xappcapturerecordclipresult.md)
- [XAppCapture](/ja-jp/reference/system/xappcapture/xappcapture_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XAppCaptureVideoEncoding](/ja-jp/reference/system/xappcapture/enums/xappcapturevideoencoding.md)
- [XAppCaptureUserRecordingResult](/ja-jp/reference/system/xappcapture/structs/xappcaptureuserrecordingresult.md)
