struct SHAPE_XMA_CONTEXT {
UINT32 sizeRead0 : 12;
UINT32 numLoops : 8;
UINT32 validBuffer : 2;
UINT32 sizeWrite : 5;
UINT32 offsetWrite : 5;
UINT32 sizeRead1 : 12;
UINT32 loopSubframeEnd : 2;
UINT32 reserved1 : 3;
UINT32 loopSubframeSkip : 3;
UINT32 numSubframeToDecode : 4;
UINT32 numSubframesToSkip : 3;
UINT32 sampleRate : 2;
UINT32 numChannels : 1;
UINT32 reserved2 : 1;
UINT32 validWrite : 1;
UINT32 offsetRead : 26;
UINT32 errorStatus : 5;
UINT32 errorSet : 1;
UINT32 loopStartOffset : 26;
UINT32 parserErrorStatus : 5;
UINT32 parserErrorSet : 1;
UINT32 loopEndOffset : 26;
UINT32 packetMetaData : 5;
UINT32 currentBuffer : 1;
UINT32 ptrRead0;
UINT32 ptrRead1;
UINT32 ptrWrite;
UINT32 ptrOverlapAdd;
UINT32 writeBufferOffsetRead : 5;
UINT32 reserved3 : 25;
UINT32 stopWhenDone : 1;
UINT32 interruptWhenDone : 1;
UINT32 reserved4[2];
UINT32 reserved5[1];
};
sizeRead0
First 16-byte chunk. Write: Size of input buffer 0 in 2KB blocks.
numLoops
Read/write: Number of loops (255 = infinite).
validBuffer
Read/write: Input buffer valid flags: 00 = neither, 01 = buffer 0 (left), 10 = buffer 1 (right), 11 = both.
sizeWrite
Write: Size of output buffer in 256 byte blocks.
offsetWrite
Read: Offset into output buffer in 256 byte blocks where the hardware will write.
sizeRead1
Write: Size of input buffer 1 in 2KB blocks.
loopSubframeEnd
Write: Subframe number of loop end point, inclusive.
reserved1
Reserved.
loopSubframeSkip
Write: Number of subframes to skip before decoding and outputting data at the loop start point (valid values are 1, 2, 3, and 4).
numSubframeToDecode
Write: Number of subframes to decode per pass. Valid values are 1, 2, 4, and 8.
numSubframesToSkip
Write: Number of subframes to skip. Valid values are 0, 1, 2, 3, and 4.
sampleRate
Write: Sample rate of the stream. Refer to the SHAPE_XMA_SAMPLE_RATE enumeration.
numChannels
Write: Number of channels in the stream: 0 = mono, 1 = stereo.
reserved2
Reserved.
validWrite
Read/write: Write buffer valid flag: 1 = hardware can write, 0 = hardware cannot write.
offsetRead
Read/write: Offset in bits from the beginning of the input buffer.
errorStatus
An error value.
| Error | Value |
|---|---|
| SHAPE_XMA_ERROR_STATUS_NO_ERROR_OCCURRED_ERRORSET_IS_0 | 0 |
| SHAPE_XMA_ERROR_STATUS_WRITE_BUFFER_INVALID_VALIDWR_IS_0 | 1 |
| SHAPE_XMA_ERROR_STATUS_INSUFFICIENT_WRITE_BUFFER_SPACE_VALIDWR_IS_1 | 2 |
| SHAPE_XMA_ERROR_STATUS_READ_BUFFER_INVALID_VALIDBUFFER_CURRBUF_IS_0 | 4 |
| SHAPE_XMA_ERROR_STATUS_FRAME_CROSSES_BOUNDARY_INTO_INVALID_READ_BUFFER_VALIDBUFFER_CURRBUF_IS_0 | 8 |
| SHAPE_XMA_ERROR_STATUS_FRAME_CROSSES_BOTH_READ_BUFFER_BOUNDARIES | 16 |
errorSet
Flag, set to 1 if an error has occured.
loopStartOffset
Write: Specifies the bit offset from the read buffer pointer where hardware should start decoding.
parserErrorStatus
Read: A parser error.
| Error | Value |
|---|---|
| SHAPE_XMA_PARSER_ERROR_STATUS_UNKNOWN_STATE | 1 |
| SHAPE_XMA_PARSER_ERROR_STATUS_OUT_OF_RANGE | 2 |
| SHAPE_XMA_PARSER_ERROR_STATUS_FRAME_SIZE_EXCEEDED | 3 |
| SHAPE_XMA_PARSER_ERROR_STATUS_BITSTREAM_CORRUPTION | 4 |
| SHAPE_XMA_PARSER_ERROR_STATUS_BARKVLC_ERROR | 5 |
| SHAPE_XMA_PARSER_ERROR_STATUS_BARKRLC_ERROR | 6 |
| SHAPE_XMA_PARSER_ERROR_STATUS_VLC4D_ERROR | 7 |
| SHAPE_XMA_PARSER_ERROR_STATUS_VLC2D_ERROR | 8 |
| SHAPE_XMA_PARSER_ERROR_STATUS_VLC1D_ERROR | 9 |
| SHAPE_XMA_PARSER_ERROR_STATUS_RLC0_ERROR | 10 |
| SHAPE_XMA_PARSER_ERROR_STATUS_RLC1_ERROR | 11 |
| SHAPE_XMA_PARSER_ERROR_STATUS_LARGEVAL24_ERROR | 15 |
parserErrorSet
Read: True when a parser error occured. See parserErrorStatus.
loopEndOffset
Second 16-byte chunk. Write: Specifies the bit offset from the read buffer pointer where hardware should end decoding.
packetMetaData
For internal use only.
currentBuffer
Read/write: Current buffer. 0 = buffer 0, 1 = buffer 1.
ptrRead0
Write: Pointer to input buffer 0 (2KB aligned - lower 11 bits are ignored).
ptrRead1
Write: Pointer to input buffer 1 (2KB aligned - lower 11 bits are ignored).
ptrWrite
Write: Pointer to output buffer (64B aligned).
ptrOverlapAdd
Third 16-byte chunk. Write: Pointer to working buffer (128B aligned).
writeBufferOffsetRead
Write: Software read pointer offset into output buffer in 256 byte blocks.
reserved3
Reserved.
stopWhenDone
For internal use only.
interruptWhenDone
For internal use only.
reserved4
Reserved.
reserved5
Pad structure size to 64 bytes.
The fields marked as Read: are written to by the ACP library and should only be read by your application. The fields marked Write: are set by your application and not changed by the ACP library. The fields marked Read:write are set by your application but can be changed by the ACP library.
The maximum size of an input buffer is 8 Mbytes. In order to determine the status of input buffer consumption, examine the offsetRead, currentBuffer and validBuffer parameters.
Header: Declared in shapexmacontext.h.
Library: Use acphal.lib.