Developer

API Reference

ICAMERA_RecordMultiShot()

Brew Release
Brew MP 1.0.2
See Also
ICAMERA_Start() ICAMERA_EncodeByIndex() ICAMERA_GetFrameByIndex() ICAMERA_SetDisplaySize() ICAMERA_SetSize()
Description
This function starts the camera operation in multishot mode which causes the camera to take multiple(configured) snapshots.
ICAMERA_RecordMultiShot() starts the multi snapshot recording operation when the callback is sent with the following values nStatus = CAM_STATUS_START nCmd = CAM_CMD_START nSubCmd = CAM_MODE_SNAPSHOT At this point the camera is in the mode CAM_MODE_SNAPSHOT.
Each frame captured will send a unique event nStatus = CAM_STATUS_FRAME nCmd = CAM_CMD_START nSubCmd = CAM_MODE_SNAPSHOT pData = (int) [the frame index] Optionally these frames can be retrieved and displayed to the screen using ICAMERA_GetFrameByIndex() and DISPLAY_BitBlt(). Now, only raw frame is captured and it is not yet encoded. AEECameraNotify::*pData contains an integer (the frame index)
Optionally ICamera_Stop() will stop the multishot operation. It clears all the multishot related data, already captured frames before processing stop are also discarded.
When this operation is complete the callback is sent with the following values nStatus = CAM_STATUS_DONE nCmd = CAM_CMD_START nSubCmd = CAM_MODE_SNAPSHOT pData = (int) [Total # of snapshots] At this point the camera is in the mode CAM_MODE_READY.
If this operation is stopped by calling ICAMERA_Stop() the callback would have value of nStatus = CAM_STATUS_ABORT, instead of nStatus = CAM_STATUS_DONE.
For the MultiShot operation no images are encoded automatically. They must be encoded using ICAMERA_EncodeByIndex(). CAM_PARM_DEFER_ENCODE is not used in multishot mode.
Encoding can be done in Ready state after CAM_STATUS_DONE is received for ICAMERA_RecordMultiShot(). ICAMERA_EncodeByIndex() encodes the raw frame and sends {CAM_CMD_ENCODE_SNAPSHOT, CAM_STATUS_DONE} callback when encoding is done.
It is recommended that at least two frames be captured for the camera sensor to adjust to the lighting conditions before snapshots are captured.
Parameters
  • pICamera
    []:
    Pointer to ICamera Interface.
  • pCms
    []:
    Pointer to CameraMultiShot structure.
Interface
ICAMERA
Prototype
    int ICAMERA_RecordMultiShot(ICamera *pICamera, CameraMultiShot *pCms);
Return
SUCCESS: Asynchronous command accepted. Check callback for result and completion. EFAILED: General failure EBADPARM: Bad parameter is passed ENOMEMORY: Not enough memory EBADSTATE: Cannot execute operation because the camera is in the wrong mode.
Side Effect
None.
Comment
This function is always asynchronous. This function should be called when the camera is in CAM_MODE_READY. This function should be called with the interval and number of snaps to be recorded, If pCms->nCount is 1, it works similar to that of ICAMERA_RecordSnapshot.
  • Follow