app端:
jerry@jerry-laptop:~/dvsdk_3_00_01_42/codec_engine_2_24/examples/ti/sdo/ce/examples/apps/video_copy$ ls
app.c local.tcf main_BIOS.c makefile package.xdc smain.h
local.cfg main_native.c package.bld remote.cfg
Main_bios.c是 dsp端初始程序(dsp_local时).
main_native.c是 arm端初始的程序.
Package.xdc一样.
Package.bld也一样.
Remote.cfg是配置算法远程模式时的配置文件:
配置使用哪个算法服务器.
var serverName = "bin/" +
// replace all ':' and '.' with '_' in platform name
platform.replace(/\:/g, "_").replace(/\./g, "_") +
'/all.x' + remoteSuffix;
var Engine = xdc.useModule('ti.sdo.ce.Engine');
var myEngine = Engine.createFromServer(
"video_copy", // Engine name (as referred to in the C app)
// path to server exe, relative to its package dir
serverName,
"ti.sdo.ce.examples.servers.all_codecs" // server package
);
local.cfg:
是算法在本地运行的配置,这个配置和server配置有点像,因为她肯定也要选择算法等等.
var decoder =
xdc.useModule('ti.sdo.ce.examples.codecs.viddec_copy.VIDDEC_COPY');
var encoder =
xdc.useModule('ti.sdo.ce.examples.codecs.videnc_copy.VIDENC_COPY');
var Engine = xdc.useModule('ti.sdo.ce.Engine');
var myEngine = Engine.create("video_copy", [
{
name : "videnc_copy",
mod : encoder,
local: true
},
{
name : "viddec_copy",
mod : decoder,
local: true
}
]);
总结:
当我们执行make,执行了makefile,然后其实是执行了xdc.
EXAMPLES_ROOTDIR := $(CURDIR)/../../../../../..
include $(EXAMPLES_ROOTDIR)/xdcpaths.mak
# add the examples directory to the list of paths to packages
XDC_PATH := $(EXAMPLES_ROOTDIR);$(XDC_PATH)
all:
$(XDC_INSTALL_DIR)/xdc release XDCPATH="$(XDC_PATH)" \
XDCOPTIONS=$(XDCOPTIONS) $@ -PD .
同时从上面可以看出,package.xdc必须在makefile的当前目录.
package.xdc指出了要编译的对象即路劲.然后就会到package指定的路径找其他文件.
package.bld是和编译相关的,比如debug,还指出了是编译app,server,codecs,同时指出要执行什么东西.
如果是codecs,xdc会加入package.xdc的module对应的xdc,xs,并执行这些.
如果是server,则package.bld中会加入servername.cfg,tcf等配置文件.同时xdc会加入servername.cfg,这个可以通过更改package.bld中的servername名而不更改cfg的名字,就会出现错误,这个就验证了.
所以其实我们只要将makefile,package.xdc拷贝出来,放到任何路径,任可以编译原来的程序.因为package.bld指定要编译的路径,当然makefile要改EXAMPLES_ROOTDIR