int module_index = -1;
int device_type = (int)device;
- if (!camera) {
- CAM_LOG_ERROR("NULL pointer");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
CAM_LOG_INFO("device %d, is_network %d", device, is_network);
sock_fd = muse_client_new();
CAM_LOG_INFO("default preview format %d, user buffer %d, log level %d",
preview_format, user_buffer_supported, g_camera_log_level);
+ if (!camera) {
+ CAM_LOG_ERROR("NULL out handle");
+ ret= CAMERA_ERROR_INVALID_PARAMETER;
+ goto ErrorExit;
+ }
+
*camera = (camera_h)pc;
/* get display interface handle */
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_SET_EXTRA_PREVIEW_CB;
- if (!pc || !pc->cb_info || !callback) {
- CAM_LOG_ERROR("NULL pointer %p %p", pc, callback);
+ CAMERA_CHECK_HANDLE_RETURN_VAL(pc, CAMERA_ERROR_INVALID_PARAMETER);
+
+ if (!camera_is_supported_extra_preview(camera)) {
+ CAM_LOG_ERROR("extra preview is not supported");
+ return CAMERA_ERROR_NOT_SUPPORTED;
+ }
+
+ if (!callback) {
+ CAM_LOG_ERROR("NULL callback");
return CAMERA_ERROR_INVALID_PARAMETER;
}
CAMERA_CHECK_HANDLE_RETURN_VAL(pc, CAMERA_ERROR_INVALID_PARAMETER);
+ if (!camera_is_supported_extra_preview(camera)) {
+ CAM_LOG_ERROR("extra preview is not supported");
+ return CAMERA_ERROR_NOT_SUPPORTED;
+ }
+
CAM_LOG_INFO("Enter");
_camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);