This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM6446 videnc1_skel.c

请问,videnc1_skel.c文件中的call函数,在哪里被调用啊?应该是在dsp端,先接收

arm端发过来的消息,然后再调用这个call函数解析。但是,似乎找不到dsp端消息接收

函数。谢谢!

static VISA_Status call(VISA_Handle visaHandle, VISA_Msg visaMsg)
{
_VIDENC1_Msg *msg = (_VIDENC1_Msg *)visaMsg;
VIDENC1_Handle handle = (VIDENC1_Handle)visaHandle;
Int i;
IVIDEO1_BufDescIn inBufs;
XDM_BufDesc outBufs;
IVIDENC1_OutArgs *pOutArgs;
IVIDENC1_Status *pStatus;
IVIDENC1_CodecClassConfig *codecClassConfig;
Int numBufs;

/* get stub/skeleton config data; can be NULL (for old codecs) */
codecClassConfig = (IVIDENC1_CodecClassConfig *)
VISA_getCodecClassConfig( visaHandle );


/* perform the requested VIDENC1 operation by parsing message. */
switch (msg->visa.cmd) {

case _VIDENC1_CPROCESS: {
/* unmarshall inBufs and outBufs */
inBufs = msg->cmd.process.inBufs;

outBufs.bufs = msg->cmd.process.outBufs;
outBufs.numBufs = msg->cmd.process.numOutBufs;
outBufs.bufSizes = msg->cmd.process.outBufSizes;

/* invalidate cache for all input buffers */
for (i = 0, numBufs = 0; i < XDM_MAX_IO_BUFFERS; i++) {
if (inBufs.bufDesc[i].buf != NULL) {
/* valid member of sparse array,
* invalidate it unless user configured it not to
*/
if (codecClassConfig != NULL &&
codecClassConfig->manageInBufsCache[i] == FALSE) {
/* do nothing, i.e. don't invalidate */
} else {
Memory_cacheInv(inBufs.bufDesc[i].buf,
inBufs.bufDesc[i].bufSize);
}

if (++numBufs == inBufs.numBufs) {
break;
}
}
}

/* invalidate cache for all output buffers */
for (i = 0, numBufs = 0; i < XDM_MAX_IO_BUFFERS; i++) {
if (outBufs.bufs[i] != NULL) {
/* valid member of sparse array,
* invalidate it unless user configured it not to
*/
if (codecClassConfig != NULL &&
codecClassConfig->manageOutBufsCache[i] == FALSE) {
/* do nothing, i.e. don't invalidate */
} else {
Memory_cacheInv(outBufs.bufs[i], outBufs.bufSizes[i]);
}

if (++numBufs == outBufs.numBufs) {
break;
}
}
}

/* unmarshall outArgs based on the "size" of inArgs */
pOutArgs = (IVIDENC1_OutArgs *)((UInt)(&(msg->cmd.process.inArgs)) +
msg->cmd.process.inArgs.size);

/*
* Note, there's no need to invalidate cache for
* pOutArgs->encodedBuf bufs nor pOutArgs->reconBufs bufs as they're
* not _really_ OUT buffers. Rather they're references to
* the _real_ OUT buffers that are provided in outBufs - which
* were already invalidated above.
*/

/* make the process call */
msg->visa.status = VIDENC1_process(handle,
&inBufs, &outBufs, &(msg->cmd.process.inArgs), pOutArgs);

/* writeback cache for encoded buffer */
if ((pOutArgs->encodedBuf.buf != NULL) &&
(XDM_ISACCESSMODE_WRITE(pOutArgs->encodedBuf.accessMask))) {
Memory_cacheWb(pOutArgs->encodedBuf.buf,
pOutArgs->encodedBuf.bufSize);

/*
* Since we've cacheWb this buffer, we arguably should
* reflect this cache state and clear the WRITE bit in
* the .accessMask field. However, we know the stub
* doesn't propogate this field to the calling app, so
* this extra buffer management detail isn't necessary:
*
* XDM_CLEARACCESSMODE_WRITE(pOutArgs->encodedBuf.accessMask);
*/
}

/* writeback cache for recon buffers */
for (i = 0; ((i < pOutArgs->reconBufs.numBufs) &&
(i < IVIDEO_MAX_YUV_BUFFERS)); i++) {
if ((pOutArgs->reconBufs.bufDesc[i].buf != NULL) &&
(XDM_ISACCESSMODE_WRITE(
pOutArgs->reconBufs.bufDesc[i].accessMask))) {

Memory_cacheWb(pOutArgs->reconBufs.bufDesc[i].buf,
pOutArgs->reconBufs.bufDesc[i].bufSize);

/*
* Since we've cacheWb this buffer, we arguably should
* reflect this cache state and clear the WRITE bit in
* the .accessMask field. However, we know the stub
* doesn't propogate this field to the calling app, so
* this extra buffer management detail isn't necessary:
*
* XDM_CLEARACCESSMODE_WRITE(
* pOutArgs->reconBufs.bufDesc[i].accessMask);
*/
}
}

/*
* Note that any changes to individual outBufs[i] values made by
* the codec will automatically update msg->cmd.process.outBufs
* as we pass the outBufs array by reference.
*/

break;
}

case _VIDENC1_CCONTROL: {
/* unmarshall status based on the "size" of params */
pStatus = (IVIDENC1_Status *)((UInt)(&(msg->cmd.control.params)) +
msg->cmd.control.params.size);

/* invalidate data buffer */
if (pStatus->data.buf != NULL) {
Memory_cacheInv(pStatus->data.buf, pStatus->data.bufSize);
}

msg->visa.status = VIDENC1_control(handle, msg->cmd.control.id,
&(msg->cmd.control.params), pStatus);

/* writeback data buffer */
if ((pStatus->data.buf != NULL) &&
XDM_ISACCESSMODE_WRITE(pStatus->data.accessMask)) {

Memory_cacheWb(pStatus->data.buf, pStatus->data.bufSize);

/*
* Since we've cacheWb this buffer, we arguably should
* reflect this cache state and clear the WRITE bit in
* the .accessMask field. However, we know the stub
* doesn't propogate this field to the calling app, so
* this extra buffer management detail isn't necessary:
*
* XDM_CLEARACCESSMODE_WRITE(pStatus->data.accessMask);
*/
}

break;
}

default: {
msg->visa.status = VISA_EFAIL;

break;
}
}
return (VISA_EOK);
}

x 出现错误。请重试或与管理员联系。