Codec Engine Application Programming Interface (API)
ce-w08
|
Data Structures | |
struct | Server_AlgDesc |
struct | Server_MemStat |
Information for a memory heap of a remote DSP server. More... |
Macros | |
#define | Server_MODNAME "ti.sdo.ce.Server" |
Name to pass to Diags_setMask() to enable logging for Server functions. For example, Diags_setMask(Server_MODNAME"+EX1234567"); turns on all Log statements in this module. Diags_setMask() must be called after initialization to take effect. | |
#define | Server_MAXSEGNAMELENGTH 32 |
Maximum number of characters used in memory segment names. |
Typedefs | |
typedef enum Server_Status | Server_Status |
Server error code. | |
typedef struct Server_AlgDesc | Server_AlgDesc |
typedef struct Server_MemStat | Server_MemStat |
Information for a memory heap of a remote DSP server. |
Enumerations | |
enum | Server_Status { Server_EOK = 0, Server_ENOSERVER = 1, Server_ENOMEM = 2, Server_ERUNTIME = 3, Server_EINVAL = 4, Server_EWRONGSTATE = 5, Server_EINUSE = 6, Server_ENOTFOUND = 7, Server_EFAIL = 8, Server_ENOTSUPPORTED = 9 } |
Server error code. More... |
Functions | |
Server_Status | Server_addAlg (Server_Handle server, String location, Server_AlgDesc *pAlgDesc) |
Dynamically add an algorithm to a Server. | |
Server_Status | Server_connectTrace (Server_Handle server, Int *token) |
Connect to server for purposes of collecting trace and/or LOG data. | |
Server_Status | Server_disconnectTrace (Server_Handle server, Int token) |
Disconnect from server when finished collecting trace and/or LOG data. | |
Int | Server_fwriteTrace (Server_Handle server, String prefix, FILE *out) |
Write Server's trace buffer to specifed file stream. | |
Int | Server_getCpuLoad (Server_Handle server) |
Get Server's CPU usage in percent. | |
Server_Status | Server_getMemStat (Server_Handle server, Int segNum, Server_MemStat *memStat) |
Get information on a memory heap segment of a remote DSP server. | |
Server_Status | Server_getNumMemSegs (Server_Handle server, Int *numSegs) |
Get the number of memory heap segments of a remote DSP server. | |
Void | Server_initAlgDesc (Server_AlgDesc *pAlgDesc) |
Initialize an Server_AlgDesc structure with default values. | |
Server_Status | Server_redefineHeap (Server_Handle server, String name, Uint32 base, Uint32 size) |
Set the base address and size of a remote DSP server heap. | |
Server_Status | Server_restoreHeap (Server_Handle server, String name) |
Set the base address and size of a remote DSP server heap back to their original values. | |
Int | Server_setTrace (Server_Handle server, String mask) |
Set Server's trace mask. |
#define Server_MODNAME "ti.sdo.ce.Server" |
Name to pass to Diags_setMask() to enable logging for Server functions. For example, Diags_setMask(Server_MODNAME"+EX1234567"); turns on all Log statements in this module. Diags_setMask() must be called after initialization to take effect.
#define Server_MAXSEGNAMELENGTH 32 |
Maximum number of characters used in memory segment names.
typedef enum Server_Status Server_Status |
Server error code.
typedef struct Server_AlgDesc Server_AlgDesc |
typedef struct Server_MemStat Server_MemStat |
Information for a memory heap of a remote DSP server.
enum Server_Status |
Server error code.
Server_Status Server_addAlg | ( | Server_Handle | server, |
String | location, | ||
Server_AlgDesc * | pAlgDesc | ||
) |
Dynamically add an algorithm to a Server.
[in] | server | The handle of a server returned by Engine_getServer(). Set to NULL when adding a local algorithm to the server. In the future, this handle will be used to dynamically add algorithms to a remote server. |
[in] | location | String identifying the location of the algorithm. Often this is a file name, but for systems without a file system, it may be a system-specific string identifier. This may be NULL if the algorithm is built into the executable. Currently not supported - set to NULL. |
[in] | pAlgDesc | Parameters describing the algorithm being added. Before setting the fields of this structure, it should first be initialized with Server_initAlgDesc() , to set all fields to default values. |
The user must set the following fields of pAlgDesc: pAlgDesc->name pAlgDesc->fxns pAlgDesc->idmaFxns, if applicable pAlgDesc->iresFxns, if applicable
pAlgDesc->groupId pAlgDesc->priority pAlgDesc->stackSize
pAlgDesc->types pAlgDesc->stubFxnsName pAlgDesc->skelFxns
Currently, adding only local algorithms is supported, so the default value of TRUE can be used for: pAlgDesc->isLocal
name
, an error will be returned.Server_EOK | Success. |
Server_EINVAL | pAlgDesc or pAlgDesc->name is NULL. |
Server_EINUSE | The name of the alg in pAlgDesc->name is already in use. |
Server_ENOTSUPPORTED | pAlgDesc->isLocal = FALSE is currently not supported. |
Server_Status Server_connectTrace | ( | Server_Handle | server, |
Int * | token | ||
) |
Connect to server for purposes of collecting trace and/or LOG data.
[in] | server | Server handle obtained from Engine_getServer(). |
[in] | token | Address to store connection token. This token should be specified in the companion call to Server_disconnectTrace(). |
Server_EOK | Success, trace token was acquired. |
Server_EINUSE | A connection for server trace is already established. |
Server_ERUNTIME | An internal runtime error occurred. |
server
is non-NULL. token
is non-NULL.Server_Status Server_disconnectTrace | ( | Server_Handle | server, |
Int | token | ||
) |
Disconnect from server when finished collecting trace and/or LOG data.
[in] | server | Server handle obtained from Engine_getServer(). |
[in] | token | Connection token (as obtained from earlier, companion call to Server_connectTrace()). |
Server_EOK | Success. |
Server_ERUNTIME | An internal runtime error occurred. |
server
is non-NULL.Int Server_fwriteTrace | ( | Server_Handle | server, |
String | prefix, | ||
FILE * | out | ||
) |
Write Server's trace buffer to specifed file stream.
[in] | server | Server handle, obtained from Engine_getServer(). |
[in] | prefix | A string to prepend to each line output; this allows one to easily identify trace from the server from the application's trace, for example. |
[in] | out | An open FILE stream used to output the Server's trace characters. |
Integer | number of characters copied to the specified FILE stream. |
server
is non-NULL. Corresponding
engine is in the open state.Int Server_getCpuLoad | ( | Server_Handle | server | ) |
Get Server's CPU usage in percent.
[in] | server | Server handle, obtained from Engine_getServer(). |
Integer | between 0-100 indicating percentage of time the Server is processing measured over a period of approximately 1 second. If the load is unavailable, a negative value is returned. |
server
is non-NULL.Server_Status Server_getMemStat | ( | Server_Handle | server, |
Int | segNum, | ||
Server_MemStat * | memStat | ||
) |
Get information on a memory heap segment of a remote DSP server.
[in] | server | Server handle obtained from Engine_getServer(). |
[in] | segNum | The heap number of a segment on the DSP. |
[out] | memStat | Structure to store memory segment information. |
Server_EOK | Success. |
Server_ENOTFOUND | segNum is out of range. |
Server_ERUNTIME | Internal runtime error occurred. |
server
is non-NULL. memStat
is non-NULL.segNum
on the DSP.Server_Status Server_getNumMemSegs | ( | Server_Handle | server, |
Int * | numSegs | ||
) |
Get the number of memory heap segments of a remote DSP server.
[in] | server | Server handle obtained from Engine_getServer(). |
[out] | numSegs | The number of heap segments of the DSP server. |
Server_EOK | Success. |
Server_ERUNTIME | Internal runtime error occurred. |
Server_ENOSERVER | Engine has no server. |
server
is non-NULL. numSegs
is non-NULL.Void Server_initAlgDesc | ( | Server_AlgDesc * | pAlgDesc | ) |
Initialize an Server_AlgDesc structure with default values.
[in] | pAlgDesc | Location of Server_AlgDesc object to initialize. The fields of pAlgDesc will be set to the following: pAlgDesc->name = NULL;
pAlgDesc->uuid.data = 0;
pAlgDesc->fxns = NULL;
pAlgDesc->idmaFxns = NULL;
pAlgDesc->typeTab = NULL;
pAlgDesc->isLocal = TRUE;
pAlgDesc->groupId = 0;
pAlgDesc->iresFxns = NULL;
pAlgDesc->codecClassConfig = NULL;
pAlgDesc->priority = 1;
pAlgDesc->stackSize = 1024;
pAlgDesc->types = NULL;
pAlgDesc->stubFxnsName = NULL;
pAlgDesc->skelFxns = NULL;
Unused fields below are initialized to the
following:
pAlgDesc->rpcProtocolVersion = 0;
pAlgDesc->memType = Engine_USECACHEDMEM_DEFAULT;
pAlgDesc->stackSeg = 0;
|
Server_Status Server_redefineHeap | ( | Server_Handle | server, |
String | name, | ||
Uint32 | base, | ||
Uint32 | size | ||
) |
Set the base address and size of a remote DSP server heap.
base
to base
+ size
must be contiguous in physical memory. The size of the heap should be given in DSP MADUs (minimum addressable data units). The name of the heap can be at most Server_MAXSEGNAMELENGTH characters long.For example, in the case of DM644x, suppose that an application wants to allocate a block of memory on the GPP to be used by the DSP server for the memory segment named "DDRALGHEAP". A block of physically contiguous memory could be obtained by Memory_alloc() and the corresponding DSP address obtained with Memory_getBufferPhysicalAddress(). This DSP address and the size of the block could then be passed to Server_redefineHeap(). For example:
This function can only be called when there is no memory currently allocated in the heap (since the heap cannot be changed if it is being used).
[in] | server | Server handle obtained from Engine_getServer(). |
[in] | name | Name of heap to be redefined. |
[in] | base | Base address for algorithm heap. |
[in] | size | Size (DSP MADUs) of new heap. |
Server_EOK | Success. |
Server_ERUNTIME | Internal runtime error occurred. |
Server_ENOTFOUND | No heap with the specified name was found. |
Server_EINVAL | Changing to the new base and size would cause an overlap with another heap. |
Server_EINUSE | Memory is currently allocated in the heap. |
server
is non-NULL. base
is a DSP address of a physically contiguous block of memory. base
is aligned on an 8-byte boundary.base
, and the size will have been set to size
.Server_Status Server_restoreHeap | ( | Server_Handle | server, |
String | name | ||
) |
Set the base address and size of a remote DSP server heap back to their original values.
This function resets the base address and size of a named heap of the remote server, back to their values before the first call to Server_redefineHeap() was made. The name of the heap can be at most Server_MAXSEGNAMELENGTH characters long, otherwise this function will return Server_ENOTFOUND.
As with Server_redefineHeap(), this function can only be called when no memory is currently allocated from the heap (as the heap cannot be changed if it is being used).
[in] | server | Server handle obtained through Engine_getServer(). |
[in] | name | Name of the heap to be restored. |
Server_EOK | Success. |
Server_ERUNTIME | Internal runtime error occurred. |
Server_ENOTFOUND | No heap with the specified name was found. |
Server_EINVAL | Changing back to the original base and size would cause an overlap with another heap. |
Server_EINUSE | Memory is currently allocated in the heap. |
server
is non-NULL.Int Server_setTrace | ( | Server_Handle | server, |
String | mask | ||
) |
Set Server's trace mask.
[in] | server | Server handle obtained through Engine_getServer(). |
[in] | mask | Trace mask, e.g. "*=01234567" |
Server_EOK | Success. |
Server_EINUSE | A connection for server trace is already established. |
Server_ENOSERVER | No server for the engine. |
Server_ERUNTIME | Internal runtime error occurred. |
server
is non-NULL. Corresponding
engine is in the open state.