PIP_alloc
Application Program Interface
2-271
Important Note:
This API is being deprecated and will no longer be
supported in the next major release of DSP/BIOS. We recommend that
you use the SIO module instead. The PIP module is still supported in
DSP/BIOS 5.32 and will be supported in any patch releases or minor
enhancements to DSP/BIOS 5.32.
C Interface
Syntax
PIP_alloc(pipe);
Parameters
PIP_Handle pipe;
/* pipe object handle */
Return Value
Void
Reentrant
no
Description
PIP_alloc allocates an empty frame from the pipe you specify. You can
write to this frame and then use PIP_put to put the frame into the pipe.
If empty frames are available after PIP_alloc allocates a frame, PIP_alloc
runs the function specified by the notifyWriter property of the PIP object.
This function should notify (for example, by calling SWI_andnHook) the
object that writes to this pipe that an empty frame is available. The
notifyWriter function is performed as part of the thread that calls PIP_free
or PIP_alloc. To avoid problems with recursion, the notifyWriter function
should not directly call any PIP module functions for the same pipe.
Constraints and
Calling Context
❏
Before calling PIP_alloc, a function should check the
writerNumFrames member of the PIP_Obj structure by calling
PIP_getWriterNumFrames to make sure it is greater than 0 (that is,
at least one empty frame is available).
❏
PIP_alloc can only be called one time before calling PIP_put. You
cannot operate on two frames from the same pipe simultaneously.
Example
Void copy(HST_Obj *input, HST_Obj *output)
{
PIP_Obj *in, *out;
Uns *src, *dst;
Uns size;
in = HST_getpipe(input);
out = HST_getpipe(output);
PIP_alloc
Allocate an empty frame from a pipe