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

# XApuEnqueueCommand

> XApuEnqueueCommand

# XApuEnqueueCommand

XAPU 명령 큐에 단일 명령을 제출합니다.

## Syntax

```cpp theme={null}
HRESULT XApuEnqueueCommand(  
         XApuHandle handle,  
         XApuCommandId* command,  
         uint32_t* totalCommandCount  
)  
```

### Parameters

*handle*   \_In\_\
Type: XApuHandle

[XApuConnect](/reference/audio/xapu/functions/xapuconnect)를 호출하여 반환된 핸들입니다.

*command*   \_In\_\
Type: [XApuCommandId\*](/reference/audio/xapu/structs/xapucommandid)

XAPU 입력 큐에 제출할 명령입니다.

*totalCommandCount*   \_Out\_opt\_\
Type: uint32\_t\*

반환되는 총 명령 수입니다.

### Return value

Type: HRESULT

성공 시 S\_OK를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.

## Remarks

이 호출은 리소스를 할당하거나 데이터를 처리하지 않고 단순히 하드웨어 서버로 명령을 보내기 때문에 빠릅니다. [XApuConnectInputParameters::maxQueuedCommandsPerStream](/reference/audio/xapu/structs/xapuconnectinputparameters) 개의 명령이 처리 중인 경우 이 호출은 [XAPU\_E\_QUEUE\_FULL](/reference/audio/xapu/enums/xapuerrors)을 반환합니다. 이 오류를 방지하려면 호출자는 [XApuDequeueResult](/reference/audio/xapu/functions/xapudequeueresult)를 통해 하나 이상의 결과를 검색해야 합니다. 이 호출은 스레드 안전하며, 즉 여러 스레드에서 명령을 제출할 수 있지만 두 개 이상의 스레드에서 호출해도 성능상의 이점은 없습니다.

이 호출은 또한 현재 세션에 대한 *totalCommandCount*를 반환하기 위해 uint32\_t에 대한 포인터를 받습니다. 이 숫자는 세션이 시작되고 [XApuConnect](/reference/audio/xapu/functions/xapuconnect)가 호출된 이후 성공적으로 제출된 총 명령 수를 나타냅니다. 이 숫자는 0으로 돌아가지 않습니다.

하드웨어 서버가 잘못된 상태인 경우 [XApuEnqueueCommand](/reference/audio/xapu/functions/xapuenqueuecommand)는 [XAPU\_E\_DEVICE\_FATAL\_ERROR](/reference/audio/xapu/enums/xapuerrors) 오류 코드를 반환합니다. 이 경우 모든 XAPU 클라이언트의 연결을 끊고 다시 연결해야 합니다.

이 메서드가 실패하면 자세한 오류 코드가 반환됩니다.

다음 표는 각 [XApuCommandType](/reference/audio/xapu/enums/xapucommandtype)을 **XApuEnqueueCommand**에 전달해야 하는 구조체 유형에 매핑합니다.

| XApuCommandType             | Struct Type                                                                                        |
| --------------------------- | -------------------------------------------------------------------------------------------------- |
| XApuCommandType::Activate   | [XApuDecodeConvertActivateCommand](/reference/audio/xapu/structs/xapudecodeconvertactivatecommand) |
| XApuCommandType::Deactivate | [XApuCommandId](/reference/audio/xapu/structs/xapucommandid)                                       |
| XApuCommandType::Process    | [XApuDecodeConvertCommand](/reference/audio/xapu/structs/xapudecodeconvertcommand)                 |
| XApuCommandType::Notify     | [XApuCommandId](/reference/audio/xapu/structs/xapucommandid)                                       |
| XApuCommandType::Reset      | [XApuCommandId](/reference/audio/xapu/structs/xapucommandid)                                       |

## Requirements

**Header:** xapu.h

**Library:** xapu.lib

**Supported platforms:** XBOX Series X|S

## See also

[XAPU](/reference/audio/xapu/xapu_members)


## Related topics

- [XApuCommandType](/ko/reference/audio/xapu/enums/xapucommandtype.md)
- [XApuDecodeConvertCommand](/ko/reference/audio/xapu/structs/xapudecodeconvertcommand.md)
- [XApuDecodeConvertActivateCommand](/ko/reference/audio/xapu/structs/xapudecodeconvertactivatecommand.md)
- [XApuConnect](/ko/reference/audio/xapu/functions/xapuconnect.md)
- [XApuDequeueResult](/ko/reference/audio/xapu/functions/xapudequeueresult.md)
