Hi
I'm getting frame frome M3 to A8 , and i want to copy frame to other A8_buffer .
On A8 side , i had received frame information.
i'm trying to use phyaddr or virtaddr copy frame to other buffer , but Segmentation fault .
why Segmentation fault?
How should i do?
------------------------------------------------------------------
static Void * VcapVenc_ipcFramesSendRecvFxn(Void * prm)
{
VcapVenc_IpcFramesCtrlThrObj *thrObj = ( VcapVenc_IpcFramesCtrlThrObj *) prm;
static Int printStatsInterval = 0;
VIDEO_FRAMEBUF_LIST_S bufList;
Int status;
FILE * fPtr = NULL;
UInt32 pMemVirtAddr=0;
unsigned char * test[10]={'a','b','c','d','e','f','g','h','i','j'};
unsigned char copy_buffer[1920*1080];
#ifdef CUSTOM_SD_DEMO
VcapVenc_ipcFramesFileOpen();
#endif
while (FALSE == thrObj->exitFramesInOutThread)
{
OSA_semWait(&thrObj->framesInNotifySem,OSA_TIMEOUT_FOREVER);
status = Vcap_getFullVideoFrames(&bufList,0);
OSA_assert(0 == status);
if (bufList.numFrames)
{
//VcapVenc_ipcFramesPrintFullFrameListInfo(&bufList,"FullFrameList");
#ifdef CUSTOM_SD_DEMO
VcapVenc_ipcFrameFileWrite(&bufList);
#endif
printf("phyAddr=0x%x , virAddr=0x%x\n",bufList.frames[0].phyAddr[0][0] , bufList.frames[0].addr[0][0]);
//Virt
memcpy(copy_buffer , bufList.frames[0].addr[0][0] ,1920*1080);
//Phy
memcpy(copy_buffer , bufList.frames[0].phyAddr[0][0] ,1920*1080);
//status = Vdis_putFullVideoFrames(&bufList);
OSA_assert(0 == status);
}
//status = Vdis_getEmptyVideoFrames(&bufList,0);
//status = Vcap_putEmptyVideoFrames(&bufList);
//OSA_assert(0 == status);
if (bufList.numFrames)
{
//printf("EmptyFrameList\n");
//VcapVenc_ipcFramesPrintFullFrameListInfo(&bufList,"EmptyFrameList");
status = Vcap_putEmptyVideoFrames(&bufList);
OSA_assert(0 == status);
}
#ifdef IPC_BITS_DEBUG
if ((printStatsInterval % MCFW_IPCFRAMES_INFO_PRINT_INTERVAL) == 0)
{
OSA_printf("MCFW_IPCFRAMES:%s:INFO: periodic print..",__func__);
}
#endif
printStatsInterval++;
OSA_waitMsecs(MCFW_IPCFRAMES_SENDRECVFXN_PERIOD_MS);
}
#ifdef CUSTOM_SD_DEMO
if(gVcapVenc_ctrl.fileFrameWriteEnable)
{
if(gVcapVenc_ctrl.fileFrameWriteState==FILE_WRITE_RUNNING)
{
fclose(gVcapVenc_ctrl.fp);
printf(" Closing file [%s] for CH%d\n", gVcapVenc_ctrl.fileFrameWriteName, gVcapVenc_ctrl.fileFrameWriteChn);
}
}
#endif
return NULL;
}