|
我用的是DM6446,videnc_copy.c是算法部分的主程序,运行在DSP端。外设管理是ARM端负责,不在这个程序里面。
下面是编译结果:- [videnc_copy.c] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -d"_DEBUG" -mv6400 -@"Debug.lkf" "videnc_copy.c"
- "gt.h", line 75: error: expected a type specifier
- "gt.h", line 75: error: function returning function is not allowed
- "gt.h", line 84: error: identifier "GT_TimeFxn" is undefined
- "gt.h", line 108: error: identifier "UInt8" is undefined
- "gt.h", line 192: error: function returning function is not allowed
- "gt.h", line 256: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 229: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 229: error: expected a ")"
- "videnc_copy.c", line 229: error: expected a ")"
- "videnc_copy.c", line 236: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 236: error: expected a ")"
- "videnc_copy.c", line 236: error: expected a ")"
- "videnc_copy.c", line 250: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 250: error: expected a ")"
- "videnc_copy.c", line 250: error: expected a ")"
- "videnc_copy.c", line 289: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 289: error: expected a ")"
- "videnc_copy.c", line 289: error: expected a ")"
- "videnc_copy.c", line 331: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 331: error: expected a ")"
- "videnc_copy.c", line 331: error: expected a ")"
- "videnc_copy.c", line 365: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 365: error: expected a ")"
- "videnc_copy.c", line 365: error: expected a ")"
- "videnc_copy.c", line 372: error: expected a ")"
- "videnc_copy.c", line 372: error: expected a ")"
- "videnc_copy.c", line 444: error: expected a ")"
- "videnc_copy.c", line 444: error: expected a ")"
- "videnc_copy.c", line 474: error: identifier "UInt8" is undefined
- "videnc_copy.c", line 474: error: expected a ")"
- "videnc_copy.c", line 474: error: expected a ")"
- "videnc_copy.c", line 481: error: expected a ")"
- "videnc_copy.c", line 481: error: expected a ")"
- 33 errors detected in the compilation of "videnc_copy.c".
- >> Compilation failure
- Compile Complete,
- 33 Errors, 0 Warnings, 0 Remarks.
复制代码
将videnc_copy.c改成videnc_copy.cpp后,编译- [videnc_copy.cpp] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -d"_DEBUG" -mv6400 -@"Debug.lkf" "videnc_copy.cpp"
- "gt.h", line 75: warning: omission of explicit type is nonstandard ("int" assumed)
- "gt.h", line 75: error: type "UInt32" may not be initialized
- "gt.h", line 75: error: identifier "GT_TimeFxn" is undefined
- "gt.h", line 75: error: expected a ";"
- "gt.h", line 84: error: "GT_TimeFxn" is not a type name
- "gt.h", line 108: error: identifier "UInt8" is undefined
- "gt.h", line 256: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 63: error: a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
- "videnc_copy.cpp", line 63: error: a value of type "Int (*)(const IALG_Params *, IALG_Fxns **, IALG_MemRec *)" cannot be used to initialize an entity of type "Int (*)(const IALG_Params *, IALG_Fxns **, IALG_MemRec *) C"
- "videnc_copy.cpp", line 63: error: a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
- "videnc_copy.cpp", line 63: error: a value of type "Int (*)(IALG_Handle, IALG_MemRec *)" cannot be used to initialize an entity of type "Int (*)(IALG_Handle, IALG_MemRec *) C"
- "videnc_copy.cpp", line 63: error: a value of type "Int (*)(IALG_Handle, const IALG_MemRec *, IALG_Handle, const IALG_Params *)" cannot be used to initialize an entity of type "Int (*)(IALG_Handle, const IALG_MemRec *, IALG_Handle, const IALG_Params *) C"
- "videnc_copy.cpp", line 79: error: a value of type "XDAS_Int32 (*)(IVIDENC_Handle, XDM_BufDesc *, XDM_BufDesc *, IVIDENC_InArgs *, IVIDENC_OutArgs *)" cannot be used to initialize an entity of type "XDAS_Int32 (*)(IVIDENC_Handle, XDM_BufDesc *, XDM_BufDesc *, IVIDENC_InArgs *, IVIDENC_OutArgs *) C"
- "videnc_copy.cpp", line 80: error: a value of type "XDAS_Int32 (*)(IVIDENC_Handle, IVIDENC_Cmd, IVIDENC_DynamicParams *, IVIDENC_Status *)" cannot be used to initialize an entity of type "XDAS_Int32 (*)(IVIDENC_Handle, IVIDENC_Cmd, IVIDENC_DynamicParams *, IVIDENC_Status *) C"
- "videnc_copy.cpp", line 229: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 229: error: expected a ")"
- "videnc_copy.cpp", line 229: error: expected a ")"
- "videnc_copy.cpp", line 236: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 236: error: expected a ")"
- "videnc_copy.cpp", line 236: error: expected a ")"
- "videnc_copy.cpp", line 250: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 250: error: expected a ")"
- "videnc_copy.cpp", line 250: error: expected a ")"
- "videnc_copy.cpp", line 289: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 289: error: expected a ")"
- "videnc_copy.cpp", line 289: error: expected a ")"
- "videnc_copy.cpp", line 331: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 331: error: expected a ")"
- "videnc_copy.cpp", line 331: error: expected a ")"
- "videnc_copy.cpp", line 338: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
- "videnc_copy.cpp", line 339: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
- "videnc_copy.cpp", line 340: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
- "videnc_copy.cpp", line 341: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
- "videnc_copy.cpp", line 365: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 365: error: expected a ")"
- "videnc_copy.cpp", line 365: error: expected a ")"
- "videnc_copy.cpp", line 372: error: expected a ")"
- "videnc_copy.cpp", line 372: error: expected a ")"
- "videnc_copy.cpp", line 444: error: expected a ")"
- "videnc_copy.cpp", line 444: error: expected a ")"
- "videnc_copy.cpp", line 474: error: identifier "UInt8" is undefined
- "videnc_copy.cpp", line 474: error: expected a ")"
- "videnc_copy.cpp", line 474: error: expected a ")"
- "videnc_copy.cpp", line 481: error: expected a ")"
- "videnc_copy.cpp", line 481: error: expected a ")"
- 44 errors detected in the compilation of "videnc_copy.cpp".
- >> Compilation failure
- Compile Complete,
- 44 Errors, 1 Warnings, 0 Remarks.
复制代码
除了在编译videnc_copy.c时出现的错误,还多了一些这种
a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
错误,上网搜过,没有什么解决方案。
gt.h是我从Linux里拷过来的,路径是
/home/davinci/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace/gt.h
我看到下面这个帖子说要在Windows下安装dvsdk,然后将路径加到CCS里
<!-- l --><a class="postlink-local" href="http://www.opencv.org.cn/forum/viewtopic.php?f=9&t=7937&p=35292&hilit=%E5%AD%A6%E7%94%A8emcv#p35292">viewtopic.php?f=9&t=7937&p=35292&hilit=%E5%AD%A6%E7%94%A8emcv#p35292</a><!-- l -->
我试过了,在Linux下的dvsdk的安装文件(bin文件),没法安装在Windows,提示文件损坏或与2Windows不兼容。我不知道是不是因为我没有安装dvsdk,所以导致从dvsdk里拷过来的头文件gt.h在编译时出错。
请各位老师同学指点一下。
下面是videnc_copy.c的代码- /*
- * Copyright 2007
- * Texas Instruments Incorporated
- *
- * All rights reserved. Property of Texas Instruments Incorporated
- * Restricted rights to use, duplicate or disclose this code are
- * granted through contract.
- *
- */
- /*
- * ======== videnc_copy.c ========
- * Video Encoder "copy" algorithm.
- *
- * This file contains an implementation of the IALG interface
- * required by XDAS.
- */
- //#include <xdc/std.h>
- #include <std.h>
- #include <string.h>
- //#include <ti/xdais/dm/ividenc.h>
- #include "ividenc.h"
- //#include <ti/sdo/ce/trace/gt.h>
- #include "gt.h"
- #include "videnc_copy_ti.h"
- #include "videnc_copy_ti_priv.h"
- /*emcv lib */
- //#include "cv.hpp"
- /* buffer definitions */
- #define MININBUFS 1
- #define MINOUTBUFS 1
- #define MININBUFSIZE 1
- #define MINOUTBUFSIZE 1
- //extern void vidprocess(XDAS_Int8* in,XDAS_Int8* out,XDAS_UInt32 minSamples);
- extern IALG_Fxns VIDENCCOPY_TI_IALG;
- #define IALGFXNS \
- &VIDENCCOPY_TI_IALG, /* module ID */ \
- VIDENCCOPY_TI_activate, /* activate*/ \
- VIDENCCOPY_TI_alloc, /* alloc8*/ \
- NULL, /* control (NULL => no control ops) */ \
- VIDENCCOPY_TI_deactivate,/* deactivate*/ \
- VIDENCCOPY_TI_free, /* free */ \
- VIDENCCOPY_TI_initObj, /* init*/ \
- NULL, /* moved */ \
- NULL /* numAlloc (NULL => IALG_MAXMEMRECS) */
- /*
- * ======== VIDENCCOPY_TI_IVIDENC ========
- * This structure defines TI's implementation of the IVIDENC interface
- * for the VIDENCCOPY_TI module.
- */
- IVIDENC_Fxns VIDENCCOPY_TI_VIDENCCOPY = { /* module_vendor_interface */
- {IALGFXNS},
-
- // {
- // &VIDENCCOPY_TI_IALG, /* module ID */ \
- // VIDENCCOPY_TI_activate, \
- // VIDENCCOPY_TI_alloc, \
- // NULL, /* control (NULL => no control ops) */ \
- // VIDENCCOPY_TI_deactivate, \
- // VIDENCCOPY_TI_free, \
- // VIDENCCOPY_TI_initObj, \
- // NULL, /* moved */ \
- // NULL /* numAlloc (NULL => IALG_MAXMEMRECS) */
- // },*/
- /* (XDAS_Int32 *) VIDENCCOPY_TI_process(IVIDENC_Handle h, XDM_BufDesc *inBufs, XDM_BufDesc *outBufs, IVIDENC_InArgs *inArgs, IVIDENC_OutArgs *outArgs), (void *)(int *)
- (XDAS_Int32 *) VIDENCCOPY_TI_control(IVIDENC_Handle handle, IVIDENC_Cmd id, IVIDENC_DynamicParams *params, IVIDENC_Status *status),*/
- VIDENCCOPY_TI_process,
- VIDENCCOPY_TI_control
- };
- typedef struct RECT
- {
- XDAS_UInt16 top;
- XDAS_UInt16 bottom;
- XDAS_UInt16 left;
- XDAS_UInt16 right;
- }Rect;
- XDAS_Int16 width;
- XDAS_Int16 height;
- XDAS_UInt8* pBkImg = NULL;
- XDAS_UInt8* pFrImg = NULL;
- XDAS_UInt8* pFrameImg = NULL;
- XDAS_UInt8* pFrameTmp = NULL;
- XDAS_UInt8 rectCount=0;
- Rect rect[20]; //max numble of rects is 20
- /*
- * ======== VIDENC_TI_IALG ========
- * This structure defines TI's implementation of the IALG interface
- * for the VIDENCCOPY_TI module.
- */
- #ifdef _TI_
- /* satisfy xDAIS symbol requirement without any overhead */
- asm("_VIDENCCOPY_TI_IALG .set _VIDENCCOPY_TI_VIDENCCOPY");
- #else
- /*
- * We duplicate the structure here to allow this code to be compiled and
- * run non-DSP platforms at the expense of unnecessary data space
- * consumed by the definition below.
- */
- IALG_Fxns VIDENCCOPY_TI_IALG = { /* module_vendor_interface */
- IALGFXNS
- };
- #endif
- /* tracing information */
- #define GTNAME "codecs.videnc_copy"
- static GT_Mask curTrace = {NULL,NULL};
- #ifdef USE_ACPY3
- /* Implementation of IDMA3 interface functions & IDMA3_Fxns vtable */
- #include <ti/bios/include/std.h>
- #include <ti/xdais/idma3.h>
- #include <ti/sdo/fc/acpy3/acpy3.h>
- #define NUM_LOGICAL_CH 1
- /*
- * ======== VIDENCCOPY_TI_dmaChangeChannels ========
- * Update instance object with new logical channel.
- */
- Void VIDENCCOPY_TI_dmaChangeChannels(IALG_Handle handle,
- IDMA3_ChannelRec dmaTab[])
- {
- VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
- // VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
- GT_2trace(curTrace, GT_ENTER,
- "VIDENCCOPY_TI_dmaChangeChannels(0x%x, 0x%x)\n", handle, dmaTab);
- videncObj->dmaHandle1D1D8B = dmaTab[0].handle;
- }
- /*
- * ======== VIDENCCOPY_TI_dmaGetChannelCnt ========
- * Return max number of logical channels requested.
- */
- Uns VIDENCCOPY_TI_dmaGetChannelCnt(Void)
- {
- GT_0trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_dmaGetChannelCnt()\n");
- return (NUM_LOGICAL_CH);
- }
- /*
- * ======== VIDENCCOPY_TI_dmaGetChannels ========
- * Declare DMA resource requirement/holdings.
- */
- Uns VIDENCCOPY_TI_dmaGetChannels(IALG_Handle handle, IDMA3_ChannelRec dmaTab[])
- {
- VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
- // VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
- int i;
- GT_2trace(curTrace, GT_ENTER,
- "VIDENCCOPY_TI_dmaGetChannels(0x%x, 0x%x)\n", handle, dmaTab);
- /* Initial values on logical channels */
- dmaTab[0].handle = videncObj->dmaHandle1D1D8B;
- dmaTab[0].numTransfers = 1;
- dmaTab[0].numWaits = 1;
- /*
- * Request logical DMA channels for use with ACPY3
- * AND with environment size obtained from ACPY3 implementation
- * AND with low priority.
- */
- for (i=0; i<NUM_LOGICAL_CH; i++) {
- dmaTab[i].priority = IDMA3_PRIORITY_LOW;
- dmaTab[i].persistent = FALSE;
- dmaTab[i].protocol = &ACPY3_PROTOCOL;
- }
- return (NUM_LOGICAL_CH);
- }
- /*
- * ======== VIDENCCOPY_TI_dmaInit ========
- * Initialize instance object with granted logical channel.
- */
- Int VIDENCCOPY_TI_dmaInit(IALG_Handle handle, IDMA3_ChannelRec dmaTab[])
- {
- VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
- // VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
- GT_2trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_dmaInit(0x%x, 0x%x)\n",
- handle, dmaTab);
- videncObj->dmaHandle1D1D8B = dmaTab[0].handle;
- return (IALG_EOK);
- }
- /*
- * ======== VIDENCCOPY_TI_IDMA3 ========
- * This structure defines TI's implementation of the IDMA3 interface
- * for the VIDENCCOPY_TI module.
- */
- IDMA3_Fxns VIDENCCOPY_TI_IDMA3 = { /* module_vendor_interface */
- &VIDENCCOPY_TI_IALG, /* IALG functions */
- VIDENCCOPY_TI_dmaChangeChannels, /* ChangeChannels */
- VIDENCCOPY_TI_dmaGetChannelCnt, /* GetChannelCnt */
- VIDENCCOPY_TI_dmaGetChannels, /* GetChannels */
- VIDENCCOPY_TI_dmaInit /* initialize logical channels */
- };
- #endif
- /*
- * ======== VIDENCCOPY_TI_activate ========
- */
- Void VIDENCCOPY_TI_activate(IALG_Handle handle)
- {
- GT_1trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_activate(0x%x)\n", handle);
- }
- /*
- * ======== VIDENCCOPY_TI_deactivate ========
- */
- Void VIDENCCOPY_TI_deactivate(IALG_Handle handle)
- {
- GT_1trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_deactivate(0x%x)\n", handle);
- }
- /*
- * ======== VIDENCCOPY_TI_alloc ========
- */
- Int VIDENCCOPY_TI_alloc(const IALG_Params *algParams,
- IALG_Fxns **pf, IALG_MemRec memTab[])
- {
- IVIDENC_Params* params=(IVIDENC_Params*)algParams;
- if (curTrace.modName == NULL) { /* initialize GT (tracing) */
- GT_create(&curTrace, GTNAME);
- }
- GT_3trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_alloc(0x%x, 0x%x, 0x%x)\n",
- algParams, pf, memTab);
- /* Request memory for my object */
- memTab[0].size = sizeof(VIDENCCOPY_TI_Obj);
- memTab[0].alignment = 0;
- memTab[0].space = IALG_EXTERNAL;
- memTab[0].attrs = IALG_PERSIST;
- if(params != NULL){
- memTab[1].size = params->maxWidth*params->maxHeight;
- memTab[1].alignment = 0;
- memTab[1].space = IALG_EXTERNAL;
- memTab[1].attrs = IALG_PERSIST;
-
- memTab[2].size = params->maxWidth*params->maxHeight;
- memTab[2].alignment = 0;
- memTab[2].space = IALG_EXTERNAL;
- memTab[2].attrs = IALG_PERSIST;
-
- memTab[3].size = params->maxWidth*params->maxHeight;
- memTab[3].alignment = 0;
- memTab[3].space = IALG_EXTERNAL;
- memTab[3].attrs = IALG_PERSIST;
-
- memTab[4].size = params->maxWidth*params->maxHeight;
- memTab[4].alignment = 0;
- memTab[4].space = IALG_EXTERNAL;
- memTab[4].attrs = IALG_PERSIST;
- }
- return (5);
- // return (1);
- }
- /*
- * ======== VIDENCCOPY_TI_free ========
- */
- Int VIDENCCOPY_TI_free(IALG_Handle handle, IALG_MemRec memTab[])
- {
- GT_2trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_free(0x%lx, 0x%lx)\n",
- handle, memTab);
- VIDENCCOPY_TI_alloc(NULL, NULL, memTab);
-
- memTab[1].size = width*height;
- memTab[1].alignment = 0;
- memTab[1].space = IALG_EXTERNAL;
- memTab[1].attrs = IALG_PERSIST;
- memTab[1].base = pBkImg;
-
- memTab[2].size = width*height;
- memTab[2].alignment = 0;
- memTab[2].space = IALG_EXTERNAL;
- memTab[2].attrs = IALG_PERSIST;
- memTab[2].base = pFrImg;
-
- memTab[3].size = width*height;
- memTab[3].alignment = 0;
- memTab[3].space = IALG_EXTERNAL;
- memTab[3].attrs = IALG_PERSIST;
- memTab[3].base = pFrameImg;
-
- memTab[4].size = width*height;
- memTab[4].alignment = 0;
- memTab[4].space = IALG_EXTERNAL;
- memTab[4].attrs = IALG_PERSIST;
- memTab[4].base = pFrameTmp;
-
- return (5);
- //return (1);
- }
- /*
- * ======== VIDENCCOPY_TI_initObj ========
- */
- Int VIDENCCOPY_TI_initObj(IALG_Handle handle,
- const IALG_MemRec memTab[], IALG_Handle p,
- const IALG_Params *algParams)
- {
- IVIDENC_Params* videnc_params=(IVIDENC_Params*)algParams;
-
- GT_4trace(curTrace, GT_ENTER,
- "VIDENCCOPY_TI_initObj(0x%x, 0x%x, 0x%x, 0x%x)\n", handle, memTab,
- p, algParams);
- width=videnc_params->maxWidth;
- height=videnc_params->maxHeight;
-
- pBkImg = memTab[1].base;
- pFrImg = memTab[2].base;
- pFrameImg = memTab[3].base;
- pFrameTmp = memTab[4].base;
-
- return (IALG_EOK);
- }
- /*
- * ======== VIDENCCOPY_TI_process ========
- */
- XDAS_Int32 VIDENCCOPY_TI_process(IVIDENC_Handle h, XDM_BufDesc *inBufs,
- XDM_BufDesc *outBufs, IVIDENC_InArgs *inArgs, IVIDENC_OutArgs *outArgs)
- {
- XDAS_Int32 curBuf;
- XDAS_UInt32 minSamples;
- #ifdef USE_ACPY3
- const Uint32 maxTransferChunkSize = 0xffff;
- Uint32 thisTransferChunkSize = 0x0;
- Uint32 remainingTransferChunkSize;
- Uint32 thisTransferSrcAddr, thisTransferDstAddr;
- ACPY3_Params params;
- VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)h;
- #endif
- GT_5trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_process(0x%x, 0x%x, 0x%x, "
- "0x%x, 0x%x)\n", h, inBufs, outBufs, inArgs, outArgs);
- /* validate arguments - this codec only supports "base" xDM. */
- if ((inArgs->size != sizeof(*inArgs)) ||
- (outArgs->size != sizeof(*outArgs))) {
- GT_2trace(curTrace, GT_ENTER,
- "VIDENCCOPY_TI_process, unsupported size "
- "(0x%x, 0x%x)\n", inArgs->size, outArgs->size);
- return (IVIDENC_EFAIL);
- }
- #ifdef USE_ACPY3
- /*
- * Activate Channel scratch DMA channels.
- */
- ACPY3_activate(videncObj->dmaHandle1D1D8B);
- #endif
- /* outArgs->bytesGenerated reports the total number of bytes generated */
- outArgs->bytesGenerated = 0;
- /*
- * A couple constraints for this simple "copy" codec:
- * - Video encoding presumes a single input buffer, so only one input
- * buffer will be encoded, regardless of inBufs->numBufs.
- * - Given a different size of an input and output buffers, only
- * encode (i.e., copy) the lesser of the sizes.
- */
- for (curBuf = 0; (curBuf < inBufs->numBufs) &&
- (curBuf < outBufs->numBufs); curBuf++) {
- /* there's an available in and out buffer, how many samples? */
- minSamples = inBufs->bufSizes[curBuf] < outBufs->bufSizes[curBuf] ?
- inBufs->bufSizes[curBuf] : outBufs->bufSizes[curBuf];
- #ifdef USE_ACPY3
- thisTransferSrcAddr = (Uint32)inBufs->bufs[curBuf];
- thisTransferDstAddr = (Uint32)outBufs->bufs[curBuf];
- remainingTransferChunkSize = minSamples;
- while (remainingTransferChunkSize > 0) {
- if (remainingTransferChunkSize > maxTransferChunkSize) {
- thisTransferChunkSize = maxTransferChunkSize;
- }
- else {
- thisTransferChunkSize = remainingTransferChunkSize;
- }
- /* Configure the logical channel */
- params.transferType = ACPY3_1D1D;
- params.srcAddr = (void *)thisTransferSrcAddr;
- params.dstAddr = (void *)thisTransferDstAddr;
- params.elementSize = thisTransferChunkSize;
- params.numElements = 1;
- params.waitId = 0;
- params.numFrames = 1;
- remainingTransferChunkSize -= thisTransferChunkSize;
- thisTransferSrcAddr += thisTransferChunkSize;
- thisTransferDstAddr += thisTransferChunkSize;
- /* Configure logical dma channel */
- ACPY3_configure(videncObj->dmaHandle1D1D8B, ¶ms, 0);
- /* Use DMA to copy data */
- ACPY3_start(videncObj->dmaHandle1D1D8B);
- /* wait for transfer to finish */
- ACPY3_wait(videncObj->dmaHandle1D1D8B);
- }
- GT_1trace(curTrace, GT_2CLASS, "VIDENCCOPY_TI_process> "
- "ACPY3 Processed %d bytes.\n", minSamples);
- #else
- GT_3trace(curTrace, GT_2CLASS, "VIDENCCOPY_TI_process> "
- "memcpy (0x%x, 0x%x, %d)\n",
- outBufs->bufs[curBuf], inBufs->bufs[curBuf], minSamples);
- /* process the data: read input, produce output */
- //memcpy(outBufs->bufs[curBuf], inBufs->bufs[curBuf], minSamples);
- // vidprocess(inBufs->bufs[curBuf],outBufs->bufs[curBuf],minSamples);
- //yuvtorgb((XDAS_UInt8*)inBufs->bufs[curBuf],(XDAS_UInt8*)outBufs->bufs[curBuf]);
- #endif
- outArgs->bytesGenerated += minSamples;
- }
- /* Fill out the rest of the outArgs struct */
- outArgs->extendedError = 0;
- outArgs->encodedFrameType = 0; /* TODO */
- outArgs->inputFrameSkip = IVIDEO_FRAME_ENCODED;
- outArgs->reconBufs.numBufs = 0; /* important: indicate no reconBufs */
- return (IVIDENC_EOK);
- }
- /*
- * ======== VIDENCCOPY_TI_control ========
- */
- XDAS_Int32 VIDENCCOPY_TI_control(IVIDENC_Handle handle, IVIDENC_Cmd id,
- IVIDENC_DynamicParams *params, IVIDENC_Status *status)
- {
- XDAS_Int32 retVal;
- GT_4trace(curTrace, GT_ENTER, "VIDENCCOPY_TI_control(0x%x, 0x%x, 0x%x, "
- "0x%x)\n", handle, id, params, status);
- /* validate arguments - this codec only supports "base" xDM. */
- if ((params->size != sizeof(*params)) ||
- (status->size != sizeof(*status))) {
- GT_2trace(curTrace, GT_ENTER,
- "VIDENCCOPY_TI_control, unsupported size "
- "(0x%x, 0x%x)\n", params->size, status->size);
- return (IVIDENC_EFAIL);
- }
- switch (id) {
- case XDM_GETSTATUS:
- status->extendedError = 0;
- status->bufInfo.minNumInBufs = MININBUFS;
- status->bufInfo.minNumOutBufs = MINOUTBUFS;
- status->bufInfo.minInBufSize[0] = MININBUFSIZE;
- status->bufInfo.minOutBufSize[0] = MINOUTBUFSIZE;
- retVal = IVIDENC_EOK;
- break;
- default:
- /* unsupported cmd */
- retVal = IVIDENC_EFAIL;
- break;
- }
- return (retVal);
- }
- /*
- * @(#) codec_engine_1_10_01; 1,0,0,197; 4-20-2007 13:16:15; /db/atree/library/trees/ce-e10x/src/
- */
复制代码 |
|