> ## 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.

# XAppCaptureStartUserRecord

> XAppCaptureStartUserRecord

# XAppCaptureStartUserRecord

사용자가 트리거한 것처럼 녹화합니다. 플레이어가 녹화가 진행 중일 때 게임을 일시 중단/제한하면 녹화가 중지됩니다. 녹화는 사용자 파티션에 저장됩니다. 캡처 설정은 GameDVR 설정을 기반으로 합니다. 동시 녹화 제한에 도달하면 다른 녹화를 시작하기 전에 [XAppCaptureStopUserRecord](/reference/system/xappcapture/functions/xappcapturestopuserrecord) 또는 [XAppCaptureCancelUserRecord](/reference/system/xappcapture/functions/xappcapturecanceluserrecord)를 호출해야 합니다. 이 API에 대한 Windows 지원은 이후 릴리스에서 추가될 예정입니다.

## 구문

```cpp theme={null}
HRESULT XAppCaptureStartUserRecord(
    XUserHandle requestingUser,
    uint32_t localIdBufferLength,
    char* localIdBuffer
)
```

### 매개 변수

*requestingUser* \_In\_\
형식: XUserHandle

녹화를 요청하는 사용자를 나타내는 핸들입니다.

*localIdBufferLength* \_In\_\
형식: uint32\_t

로컬 녹화 ID를 받을 버퍼의 길이입니다.

*localIdBuffer* \_Out\_\
형식: char\*

진행 중인 녹화 작업을 지정하는 로컬 ID가 포함된 버퍼입니다.

### 반환 값

형식: HRESULT

함수 결과입니다. `S_OK`가 아닌 반환 값에 대해서는 [XAppCapture 오류 코드](/reference/system/xappcapture/xappcapture_errors)를 참조하세요.

## 설명

함수가 성공적으로 완료되면 localIdOfUserRecording에 녹화의 로컬 ID가 포함되며, [XAppCaptureStopUserRecord](/reference/system/xappcapture/functions/xappcapturestopuserrecord) 또는 [XAppCaptureCancelUserRecord](/reference/system/xappcapture/functions/xappcapturecanceluserrecord)로 특정 녹화를 중지하려면 반드시 저장해야 합니다.

<Note>새 클립을 위한 공간을 확보하기 위해 할당된 공간이 가득 차면 오래된 클립이 삭제됩니다. 일정 기간 동안 클립을 유지하려면 [PLS](/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members)(영구 로컬 저장소), 연결된 저장소(예: [XGameSave](/reference/system/xgamesave/xgamesave_members) 또는 [XGameSaveFiles](/reference/system/xgamesavefiles/xgamesavefiles_members)) 또는 유사한 저장소 시스템을 사용하세요.</Note>

```cpp theme={null}
char localIdOfUserRecording[APPCAPTURE_MAX_LOCALID_LENGTH] = { '\0' };

XAppCaptureVideoCaptureSettings captureSettings = { 0 };
if (FAILED_LOG(XAppCaptureGetVideoCaptureSettings(&captureSettings)))
{
    return;
}

if (captureSettings.isCaptureByGamesAllowed)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = g_taskQueue;
    asyncBlock->callback = [](XAsyncBlock* ab)
    {
        auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab);

        XUserHandle user = nullptr;
        auto scopeExit = wil::scope_exit([&]()
        {
            if (user != nullptr)
            {
                XUserCloseHandle(user);
            }
        });

        if (FAILED_LOG(XUserAddResult(asyncBlock.get(), &user)))
        {
            return;
        }

        if (FAILED_LOG(XAppCaptureStartUserRecord(user, ARRAYSIZE(localIdOfUserRecording), localIdOfUserRecording)))
        {
            return;
        }
        appLog.AddLog("Recording started: localId = %s\n", localIdOfUserRecording);
    };

    if (SUCCEEDED_LOG(XUserAddAsync(
        XUserAddOptions::AddDefaultUserAllowingUI,
        asyncBlock.get())))
    {
        // Once started, release the pointer
        asyncBlock.release();
    }
}
```

## 요구 사항

**헤더:** XAppCapture.h

**라이브러리:** xgameruntime.lib

**지원되는 플랫폼:** XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XAppCapture 멤버](/reference/system/xappcapture/xappcapture_members)


## Related topics

- [XAppCaptureCancelUserRecord](/ko/reference/system/xappcapture/functions/xappcapturecanceluserrecord.md)
- [XAppCaptureUserRecordingResult](/ko/reference/system/xappcapture/structs/xappcaptureuserrecordingresult.md)
- [XAppCaptureStopUserRecord](/ko/reference/system/xappcapture/functions/xappcapturestopuserrecord.md)
- [XAppCapture](/ko/reference/system/xappcapture/xappcapture_members.md)
- [XAppCaptureRecordTimespan](/ko/reference/system/xappcapture/functions/xappcapturerecordtimespan.md)
