API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
ICAMERA_Start() ICAMERA_EncodeSnapshot() ICAMERA_DeferEncode() ICAMERA_GetFrame() ICAMERA_SetDisplaySize() ICAMERA_SetSize() ICAMERA_SetMediaData() ICAMERA_SetQuality() ICAMERA_SetVideoEncode()
This function starts the camera operation in snapshot mode which causes the camera to take a snapshot. If Defer Encoding is not enabled (default), this function causes the snapshot to be encoded.
Pointer to ICamera Interface.
  •     int ICAMERA_RecordSnapshot(ICamera *pICamera);
  • 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.
This function is always asynchronous. This function should be called when the camera is in CAM_MODE_READY. You need to set the media data before calling this function. Also, you may want to specify active encoding, picture format and quality that should be used for encoding the snapshot. In the callback, AEECameraNotify, nCmd = CAM_CMD_START nSubCmd = CAM_MODE_SNAPSHOT. This function results in {CAM_CMD_START, CAM_STATUS_START} callback followed by {CAM_CMD_START, CAM_STATUS_DONE} callback after the snapshot is taken. This is followed by {CAM_CMD_ENCODESNAPSHOT, CAM_STATUS_DONE} callback after the snapshot is encoded. You can defer encoding by calling ICAMERA_DeferEncoding(pICamera, TRUE); This causes ICAMERA_RecordSnapshot() not to encode the snapshot. You can get the raw snapshot frame using ICAMERA_GetFrame() and call ICAMERA_EncodeSnapshot() to encode the snapshot. If the camera never enters the preview or movie mode before encoding a snapshot the image may be all black or white because the camera sensor has not adjusted to the lighting conditions. It is recommended that atleast two frames be captured for the camera sensor to adjust to the lighting conditions.