ICamera的问题,大大的问题,付上代码
nntt 2010-09-29 09:40:56 static void CMKLCameraCtl_Notify( void* pUser, AEECameraNotify* pNotify )
{
CMKLCameraCtl* pCtl = (CMKLCameraCtl*)pUser;
if ( pCtl == NULL )
{
return;
}
switch ( pNotify->nStatus )
{
case CAM_STATUS_START:
{
DBGPRINTF( "%s\r\n", "111111111111111111111111111111111111111" );
}
break;
case CAM_STATUS_DONE:
{
DBGPRINTF( "%s\r\n", "222222222222222222222222222222222222222" );
}
break;
case CAM_STATUS_ABORT:
{
DBGPRINTF( "%s\r\n", "333333333333333333333333333333333333333" );
}
break;
case CAM_STATUS_FRAME:
{
DBGPRINTF( "%s\r\n", "4444444444444444444444444444444444444444" );
IBitmap* pFrame = NULL;
AEEBitmapInfo bi;
if ( SUCCESS != ICAMERA_GetFrame( pCtl->m_pCameraCtl, &pFrame ) )
{
return;
}
if ( pFrame == NULL )
{
return;
}
IBITMAP_GetInfo( pFrame, &bi, sizeof(bi) );
IDISPLAY_BitBlt( ((AEEApplet*)GETAPPINSTANCE())->m_pIDisplay, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY );
IDISPLAY_UpdateEx( ((AEEApplet*)GETAPPINSTANCE())->m_pIDisplay, TRUE );
IBITMAP_Release(pFrame);
}
break;
}
}
boolean CMKLCameraCtl_Start( CMKLCameraCtl* pCtl )
{
if ( pCtl == NULL )
{
return FALSE;
}
if ( SUCCESS != ISHELL_CreateInstance( ((AEEApplet*)GETAPPINSTANCE())->m_pIShell, AEECLSID_CAMERA, (void**)&pCtl->m_pCameraCtl ) )
{
return FALSE;
}
AEESize size;
size.cx = 240;
size.cy = 320;
ICAMERA_RegisterNotify( pCtl->m_pCameraCtl, CMKLCameraCtl_Notify, (void*)pCtl );
ICAMERA_SetDisplaySize( pCtl->m_pCameraCtl, &size );
ICAMERA_SetParm( pCtl->m_pCameraCtl, CAM_PARM_PREVIEW_TYPE, CAM_PREVIEW_SNAPSHOT, 0 );
ICAMERA_Preview( pCtl->m_pCameraCtl );
DBGPRINTF( "%s\r\n", "-----------------------------------------" );
return TRUE;
}
上面代码在模拟器里面,CMKLCameraCtl_Notify回调时执行CAM_STATUS_START,并没有执行CAM_STATUS_FRAME,
而在海信E6上面执行为CAM_STATUS_DONE和CAM_STATUS_ABORT,也没有执行CAM_STATUS_FRAME,请问代码出现的问题在哪,还缺少什么调置,为什么我老执行不了CAM_STATUS_FRAME,我看别人的软件就可以正常预览和拍照,快崩溃了,曹老师有没有demo给一个