C6acceldm6467.tar.gz软件包提供了patch功能,自动对C6Accel安装目录下的许多文件进行修改,免去了不少人工修改的消耗。要使用其patch功能,只需要在当前目录下执行命令:patch -p1 < dm6467_patch/dm6467_c6accel.patch。接下来,需要编译C6Accel,编译的命令如下所示。编译完成之后,在之前Rules.make中指定的install路径/home/tirvideo/lyb/armfs/opt/dvsdk/c6accel中会出现编译好的应用程序以及codec server和loadmodule.sh等文件。~/dvsdk_3_10_00_19_c6accel_example$ make c6accel_clean~/dvsdk_3_10_00_19_c6accel_example$ make c6accel~/dvsdk_3_10_00_19_c6accel_example$ make c6accel_install
2.3 集成C6Accel到demo
要使用C6Accel,我们选用已有的Encodedemo,在其基础上进行修改,将采集的视频进行Sobel处理,然后进行H264编码。(1)修改./ cs2dm6467_1_00_00_10/Makefile,将C6Accel添加进XDC的环境变量。# Set XDCPATH to contain necessary repositories.# Please do not modify anything belowXDCPATH = $(CURDIR);$(C6ACCEL_INSTALL_DIR)/soc/packages;$(CODEC_INSTALL_DIR)/packages;$(XDAIS_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/fctools/packages;$(BIOS_INSTALL_DIR)/packages;$(BIOSUTILS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR);$(CE_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/cetools/packages;$(EDMA3_LLD_INSTALL_DIR)/packages(2)修改./cs2dm6467_1_00_00_10/packages/ti/sdo/server/cs/codec.cfg,将C6Accel添加进codecserver的codec列表。/* * "Use" the various codec modules; i.e., implementation of codecs. * All these "xdc.useModule" commands provide a handle to the codecs, * which we'll use to initialize config params and add the codecs to * the Server.algs array. */ var C6ACCEL = xdc.useModule('ti.c6accel.ce.C6ACCEL'); C6ACCEL.serverFxns = undefined; C6ACCEL.stubFxns = undefined; C6ACCEL.serverFxns = "UNIVERSAL_SKEL"; C6ACCEL.stubFxns = "UNIVERSAL_STUBS"; C6ACCEL.alg.FLOAT = false; C6ACCEL.alg.watermark = false; C6ACCEL.alg.codeSection = "DDR2"; C6ACCEL.alg.udataSection = "DDR2"; C6ACCEL.alg.dataSection = "DDR2";……/* * The array of algorithms this server can serve up. This array also * configures details about the threads which will be created to run the * algorithms (e.g. stack sizes, priorities, etc.). */Server.algs = [ {name: "c6accel", mod: C6ACCEL , threadAttrs: { stackMemId: 0, priority: Server.MINPRI + 1}, groupId : 0, },(3)将DVSDK中的encode demo复制过来,将该文件夹重命名为encodesobel,并重命名encode.cfg为encodesobel.cfg,然后修改该文件,使用新的codec server。var demoEngine = Engine.createFromServer( "dm6467", "./c6accel_dm6467.x64P", "ti.c6accel_unitservers.dm6467" );(4)修改./dvsdk_demos_3_10_00_16/dm6467/encodesobel/Makefile,将C6Accel添加进XDC环境变量。# Package path for the XDC toolsXDC_PATH = $(USER_XDC_PATH);../../packages;$(C6ACCEL_INSTALL_DIR)/soc/packages;$(DEMO_INSTALL_DIR)/packages;$(DMAI_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR);$(XDAIS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(CODEC_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/examplesC6ACCEL_LIB = $(C6ACCEL_INSTALL_DIR)/soc/c6accelw/lib/c6accelw_dm6467.a470MVC6ACCEL_BINARY = $(C6ACCEL_INSTALL_DIR)/soc/packages/ti/c6accel_unitservers/dm6467/c6accel_dm6467.x64P……install_$(TARGET): @install -d $(EXEC_DIR) @install $(TARGET) $(EXEC_DIR) @install $(TARGET).txt $(EXEC_DIR) @install $(C6ACCEL_BINARY) $(EXEC_DIR) @echo @echo Installed $(TARGET) binaries to $(EXEC_DIR)..$(TARGET): $(OBJFILES) $(C6ACCEL_LIB) $(XDC_LFILE) @echo @echo Linking $@ from $^.. $(LINK.c) -o $@ $^(5)修改video.c。这部分的修改比较多,添加的代码主要包括创建C6Accel句柄,进行Sobel处理等。具体修改请参看源文件,这里不再详细讲解,需要特别注意程序中buffer的使用以及句柄的创建和删除。(6)编译。~/dvsdk_3_10_00_19$ make all~/dvsdk_3_10_00_19$ cd ../dvsdk_3_10_00_19_c6accel_example~/dvsdk_3_10_00_19_c6accel_example$ make codecs_clean~/dvsdk_3_10_00_19_c6accel_example$ make codecs~/dvsdk_3_10_00_19_c6accel_example$ make demos~/dvsdk_3_10_00_19_c6accel_example$ make install然后,在/home/tirvideo/lyb/armfs/opt/dvsdk/c6accel中就会出现所有的应用程序以及运行程序所需的驱动、脚本文件和codec server(.x64p文件)。