Data Structures | |
struct | Engine_Attrs |
Attributes of an Engine. More... | |
struct | Engine_AlgInfo |
Properties of an Engine algorithm. More... | |
struct | Engine_AlgInfo2 |
Properties of an Engine algorithm. This structure is identical to Engine_AlgInfo except that the typeTab array of strings is replaced by a singie string called types . The string, types , represents a ';' separated list of inheritance hierarchies of the algorithm, for example, "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE". More... | |
Defines | |
#define | CE_NULL_algs NULL |
#define | CE_DECLARE_TYPE(name, types) |
Declare an inheritanc hierarchy for an algorithm. | |
#define | CE_LOCAL_ALG(name, algName, ialgFxns, idma3Fxns, iresFxns, groupId, memType) |
Generates a structure containing data for a local algorithm. This macro must be called between the CE_BEGIN_ALG_TABLE() and CE_END_ALG_TABLE() macro calls. It is used in this manner:. | |
#define | CE_BEGIN_ALG_TABLE(name) static Engine_AlgDesc CE_##name##_algs[] = { |
Use this macro and the CE_END_ALG_TABLE() macro around CE_LOCAL_ALG() to generate an algorithm table for an engine. The usage is: CE_BEGIN_ALG_TABLE(engineAlgTab) CE_LOCAL_ALG(name_1, ...) CE_LOCAL_ALG(name_2, ...) ... CE_LOCAL_ALG(name_n, ...) CE_END_ALG_TABLE(engineAlgTab). | |
#define | CE_END_ALG_TABLE(name) |
Use this macro after CE_BEGIN_ALG_TABLE() and CE_LOCAL_ALG() for generating an algorithm table for an engine. The usage is: CE_BEGIN_ALG_TABLE(engineAlgTab) CE_LOCAL_ALG(name_1, ...) CE_LOCAL_ALG(name_2, ...) ... CE_LOCAL_ALG(name_n, ...) CE_END_ALG_TABLE(engineAlgTab). | |
#define | CE_ENGINE(algTab, engineName, serverName) |
Generates a structure containing data for an engine. This macro must be called between the CE_BEGIN_ENGINE_TABLE() and CE_END_ENGINE_TABLE() macro calls. It is used in this manner:. | |
#define | CE_BEGIN_ENGINE_TABLE(name) |
Use this macro and the CE_END_ENGINE_TABLE() macro around CE_ENGINE() to generate an engine table for the applicaion. The usage is: CE_BEGIN_ENGINE_TABLE(name) CE_ENGINE(algTab_1, ...) CE_ENGINE(algTab_2, ...) ... CE_ENGINE(algTab_n, ...) CE_END_ENGINE_TABLE(name). | |
#define | CE_END_ENGINE_TABLE(name) |
Use this macro and the CE_BEGIN_ENGINE_TABLE() macro around CE_ENGINE() to generate an engine table for the applicaion. The usage is: CE_BEGIN_ENGINE_TABLE(name) CE_ENGINE(algTab_1, ...) CE_ENGINE(algTab_2, ...) ... CE_ENGINE(algTab_n, ...) CE_END_ENGINE_TABLE(name). | |
#define | Engine_GTNAME "CE" |
Trace name for the Engine module. | |
#define | Engine_EOK 0 |
#define | Engine_EEXIST 1 |
#define | Engine_ENOMEM 2 |
#define | Engine_EDSPLOAD 3 |
#define | Engine_ENOCOMM 4 |
#define | Engine_ENOSERVER 5 |
#define | Engine_ECOMALLOC 6 |
#define | Engine_ERUNTIME 7 |
#define | Engine_ECODECCREATE 8 |
#define | Engine_ECODECSTART 9 |
#define | Engine_EINVAL 10 |
#define | Engine_EBADSERVER 11 |
#define | Engine_ENOTAVAIL 12 |
#define | Engine_EWRONGSTATE 13 |
#define | Engine_EINUSE 14 |
#define | Engine_ENOTFOUND 15 |
#define | Engine_ETIMEOUT 16 |
Typedefs | |
typedef struct Engine_Obj * | Engine_Handle |
Opaque handle to an engine. | |
typedef Int | Engine_Error |
Engine error code. | |
Functions | |
Void | CERuntime_exit (Void) |
Exit the Codec Engine Runtime. | |
Void | CERuntime_init (Void) |
Initialize the Codec Engine Runtime. | |
Void | Engine_close (Engine_Handle engine) |
Close an Engine. | |
Engine_Handle | Engine_open (String name, Engine_Attrs *attrs, Engine_Error *ec) |
Open an Engine. | |
Int | Engine_fwriteTrace (Engine_Handle engine, String prefix, FILE *out) |
Write Server's trace buffer to specifed file stream. | |
Engine_Error | Engine_getAlgInfo (String name, Engine_AlgInfo *algInfo, Int index) |
Get details of an algorithm configured into an engine. | |
Engine_Error | Engine_getAlgInfo2 (String name, Engine_Handle engine, Engine_AlgInfo2 *algInfo2, Int index) |
Get details of an algorithm that is configured into an engine, or has been added to an opened engine. If the engine has not been opened yet, the name of the engine is used to get the statically configured alg. If the engine has been opened, the engine handle can be used to get either information for a statically configured alg, or a remote alg that was added when the server was queried during Engine_open(). | |
Int | Engine_getCpuLoad (Engine_Handle engine) |
Get Server's cpu usage in percent. | |
Engine_Error | Engine_getLastError (Engine_Handle engine) |
Get error code of the last failed operation. | |
String | Engine_getName (Engine_Handle engine) |
Get the name of an opened engine. | |
Engine_Error | Engine_getNumAlgs (String name, Int *numAlgs) |
Get the number of algorithms configured into an engine. | |
Engine_Error | Engine_getNumAlgs2 (String name, Engine_Handle engine, Int *numAlgs) |
Get the number of algorithms statically configured into an engine or the total number of algorithms both statically configured and dynamically added through server information when the engine was opened. | |
Server_Handle | Engine_getServer (Engine_Handle engine) |
Get handle to an Engine's server. | |
UInt32 | Engine_getUsedMem (Engine_Handle engine) |
Get Server's total memory usage. | |
Int | Engine_setTrace (Engine_Handle engine, String mask) |
Set Server's trace mask. | |
Variables | |
Engine_Attrs | Engine_ATTRS |
Default engine attributes. |
#define CE_NULL_algs NULL |
#define CE_DECLARE_TYPE | ( | name, | |||
types | ) |
\
static String typeTab_##name [] = { \
types, \
NULL \
}; \
\
Declare an inheritanc hierarchy for an algorithm.
[in] | name | This is a symbol that will be associated with the types argument. It will be used to generate an internal variable name, so don't use the same name for two different calls to CE_DECLARE_TYPE() . name should be used in CE_LOCAL_ALG() to associate an alg to types . |
[in] | types | This is a ';' separated string of inheritance hierarchies. It is used to identify the codec class of an algorithm. For example, the declaration: CE_DECLARE_TYPE (mydecoder, "ti.sdo.ce.speech1.ISPHDEC1") indicates that mydecoder (a name that will be used in CE_LOCAL_ALG() to declare a speech decoder), inherits the ti.sdo.ce.speech1.ISPHDEC1 interface. |
Another example is the following: CE_DECLARE_TYPE(decoder, "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE") This says that the decoder inherits the ti.sdo.ce.test.xvideo.IVIDE interface, which in turn inherits the ti.sdo.ce.video.IVIDDEC interface.
#define CE_LOCAL_ALG | ( | name, | |||
algName, | |||||
ialgFxns, | |||||
idma3Fxns, | |||||
iresFxns, | |||||
groupId, | |||||
memType | ) |
\ { algName, /* name */ \ {0}, /* uuid */ \ ialgFxns, /* ialgFxns */ \ idma3Fxns, /* idma3Fxns */ \ typeTab_##name, /* typeTab */ \ TRUE, /* isLocal */ \ groupId, /* groupId */ \ 0, /* protocol */ \ iresFxns, /* iresFxns */ \ NULL, /* stub/skel params */ \ memType, /* cached mem type */ \ NULL, /* type - typeTab[0] will be used instead */ \ },
Generates a structure containing data for a local algorithm. This macro must be called between the CE_BEGIN_ALG_TABLE()
and CE_END_ALG_TABLE()
macro calls. It is used in this manner:.
CE_BEGIN_ALG_TABLE(engineName) CE_LOCAL_ALG(name_1, ...) CE_LOCAL_ALG(name_2, ...) ... CE_LOCAL_ALG(name_n, ...) CE_END_ALG_TABLE(engineName)
[in] | name | This symbol is used to associate the algorithm with one of the types passed to CE_DECLARE_TYPE() . |
[in] | algName | This is the string name that the applicaion will use to create the algorithm, for example, "sphenc1_copy". |
[in] | ialgFxns | The address of the IALG_Fxns table for the algorithm. |
[in] | idma3Fxns | The address of the algorithm's IDMA3_Fxns table, if it has one, otherwise NULL. |
[in] | iresFxns | If the algorithm uses IRES, the address of its IRES_Fxns table, otherwise NULL. |
[in] | groupId | Scratch group Id of algorithm. |
[in] | memType | The type of memory (cached, non-cached, or whatever the default is), to allocate for the algorithm. Choose from the following values for memType: |
Engine_USECACHEDMEM_DEFAULT - default memory allocation Engine_USECACHEDMEM_NONCACHED - non-cached memory allocation Engine_USECACHEDMEM_CACHED - cached memory allocation
#define CE_BEGIN_ALG_TABLE | ( | name | ) | static Engine_AlgDesc CE_##name##_algs[] = { |
Use this macro and the CE_END_ALG_TABLE() macro around CE_LOCAL_ALG() to generate an algorithm table for an engine. The usage is: CE_BEGIN_ALG_TABLE(engineAlgTab) CE_LOCAL_ALG(name_1, ...) CE_LOCAL_ALG(name_2, ...) ... CE_LOCAL_ALG(name_n, ...) CE_END_ALG_TABLE(engineAlgTab).
[in] | name | A symbol used to generate internal variable names. Use the same name in CE_END_ALG_TABLE(), and in the call to CE_ENGINE(), to associate an engine with this algorithm table. |
#define CE_END_ALG_TABLE | ( | name | ) |
{NULL}, \ };
Use this macro after CE_BEGIN_ALG_TABLE() and CE_LOCAL_ALG() for generating an algorithm table for an engine. The usage is: CE_BEGIN_ALG_TABLE(engineAlgTab) CE_LOCAL_ALG(name_1, ...) CE_LOCAL_ALG(name_2, ...) ... CE_LOCAL_ALG(name_n, ...) CE_END_ALG_TABLE(engineAlgTab).
[in] | name | This must be the same symbol name passed to the previous CE_BEGIN_ALG_TABLE() call. |
#define CE_ENGINE | ( | algTab, | |||
engineName, | |||||
serverName | ) |
{ engineName, /* engine naem */ \ CE_##algTab##_algs,/* alg table */ \ serverName, /* optional server name */ \ NULL, /* link config id */ \ 0, /* # of algs (filled in at runtime) */ \ },
Generates a structure containing data for an engine. This macro must be called between the CE_BEGIN_ENGINE_TABLE()
and CE_END_ENGINE_TABLE()
macro calls. It is used in this manner:.
CE_BEGIN_ENGINE_TABLE(name) CE_ENGINE(algTab_0, "engine_0", NULL) CE_ENGINE(algTab_1, "engine_1", "server.x64P") CE_END_ENGINE_TABLE(name)
[in] | algTab | Symbol to associate an alg table to this engine. Use the name passed to CE_BEGIN_ALG_TABLE() to associate that alg table with this engine. |
#define CE_BEGIN_ENGINE_TABLE | ( | name | ) |
static Engine_AlgDesc _localAlgs_000[] = { \ {NULL}, \ }; \ \ static Engine_Desc name##_000[] = {
Use this macro and the CE_END_ENGINE_TABLE() macro around CE_ENGINE() to generate an engine table for the applicaion. The usage is: CE_BEGIN_ENGINE_TABLE(name) CE_ENGINE(algTab_1, ...) CE_ENGINE(algTab_2, ...) ... CE_ENGINE(algTab_n, ...) CE_END_ENGINE_TABLE(name).
[in] | name | A symbol used to generate internal variable names. Use the same name in CE_END_ENGINE_TABLE(). |
#define CE_END_ENGINE_TABLE | ( | name | ) |
{"local", \ _localAlgs_000, \ NULL, \ NULL, \ 0, \ }, \ {NULL, NULL, NULL, NULL, 0} \ }; \ \ Engine_Config Engine_config = { \ name##_000, \ "local" \ };
Use this macro and the CE_BEGIN_ENGINE_TABLE() macro around CE_ENGINE() to generate an engine table for the applicaion. The usage is: CE_BEGIN_ENGINE_TABLE(name) CE_ENGINE(algTab_1, ...) CE_ENGINE(algTab_2, ...) ... CE_ENGINE(algTab_n, ...) CE_END_ENGINE_TABLE(name).
[in] | name | A symbol used to generate internal variable names. Use the same name in CE_BEGIN_ENGINE_TABLE(). |
#define Engine_GTNAME "CE" |
Trace name for the Engine module.
#define Engine_EOK 0 |
Success.
#define Engine_EEXIST 1 |
Name does not exist.
#define Engine_ENOMEM 2 |
Unable to allocate memory.
#define Engine_EDSPLOAD 3 |
Unable to load the DSP.
#define Engine_ENOCOMM 4 |
Unable to create a comm connection to the DSP.
#define Engine_ENOSERVER 5 |
Unable to locate the server on the DSP.
#define Engine_ECOMALLOC 6 |
Unable to allocate communication buffer.
#define Engine_ERUNTIME 7 |
Internal engine runtime failure.
#define Engine_ECODECCREATE 8 |
Creation of the Codec failed.
#define Engine_ECODECSTART 9 |
Start of the Codec failed. For codecs which are implemented as a thread, this implies that the codec thread of execution failed to start.
#define Engine_EINVAL 10 |
Bad paramater passed to method.
#define Engine_EBADSERVER 11 |
Incompatible server specified.
#define Engine_ENOTAVAIL 12 |
Service not available.
#define Engine_EWRONGSTATE 13 |
Call can not be made at this time.
#define Engine_EINUSE 14 |
Call can't be made at this time because a required name/resource is in use.
#define Engine_ENOTFOUND 15 |
Entity was not found.
#define Engine_ETIMEOUT 16 |
Timeout-based operation timed out.
typedef struct Engine_Obj* Engine_Handle |
Opaque handle to an engine.
typedef Int Engine_Error |
Engine error code.
Void CERuntime_exit | ( | Void | ) |
Exit the Codec Engine Runtime.
Void CERuntime_init | ( | Void | ) |
Initialize the Codec Engine Runtime.
Void Engine_close | ( | Engine_Handle | engine | ) |
Close an Engine.
[in] | engine | The handle to an engine, previously acquired by a call to Engine_open(). |
engine
must not be referenced by any codec instance object; i.e., you must first delete all codec instances associated with engine
before closing it.engine
is a valid (non-NULL) engine handle which is in the open state. Engine_Handle Engine_open | ( | String | name, | |
Engine_Attrs * | attrs, | |||
Engine_Error * | ec | |||
) |
Open an Engine.
The handle returned may be used to create one or more instances of a codec "contained" in the specified engine.
An engine may be opened more than once; each open returns a unique handle that can be used to create codec instances or get status of any underlying server.
Engine handles must not be concurrently accessed by multiple threads; each thread must either obtain its own handle (via Engine_open()) or explicitly serialize access to a shared handle.
[in] | name | The name of the engine to open. name is specified in the engine configuration. |
[in] | attrs | Attributes for the open engine. |
[out] | ec | Optional output error code |
NULL | An error has occurred. | |
non-NULL | The handle to the opened engine. |
name
is a non-NULL string.name
is a valid, pre-configured name of an engine.ec
is non-NULL, *ec
is set to a non-zero value indicating the cause of the failure.ec
is non-NULL, the Engine_Error value is set to one of the following values:Int Engine_fwriteTrace | ( | Engine_Handle | engine, | |
String | prefix, | |||
FILE * | out | |||
) |
Write Server's trace buffer to specifed file stream.
[in] | engine | The handle to the opened engine. |
[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 | A open FILE stream used to output the Server's trace characters. |
Integer | number of characters copied to the specified FILE stream. |
engine
is a valid (non-NULL) engine handle and the engine is in the open state.Engine_Error Engine_getAlgInfo | ( | String | name, | |
Engine_AlgInfo * | algInfo, | |||
Int | index | |||
) |
Get details of an algorithm configured into an engine.
[in] | name | The name of the engine. name is specified in the engine configuration. |
[out] | algInfo | Structure to store algorithm details. The algInfoSize field of this structure must be set to sizeof(Engine_AlgInfo) by the application. |
[out] | index | The index of the algorithm to get the information. |
Engine_EOK | Success. | |
Engine_EEXIST | There is no engine with the given name. | |
Engine_ENOTFOUND | index is greater than or equal to the total number of algorithms configured for the engine, or index < 0. | |
Engine_EINVAL | The value of algInfoSize passed to this function does not match the CE library's sizeof(Engine_AlgInfo) . |
name
is a non-NULL string.algInfo
is non-NULL.name
is a valid engine name and 0 <= index
< the total number of algorithms configured for the engine, then algInfo
will contain the information for the engine's ith (i = index
) algorithm.Engine_Error Engine_getAlgInfo2 | ( | String | name, | |
Engine_Handle | engine, | |||
Engine_AlgInfo2 * | algInfo2, | |||
Int | index | |||
) |
Get details of an algorithm that is configured into an engine, or has been added to an opened engine. If the engine has not been opened yet, the name of the engine is used to get the statically configured alg. If the engine has been opened, the engine handle can be used to get either information for a statically configured alg, or a remote alg that was added when the server was queried during Engine_open().
[in] | name | The name of the engine. name is specified in the engine configuration. This may be NULL if engine contains a valid engine handle. |
[in] | engine | The handle of an engine returned by Engine_open(). If this is NULL, only information for a static alg can be obtained. |
[out] | algInfo2 | Structure to store algorithm details. The algInfoSize field of this structure must be set to sizeof(Engine_AlgInfo2) by the application. |
[out] | index | The index of the algorithm to get the information. |
Engine_EOK | Success. | |
Engine_EEXIST | There is no engine with the given name. | |
Engine_ENOTFOUND | index is greater than or equal to the total number of algorithms configured for the engine, or index < 0. | |
Engine_EINVAL | The value of algInfoSize passed to this function does not match the CE library's sizeof(Engine_AlgInfo2) . |
name
is a non-NULL string or engine
is non-NULL.algInfo2
is non-NULL.name
is a valid engine name and 0 <= index
< the total number of algorithms configured for the engine, then algInfo2
will contain the information for the engine's ith (i = index
) algorithm.Int Engine_getCpuLoad | ( | Engine_Handle | engine | ) |
Get Server's cpu usage in percent.
[in] | engine | The handle to the opened engine. |
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. |
engine
is a valid (non-NULL) engine handle and the engine is in the open state.Engine_Error Engine_getLastError | ( | Engine_Handle | engine | ) |
Get error code of the last failed operation.
[in] | engine | The handle to the opened engine. |
error | code (Engine_Error) of the last failed engine operation. |
engine
is a valid (non-NULL) engine handle and the engine is in the open state. String Engine_getName | ( | Engine_Handle | engine | ) |
Get the name of an opened engine.
[in] | engine | The handle to the opened engine. |
NULL | An error has occurred. | |
non-NULL | The name of the opened engine. |
Engine_Error Engine_getNumAlgs | ( | String | name, | |
Int * | numAlgs | |||
) |
Get the number of algorithms configured into an engine.
[in] | name | The name of the engine. name is specified in the engine configuration. |
[out] | numAlgs | The number of algorithms that are configured in the given engine. |
Engine_EOK | Success. | |
Engine_EEXIST | There is no engine with the given name. |
name
is a non-NULL string.numAlgs
is non-NULL.name
is a valid engine name, then numAlgs will contain the number of algorithms configured for the given engine.Engine_Error Engine_getNumAlgs2 | ( | String | name, | |
Engine_Handle | engine, | |||
Int * | numAlgs | |||
) |
Get the number of algorithms statically configured into an engine or the total number of algorithms both statically configured and dynamically added through server information when the engine was opened.
[in] | name | The name of the engine. name is specified in the engine configuration. name can be NULL, if engine is a valid Engine_Handle. |
[in] | engine | The handle of an engine returned by Engine_open(). If engine is NULL, name must be non-NULL, and only the number of statically configured algorithms will be returned in numAlgs . specified in the engine configuration. |
[out] | numAlgs | The number of algorithms that are configured in the given engine. |
Engine_EOK | Success. | |
Engine_EEXIST | There is no engine with the given name. |
name
is a non-NULL string or engine
is non-NULL.numAlgs
is non-NULL.name
is a valid engine name, then numAlgs will contain the number of algorithms configured for the given engine.Server_Handle Engine_getServer | ( | Engine_Handle | engine | ) |
Get handle to an Engine's server.
This function returns the handle to an Engines server, that can be used with Server APIs to obtain information from and control the remote DSP server.
[in] | engine | The handle to the opened engine. |
Handle | to engine's server. |
engine
is a valid (non-NULL) engine handle and the engine is in the open state. UInt32 Engine_getUsedMem | ( | Engine_Handle | engine | ) |
Get Server's total memory usage.
[in] | engine | The handle to the opened engine. |
Total | amount of used memory (in MAUs). If the amount is not available, 0 is returned and the reason can be retrieved via Engine_getLastError(). |
engine
is a valid (non-NULL) engine handle and the engine is in the open state.Int Engine_setTrace | ( | Engine_Handle | engine, | |
String | mask | |||
) |
Set Server's trace mask.
[in] | engine | The handle to the opened engine. |
[in] | mask | Trace mask, e.g. "*=01234567" |
Engine_ENOSERVER | No server for this engine. | |
Engine_EINUSE | Trace resource is already in use. | |
Engine_ERUNTIME | Internal runtime error has occurred. |
engine
is a valid (non-NULL) engine handle and the engine is in the open state.Default engine attributes.
Default attrs.