struct StreamReadParams { DWORD_PTR dwUserData; EStreamTaskPriority ePriority; uint8 nPerceptualImportance; unsigned nLoadTime; unsigned nMaxLoadTime; void* pBuffer; unsigned nOffset; unsigned nSize; EStreamSourceMediaType eMediaType; unsigned nFlags; };
IStreamEngine.h
This is used as parameter to the asynchronous read function all the unnecessary parameters go here, because there are many of them.
The user data that'll be used to call the callback.
DWORD_PTR dwUserData;
EStreamSourceMediaType eMediaType;
Media type to use when starting file request - if wrong, the request may take longer to complete
EStreamTaskPriority ePriority;
The priority of this read
unsigned nFlags;
The combination of one or several flags from the stream engine general purpose flags.
unsigned nLoadTime;
The desirable loading time, in milliseconds, from the time of call 0 means as fast as possible (desirably in this frame).
unsigned nMaxLoadTime;
The maximum load time, in milliseconds. 0 means forever. If the read lasts longer, it can be discarded. WARNING: avoid too small max times, like 1-10 ms, because many loads will be discarded in this case.
unsigned nOffset;
Offset in the file to read; if this is not 0, then the file read occurs beginning with the specified offset in bytes. The callback interface receives the size of already read data as nSize and generally behaves as if the piece of file would be a file of its own.
uint8 nPerceptualImportance;
Value from 0-255 of the perceptual importance of the task (used for debugging task sheduling)
unsigned nSize;
Number of bytes to read; if this is 0, then the whole file is read, if nSize == 0 && nOffset != 0, then the file from the offset to the end is read. If nSize != 0, then the file piece from nOffset is read, at most nSize bytes (if less, an error is reported). So, from nOffset byte to nOffset + nSize - 1 byte in the file.
void* pBuffer;
The buffer into which to read the file or the file piece if this is NULL, the streaming engine will supply the buffer. Notes: DO NOT USE THIS BUFFER during read operation! DO NOT READ from it, it can lead to memory corruption!
StreamReadParams();
StreamReadParams(DWORD_PTR _dwUserData, EStreamTaskPriority _ePriority = estpNormal, unsigned _nLoadTime = 0, unsigned _nMaxLoadTime = 0, unsigned _nOffset = 0, unsigned _nSize = 0, void* _pBuffer = NULL, unsigned _nFlags = 0);