ICAMERA_RecordSnapshot Error | developer.brewmp.com ICAMERA_RecordSnapshot Error | developer.brewmp.com

Developer

ICAMERA_RecordSnapshot Error

Forums:

Hi,
Iam working on developing a camera application for KX2 (KOI) phone. When i run my application thro the simulator ICAMERA_SetMediaData() is failed returning 14 (for BADPARM) And when i run thro the device, it is SUCCEEDING, but ICAMERA_RecordSnapshot is failing returning 13 (EBADSTATE).
anyone worked on KX2 or familiar with this error please help.

below is the code snippet for your reference.

AEEMediaData md;
int nResult;

md.clsData = MMD_FILE_NAME;
md.pData = "test.jpg";
md.dwSize = 0;

//set the media data before calling RecordSnapshot

//nResult = ICAMERA_Stop(pMe->m_pICamera);

nResult = ICAMERA_SetMediaData(pMe->m_pICamera, &md,MT_JPG) ;
if(nResult){
DBGPRINTF("####### SetMediaData returned %d ########",nResult);
return;
}

nResult = ICAMERA_RecordSnapshot(pMe->m_pICamera);
if(nResult){
DBGPRINTF("####### RecordSnapShot REturned %d ######",nResult);
return;
}

nResult = ICAMERA_EncodeSnapshot(pMe->m_pICamera);
if(nResult){
DBGPRINTF("$$$$$$$ EncodeSnapshot returned %d $$$$$$$",nResult);
return;
}

Please le tme know your suggestions.
Thanks,
Regards,
~Naren

If you find solution please let me know because i am also facing the same problem.
Thanks.

If you find solution please let me know because i am also facing the same problem.
Thanks.

hi ...
in brew sdk they have given the step to take snap ....
follow the same step...

hi ...
in brew sdk they have given the step to take snap ....
follow the same step...

You must stop the camera in preview mode:
nResult = ICAMERA_Stop(pMe->m_pICamera);
Wait for notification that the camera has stopped.
Then call ICAMERA_SetMediaData and ICAMERA_RecordSnapshot.
Do not call ICAMERA_EncodeSnapshot, it is built into ICAMERA_RecordSnapshot.
You will get notification that the camera has started in SNAPSHOT mode, then done in same, and finally that ENCODESNAPSHOT is done.
See doc on ICAMERA_RecordSnapshot for exact sequence and exact command, sub-command, and status names.
Good luck!
- David

You must stop the camera in preview mode:
nResult = ICAMERA_Stop(pMe->m_pICamera);
Wait for notification that the camera has stopped.
Then call ICAMERA_SetMediaData and ICAMERA_RecordSnapshot.
Do not call ICAMERA_EncodeSnapshot, it is built into ICAMERA_RecordSnapshot.
You will get notification that the camera has started in SNAPSHOT mode, then done in same, and finally that ENCODESNAPSHOT is done.
See doc on ICAMERA_RecordSnapshot for exact sequence and exact command, sub-command, and status names.
Good luck!
- David