|
//以下就是修改过的地方,和出现的问题,主要目的是想先调试camera的Preview模式,使用三星的应用测试程序CamTest.exe, 点击Play播放,再点击停止。
//函数执行到memcpy就出现如下提示:Data Abort: Thread=83c7c794 Proc=81f9d340 'device.exe'
// AKY=00000005 PC=03fc36d0(coredll.dll+0x000536d0) RA=02e13448(camera.dll+0x00003448) BVA=3010c600 FSR=00000005
//Virtual_Alloc函数中添加的代码主要是为了得到连续的Preview DMA和Codec DMA的Frame Buffer
//串口调试得到 g_PhysPreviewAddr = 0x32ec3000
// g_PhysCodecAddr = 0x32ef5000
void Virtual_Alloc()
{
PBYTE pVirtPreviewAddr = NULL;
PBYTE pVirtCodecAddr = NULL;
DMA_ADAPTER_OBJECT Adapter1, Adapter2;
memset(&Adapter1, 0, sizeof(DMA_ADAPTER_OBJECT));
Adapter1.InterfaceType = Internal;
Adapter1.ObjectSize = sizeof(DMA_ADAPTER_OBJECT);
memset(&Adapter2, 0, sizeof(DMA_ADAPTER_OBJECT));
Adapter2.InterfaceType = Internal;
Adapter2.ObjectSize = sizeof(DMA_ADAPTER_OBJECT);
pVirtPreviewAddr = (PBYTE)HalAllocateCommonBuffer(&Adapter1, Preview_Mem_Size, &g_PhysPreviewAddr, FALSE);
RETAILMSG(TRUE, (TEXT("Camera:Virtual_Alloc() g_PhysPreviewAddr = 0x%x\r\n"), g_PhysPreviewAddr.LowPart));
if (pVirtPreviewAddr == NULL)
{
RETAILMSG(TRUE, (TEXT("Camera:Virtual_Alloc() - Failed to allocate DMA buffer for Preview.\r\n")));
}
pVirtCodecAddr = (PBYTE)HalAllocateCommonBuffer(&Adapter2, Codec_Mem_Size, &g_PhysCodecAddr, FALSE);
RETAILMSG(TRUE, (TEXT("Camera:Virtual_Alloc() g_PhysCodecAddr = 0x%x\r\n"), g_PhysCodecAddr.LowPart));
if (pVirtCodecAddr == NULL)
{
RETAILMSG(TRUE, (TEXT("Camera:Virtual_Alloc() - Failed to allocate DMA buffer for Codec.\r\n")));
}
...................
.........................下面代码省略没有贴出,就是原来的代码,上面的是我添加的。
}
//g_PhysPreviewAddr = 0x32ec3000
// g_PhysCodecAddr = 0x32ef5000 这部分串口监控过,主要是传了g_PhysCodecAddr.LowPart和
//g_PhysCodecAddr 两个参数,其它没有修改。
CamInit(320, 240, 320, 240, 0, 0, (U32)(g_PhysCodecAddr.LowPart), (U32)(g_PhysPreviewAddr.LowPart));
//以下部分做了部分修改,主要就是修改了Frame Buffer地址和
void Display_Cam_Image(U32 pos_x, U32 pos_y, U32 size_x, U32 size_y, U8 port)
{
U8 *buffer_rgb;
U32 y;
int temp
{
temp= (s2440CAM->rCIPRSTATUS>>26)&3;
switch (temp)
{
case 0:
buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA1;
break;
case 1:
buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA2;
break;
case 2:
buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA3;
break;
case 3:
buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA4;
break;
default :
buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA1;
break;
}
}
buffer_rgb += VIRTUAL_UA_ADDRESS_OFFSET; //此时buffer_rgb = 0xa2ec3000 = buffer_rgb + 0x70000000 = 0x32ec3000 + 0x70000000
//把VIRTUAL_CA_FRAMEBUF_BASE = 0xa0100000或者0x80100000都设置过
for (y=0; y
{
//函数执行到memcpy就出现如下提示:Data Abort: Thread=83c7c794 Proc=81f9d340 'device.exe'
// AKY=00000005 PC=03fc36d0(coredll.dll+0x000536d0)RA=02e13448(camera.dll+0x00003448) BVA=3010c600 FSR=00000005
memcpy((void *)(VIRTUAL_CA_FRAMEBUF_BASE+ (QCIF_XSIZE*2*pos_y + pos_x) + y*QCIF_XSIZE*2), (void *)buffer_rgb, (QCIF_XSIZE)*2);
RETAILMSG(1, (TEXT("Display_Cam_Image 22222222\r\n"))); //该打印语句,没有输出,也就是没有执行到这步
buffer_rgb += (QCIF_XSIZE*2);
}
}
|
|