int error = StreamSamples(APTR handle, struct StreamSamplesCtrl *ctrl);
struct StreamSamplesCtrl
to this function. This structure looks like this:
struct StreamSamplesCtrl { APTR Buffer; // [in] int Request; // [in] int Written; // [out] int Done; // [out] }; |
Here is the meaning of the individual members:
Buffer:
Request:
Written:
Buffer
. Once again, the value is
specified in PCM frames, not in bytes.
Done:
True
if the stream end has been reached. Otherwise set it to False
.
StreamSamples()
must return an error code or 0 for success.
This function must be implemented in a thread-safe way. Hollywood will usually call this function from a helper thread so make sure that your implementation is thread-safe.
struct StreamSamplesCtrl
containing Hollywood's request