Skip to main content

XApuDecodeConvertActivateCommand

定义解码或解码转换的激活参数。

Syntax

Members

id
Type: XApuCommandId
指定要发送到硬件进行处理的基本命令参数。相同的 XApuCommandId 将被设置到 XApuResult::id 中。 channelCount
Type: uint32_t
指定流的通道数。仅支持 1 和 2,分别对应单声道和立体声。 initializeDataLength
Type: uint32_t
未使用,应设置为零。 initializeData
Type: void*
未使用,应设置为 NULL。 startPitch
Type: float
如果转换器处于活动状态时的起始音高。在仅解码的情况下,此值将被忽略。 processingBufferLength
Type: uint32_t
XApuDecodeConvertActivateCommand::processingBuffer 的长度(以字节为单位)。长度必须是 16 的倍数。 processingBuffer
Type: void*
用于存储 XApuProcessType::DecodeConvertOpusXApuProcessType::ConvertPCM 类型的未压缩 PCM 浮点(32 位)数据的中间缓冲区。 处理缓冲区从 XApuConnectOutputParameters::baseData 中划分出来,并通过 XApuCommandType::Activate 命令使用 XApuDecodeConvertActivateCommand::processingBufferXApuDecodeConvertActivateCommand::processingBufferLength 参数传递给 XAPU。 对于 XApuProcessType::DecodeConvertOpus 场景,处理缓冲区用于存储来自解码器但尚未转换的中间 PCM 浮点(32 位)数据是必要的。对于 XApuProcessType::ConvertPCM 场景,它将存储来自调用方尚未转换的 PCM 浮点数据。此缓冲区必须按 16 字节对齐。 此外,对于 XApuProcessType::DecodeConvertOpusXApuProcessType::ConvertPCM 两种类型,它还存储尚未准备好输出的已转换数据。 XAPU 在内部将处理缓冲区分为两个段:一个输入段用于未转换的输入 PCM 数据,以及一个输出段用于已转换的输出 PCM 数据。 输入段的长度应始终为 Opus 数据包时长的两倍,即 (2 x 960 x ChannelCount x sizeof(float)) 当已转换的数据少于 XApuConnectInputParameters::maxFrameCountPerOutput 512 时,使用输出段存储已转换的数据。 当设置了 XApuCommandOptions::Flush 时,不会使用输出段,因为 XAPU 会输出数据,即便其少于 XApuConnectInputParameters::maxFrameCountPerOutput 帧。 输出段的长度为 XApuConnectInputParameters::maxFrameCountPerOutput x ChannelCount x sizeof(float) XApuDecodeConvertActivateCommand::processingBufferLength 是每个流的常量,可用于从 1/8 到 8/1 的所有音高值,并且应按以下方式设置: ProcessingBufferLength = (2 x 960 x ChannelCount x sizeof(float)) + (XApuConnectInputParameters::maxFrameCountPerOutput x ChannelCount x sizeof(float))
ChannelCount = 1 或 2
XApuConnectInputParameters::maxFrameCountPerOutput = 256、480、512、960 或 1024。

Remarks

XApuDecodeConvertActivateCommand 使用它来解码和转换激活参数。有关 XApuCommandId 成员的信息,请参阅 XApuCommandId。有关 XApuProcessType 常量的信息,请参阅 XApuProcessType

Requirements

头文件: xapu.h 支持的平台: XBOX Series X|S

See also

XApuEnqueueCommand
XAPU
最后修改于 2026年8月24日