}
#ifdef _MMCAMCORDER_MURPHY_SUPPORT
+ _mmcam_dbg_warn("lock resource - cb calling %d", hcamcorder->resource_release_cb_calling);
+
+ _MMCAMCORDER_LOCK_RESOURCE(hcamcorder);
+
if (hcamcorder->type == MM_CAMCORDER_MODE_VIDEO_CAPTURE &&
- hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_RM) {
+ hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_RM &&
+ hcamcorder->resource_release_cb_calling == FALSE) {
gint64 end_time = 0;
- _mmcam_dbg_log("lock resource");
- _MMCAMCORDER_LOCK_RESOURCE(hcamcorder);
-
/* release resource */
ret = _mmcamcorder_resource_manager_release(&hcamcorder->resource_manager);
if (ret == MM_ERROR_RESOURCE_INVALID_STATE) {
_MMCAMCORDER_RESOURCE_WAIT_UNTIL(hcamcorder, end_time);
}
-
- _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
- _mmcam_dbg_log("unlock resource");
}
+
+ _MMCAMCORDER_UNLOCK_RESOURCE(hcamcorder);
+
+ _mmcam_dbg_warn("unlock resource");
#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
#ifdef _MMCAMCORDER_RM_SUPPORT
return;
}
- _MMCAMCORDER_LOCK_ASM(camcorder);
+ _mmcam_dbg_warn("enter");
- /* set value to inform a status is changed by resource manaer */
- camcorder->state_change_by_system = _MMCAMCORDER_STATE_CHANGE_BY_RM;
+ _MMCAMCORDER_LOCK_RESOURCE(camcorder);
if (!mrp_res_equal_resource_set(rs, camcorder->resource_manager.rset)) {
- _MMCAMCORDER_UNLOCK_ASM(camcorder);
+ _MMCAMCORDER_UNLOCK_RESOURCE(camcorder);
_mmcam_dbg_warn("- resource set(%p) is not same as this camcorder handle's(%p)", rs, camcorder->resource_manager.rset);
return;
}
+ /* set flag for resource release callback */
+ camcorder->resource_release_cb_calling = TRUE;
+
_mmcam_dbg_log(" - resource set state of camcorder(%p) is changed to [%s]",
camcorder, __mmcamcorder_resource_state_to_str(rs->state));
}
}
+ _MMCAMCORDER_UNLOCK_RESOURCE(camcorder);
+
+ _MMCAMCORDER_LOCK_ASM(camcorder);
+
+ /* set value to inform a status is changed by resource manager */
+ camcorder->state_change_by_system = _MMCAMCORDER_STATE_CHANGE_BY_RM;
+
/* Stop the camera */
__mmcamcorder_force_stop(camcorder);
_MMCAMCORDER_UNLOCK_ASM(camcorder);
+ _MMCAMCORDER_LOCK_RESOURCE(camcorder);
+
+ /* restore flag for resource release callback */
+ camcorder->resource_release_cb_calling = FALSE;
+
+ _MMCAMCORDER_UNLOCK_RESOURCE(camcorder);
+
+ _mmcam_dbg_warn("leave");
+
return;
}