*/
typedef enum
{
- CAMERA_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- CAMERA_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- CAMERA_ERROR_INVALID_STATE = CAMERA_ERROR_CLASS | 0x02, /**< Invalid state */
- CAMERA_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- CAMERA_ERROR_DEVICE = CAMERA_ERROR_CLASS | 0x04, /**< Device error */
- CAMERA_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Internal error */
- CAMERA_ERROR_SOUND_POLICY = CAMERA_ERROR_CLASS | 0x06, /**< Blocked by Audio Session Manager */
- CAMERA_ERROR_SECURITY_RESTRICTED = CAMERA_ERROR_CLASS | 0x07, /**< Restricted by security system policy */
- CAMERA_ERROR_DEVICE_BUSY = CAMERA_ERROR_CLASS | 0x08, /**< The device is using in other applications or working some operation */
- CAMERA_ERROR_DEVICE_NOT_FOUND = CAMERA_ERROR_CLASS | 0x09, /**< No camera device */
+ CAMERA_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ CAMERA_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ CAMERA_ERROR_INVALID_STATE = CAMERA_ERROR_CLASS | 0x02, /**< Invalid state */
+ CAMERA_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ CAMERA_ERROR_DEVICE = CAMERA_ERROR_CLASS | 0x04, /**< Device error */
+ CAMERA_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Internal error */
+ CAMERA_ERROR_SOUND_POLICY = CAMERA_ERROR_CLASS | 0x06, /**< Blocked by Audio Session Manager */
+ CAMERA_ERROR_SECURITY_RESTRICTED = CAMERA_ERROR_CLASS | 0x07, /**< Restricted by security system policy */
+ CAMERA_ERROR_DEVICE_BUSY = CAMERA_ERROR_CLASS | 0x08, /**< The device is using in other applications or working some operation */
+ CAMERA_ERROR_DEVICE_NOT_FOUND = CAMERA_ERROR_CLASS | 0x09, /**< No camera device */
+ CAMERA_ERROR_SOUND_POLICY_BY_CALL = CAMERA_ERROR_CLASS | 0x0a, /**< Blocked by Audio Session Manager - CALL */
+ CAMERA_ERROR_SOUND_POLICY_BY_ALARM = CAMERA_ERROR_CLASS | 0x0b, /**< Blocked by Audio Session Manager - ALARM */
} camera_error_e;
*/
typedef enum
{
- CAMERA_POLICY_NONE = 0, /**< None */
- CAMERA_POLICY_SOUND, /**< Sound policy */
- CAMERA_POLICY_SECURITY /**< Security policy */
+ CAMERA_POLICY_NONE = 0, /**< None */
+ CAMERA_POLICY_SOUND, /**< Sound policy */
+ CAMERA_POLICY_SOUND_BY_CALL, /**< Sound policy by CALL */
+ CAMERA_POLICY_SOUND_BY_ALARM, /**< Sound policy by ALARM */
+ CAMERA_POLICY_SECURITY /**< Security policy */
} camera_policy_e;
#include <stdlib.h>
#include <string.h>
#include <mm.h>
+#include <audio-session-manager-types.h>
#include <mm_camcorder.h>
#include <mm_types.h>
#include <math.h>
ret = CAMERA_ERROR_SOUND_POLICY;
errorstr = "ERROR_SOUND_POLICY";
break;
+ case MM_ERROR_POLICY_BLOCKED_BY_CALL:
+ ret = CAMERA_ERROR_SOUND_POLICY_BY_CALL;
+ errorstr = "ERROR_SOUND_POLICY_BY_CALL";
+ break;
+ case MM_ERROR_POLICY_BLOCKED_BY_ALARM:
+ ret = CAMERA_ERROR_SOUND_POLICY_BY_ALARM;
+ errorstr = "ERROR_SOUND_POLICY_BY_ALARM";
+ break;
case MM_ERROR_POLICY_RESTRICTED:
ret = CAMERA_ERROR_SECURITY_RESTRICTED;
errorstr = "ERROR_RESTRICTED";
previous_state = handle->state;
handle->state = __camera_state_convert(m->state.current );
camera_policy_e policy = CAMERA_POLICY_NONE;
- if(message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM )
- policy = CAMERA_POLICY_SOUND;
- else if( message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY )
+ if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM) {
+ switch (m->state.code) {
+ case ASM_EVENT_SOURCE_CALL_START:
+ policy = CAMERA_POLICY_SOUND_BY_CALL;
+ LOGE("CAMERA_POLICY_SOUND_BY_CALL");
+ break;
+ case ASM_EVENT_SOURCE_ALARM_START:
+ case ASM_EVENT_SOURCE_ALARM_END:
+ policy = CAMERA_POLICY_SOUND_BY_ALARM;
+ LOGE("CAMERA_POLICY_SOUND_BY_ALARM");
+ break;
+ default:
+ policy = CAMERA_POLICY_SOUND;
+ LOGE("CAMERA_POLICY_SOUND");
+ break;
+ }
+ } else if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY) {
policy = CAMERA_POLICY_SECURITY;
+ LOGE("CAMERA_POLICY_SECURITY");
+ }
if( previous_state != handle->state && handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE] ){
((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(previous_state, handle->state, policy, handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);