XDAIS
dais-x04
|
Defines the fields and methods that must be supplied by all XDAIS algorithms. More...
#include <ialg.h>
Data Fields | |
Void * | implementationId |
Unique pointer that identifies the module implementing this interface. | |
Void(* | algActivate )(IALG_Handle handle) |
Notification to the algorithm that its memory is "active" and algorithm processing methods may be called. | |
Int(* | algAlloc )(const IALG_Params *params, struct IALG_Fxns **parentFxns, IALG_MemRec *memTab) |
Apps call this to query the algorithm about its memory requirements. Must be non-NULL. | |
Int(* | algControl )(IALG_Handle handle, IALG_Cmd cmd, IALG_Status *status) |
Algorithm specific control and status. | |
Void(* | algDeactivate )(IALG_Handle handle) |
Save all persistent data to non-scratch memory. | |
Int(* | algFree )(IALG_Handle handle, IALG_MemRec *memTab) |
Apps call this to allow the algorithm to initialize memory requested via algAlloc(). Must be non-NULL. | |
Int(* | algInit )(IALG_Handle handle, const IALG_MemRec *memTab, IALG_Handle parent, const IALG_Params *params) |
Initialize an algorithm's instance object. Must be non-NULL. | |
Void(* | algMoved )(IALG_Handle handle, const IALG_MemRec *memTab, IALG_Handle parent, const IALG_Params *params) |
Notify algorithm instance that instance memory has been relocated. | |
Int(* | algNumAlloc )(Void) |
Number of memory allocation requests required. |
Defines the fields and methods that must be supplied by all XDAIS algorithms.
Void* IALG_Fxns::implementationId |
Unique pointer that identifies the module implementing this interface.
Void(* IALG_Fxns::algActivate)(IALG_Handle handle) |
Notification to the algorithm that its memory is "active" and algorithm processing methods may be called.
[in] | handle | Handle to an algorithm instance. |
NULL
. This is equivalent to the following implementation: handle
must be a valid handle for the algorithm's instance object.Int(* IALG_Fxns::algAlloc)(const IALG_Params *params, struct IALG_Fxns **parentFxns, IALG_MemRec *memTab) |
Apps call this to query the algorithm about its memory requirements. Must be non-NULL.
[in] | params | Algorithm specific attributes. |
[out] | parentFxns | Parent algorithm functions. |
[out] | memTab | array of memory records. |
NULL
; however, in this case, algAlloc() must assume default creation parameters and must not fail.memTab
[] is no less than the number returned by algNumAlloc().*parentFxns
is a valid pointer to an IALG_Fxns pointer variable.*parentFxns
is set to a non-NULL value that points to a valid IALG_Fxns structure, the parent's IALG implementation. Otherwise, this pointer is not set. algAlloc() may elect to ignore the parentFxns
pointer altogether.NULL
, thereby requiring the memory for the buffer to be provided by the client.n
elements of the memTab
[] array are initialized, where n
is the return value from this operation.memTab
with an IALG_PERSIST or IALG_SCRATCH attribute, the algorithm does not set its base field.memTab
[0] defines the memory required for the instance's object and this object's first field is an IALG_Obj structure.memTab
[0] is requested as persistent memory.Int(* IALG_Fxns::algControl)(IALG_Handle handle, IALG_Cmd cmd, IALG_Status *status) |
Algorithm specific control and status.
[in] | handle | Algorithm instance handle. |
[in] | cmd | Algorithm specific command. |
[out] | status | Algorithm specific status. |
cmd
, and an input/output status buffer pointer to an algorithm's instance object.NULL
. This is equivalent to the following implementation: handle
must be a valid handle for the algorithm's instance object.cmd
values are always less than IALG_SYSCMD.cmd
value is not recognized by the algorithm, the return value is not equal to IALG_EOK.Void(* IALG_Fxns::algDeactivate)(IALG_Handle handle) |
Save all persistent data to non-scratch memory.
[in] | handle | Algorithm instance handle. |
handle
is used by the algorithm to identify the various buffers that must be saved prior to the next cycle of algActivate() and processing.NULL
. This is equivalent to the following implementation: handle
must be a valid handle for the algorithm's instance object.Int(* IALG_Fxns::algFree)(IALG_Handle handle, IALG_MemRec *memTab) |
Apps call this to allow the algorithm to initialize memory requested via algAlloc(). Must be non-NULL.
[in] | handle | Algorithm instance handle. |
[out] | memTab | Output array of memory records. |
handle
. This function always returns a positive non-zero value indicating the number of records initialized. This function can never initialize more memory records than the value returned by algNumAlloc().memTab
[] array contains at least algNumAlloc() records.handle
must be a valid handle for the algorithm's instance object.memTab
[] contains pointers to all of the memory passed to the algorithm via algInit().Int(* IALG_Fxns::algInit)(IALG_Handle handle, const IALG_MemRec *memTab, IALG_Handle parent, const IALG_Params *params) |
Initialize an algorithm's instance object. Must be non-NULL.
[in] | handle | Algorithm instance handle. This is a pointer to an initialized IALG_Obj structure. Its value is identical to the memTab[0].base . |
[in] | memTab | Array of allocated buffers. |
[in] | parent | Handle of algorithm's parent instance. |
[in] | params | Pointer to algorithm's instance parameters. |
handle
is a pointer to an initialized IALG_Obj structure. Its value is identical to the memTab[0].base
.memTab
is a table of memory records that describe the base address, size, alignment, type, and memory space of all buffers allocated for an algorithm instance (including the algorithm's instance object itself). The number of initialized records is identical to the number returned by a prior call to algAlloc().parent
is a handle to another algorithm instance object. This parameter is often NULL; indicating that no parent object exists. This parameter allows clients to create a shared algorithm instance object and pass it to other algorithm instances. For example, a parent instance object might contain global read-only tables that are used by several instances of a vocoder.params
is a pointer to algorithm-specific parameters that are necessary for the creation and initialization of the instance object. This pointer points to the same parameters passed to the algAlloc() operation. However, this pointer may be NULL. In this case, algInit(), must assume default creation parameters.memTab
contains pointers to non-overlapping buffers with the size and alignment requested via a prior call to algAlloc(). In addition, the algorithm parameters, params, passed to algAlloc() are identical to those passed to this operation.handle
must be a valid handle for the algorithm's instance object; i.e., handle == memTab[0].base
and handle->fxns
is initialized to point to the appropriate IALG_Fxns structure.memTab
entry, the client must provide the memory resource with the requested size and alignment.parent
, must be a valid handle to an instance object created via that function pointer.parent
is non-NULL, no other method is currently being run on the parent instance; i.e., this method never preempts any other method on the parent instance.memTab
[] entry, the client may pass back the same address in the base field without allocating additional memory for that persistent write-once buffer. Alternatively, the client may treat IALG_WRITEONCE buffers in the same way as IALG_PERSIST buffers; by allocating new memory and granting it to the algorithm using the base field.memTab
[0] is initialized with a pointer to the appropriate IALG_Fxns structure followed by all 0s.IALG_EOK | Successful return status code. |
IALG_EFAIL | Unspecified error return status code. |
Custom error | Algorithm-specific error - see algorithm's documentation. |
Void(* IALG_Fxns::algMoved)(IALG_Handle handle, const IALG_MemRec *memTab, IALG_Handle parent, const IALG_Params *params) |
Notify algorithm instance that instance memory has been relocated.
[in] | handle | Algorithm instance handle. |
[in] | memTab | Array of allocated buffers. |
[in] | parent | Handle of algorithm's parent instance. |
[in] | params | Pointer to algorithm's instance parameters. |
NULL
. This is equivalent to asserting that the algorithm's instance objects cannot be moved. Int(* IALG_Fxns::algNumAlloc)(Void) |
Number of memory allocation requests required.
NULL
.