异常的Camera,寻求根本原因
请教一下各位高手一个Camera的异常。
最近做一个有关照相机的项目,发现在LG大部分手机和海信C807的照相机接口不能拍照。但是三星的手机都没有问题。不知道是怎么回事。
具体异常情况海信C807是必须开机之后首先进入系统自带那个照相机拍一下照,然后在进入自己的程序里,拍照就能成功保存拍摄的照片,否则拍摄就不成功。
而LG的手机即使像海信的那样操作也不能拍照,不能保存下来照片。
是因为拍照后,回调函数内的事件走法不是我们预想的。而是很异常的。
下面是我的回调程序:
void MYCAMERA_Notify(void *pUser,AEECameraNotify *pNoy)
{
MyCamera* pMe = (MyCamera *)pUser;
int iErr = 0;
pMe->pMsg(pMe->pOwner,0xffff);
switch (pNoy->nStatus)
{
case CAM_STATUS_START:
switch(pNoy->nCmd )
{
case CAM_CMD_START:
switch(pNoy->nSubCmd)
{
case CAM_MODE_PREVIEW:
break;
case CAM_MODE_SNAPSHOT:
break;
case CAM_MODE_MOVIE:
break;
case CAM_MODE_READY:
break;
}
break;
case CAM_CMD_ENCODESNAPSHOT:
break;
case CAM_CMD_SETPARM:
break;
case CAM_CMD_GETPARM:
break;
}
break;
case CAM_STATUS_DONE:
switch(pNoy->nCmd )
{
case CAM_CMD_START:
switch(pNoy->nSubCmd)
{
case CAM_MODE_PREVIEW:
iErr = ICAMERA_DeferEncode(pMe->pCamera,TRUE);
iErr = ICAMERA_RecordSnapshot(pMe->pCamera);
break;
case CAM_MODE_SNAPSHOT:
{
char files[30];
JulianType pDate;
GETJULIANDATE(GETTIMESECONDS(), &pDate);
pMe->stMedData.clsData = MMD_FILE_NAME;
pMe->stMedData.pData = UPDATA_FILE_NAME;
pMe->stMedData.dwSize = 0;
iErr = ICAMERA_SetMediaData(pMe->pCamera,&pMe->stMedData,MT_JPG);
iErr = ICAMERA_EncodeSnapshot(pMe->pCamera);
if(SUCCESS == iErr)
{
pMe->pMsg(pMe->pOwner,SUCCESS);
}
break;
}
case CAM_MODE_MOVIE:
break;
case CAM_MODE_READY:
break;
}
break;
case CAM_CMD_ENCODESNAPSHOT:
break;
case CAM_CMD_SETPARM:
break;
case CAM_CMD_GETPARM:
break;
}
break;
case CAM_STATUS_FAIL:
break;
case CAM_STATUS_ABORT:
break;
case CAM_STATUS_FRAME:
{
AEEDeviceInfo astInfo;
IBitmap * pFrame;
AEEBitmapInfo bi;
ISHELL_GetDeviceInfo(pMe->pApp->m_pIShell,&astInfo);
if (SUCCESS != ICAMERA_GetFrame(pMe->pCamera, &pFrame))
return;
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
IDISPLAY_BitBlt(pMe->pApp->m_pIDisplay, 0, (astInfo.cyScreen - bi.cy)/2, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_PAUSE:
break;
case CAM_STATUS_RESUME:
break;
case CAM_STATUS_DATA_IO_DELAY:
break;
case CAM_STATUS_SPACE_WARNING:
break;
default:
break;
}
return ;
}