apps/video_copy/dualcpu/evmDM6446$ ls
app.c ceapp.c ceapp.cfg in.dat makefile package package.bld package.xdc
里面两个.c文件,一个.cfg文件,两个package.*文件是讨论的重点。 as always,let's have a look at package.xdc, whose content is as the following:
/*!
* ======== package.xdc ========
* Codec Engine build support package for the video_copy example.
*
* This package simply provides a makefile which builds each application.
*/
package ti.sdo.ce.examples.apps.video_copy.dualcpu.evmDM6446 [1, 0, 0] {
}
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* when constructing a release, release everything */
Pkg.attrs.exportAll = true;
Pkg.otherFiles = [
"makefile",
"in.dat",
];
只是提到使用了PackageContents模块,包含两个文件makefile和in.dat.
然后我们来看这里真正的主角ceapp.cfg:
/* use the tracing utility module
使用代码追踪工具模块*/
var TraceUtil = xdc.useModule('ti.sdo.ce.utils.trace.TraceUtil');
//TraceUtil.attrs = TraceUtil.SOCRATES_TRACING;
/* use and configure the osal.
使用并配置osal */
var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global');
osalGlobal.runtimeEnv = osalGlobal.DSPLINK_LINUX;
/*
* ======== Engine Configuration
CE配置========
*/
var Engine = xdc.useModule('ti.sdo.ce.Engine');//
使用engine模块。
var myEngine = Engine.createFromServer( //从
服务器创建引擎 "video_copy", // Engine name (as referred to in the C app)//
指定引擎的名字 "./video_copy.x64P", // path to server exe, relative to its package dir//
服务器可执行文件的位置 "ti.sdo.ce.examples.servers.video_copy.evmDM6446" // server package
服务器包名 );
有了上述内容,我们就可以使用服务器中的引擎了,然后我们看看app的代码是干什么的,ceapp.c:
int
ceapp_init()
{
int status = -1; /* nonzero means failure */
/* initialize Codec Engine runtime first
初始化CE runtime*/
CERuntime_init();
/* reset, load, and start DSP Engine 复位,加载,启动DSP引擎*/
if ((ceHandle =
Engine_open(engineName, NULL, NULL)) == NULL) {
printf("CEapp-> ERROR: can't open engine %s\n", engineName);
goto init_end;
}