Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.229
+Version: 0.10.230
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
*/
#define MMCAM_PLATFORM_PRIVILEGE_CAMERA "platform-privilege-camera"
-/**
- * Log level
- */
-#define MMCAM_LOG_LEVEL "log-level"
-
/*=======================================================================================
| ENUM DEFINITIONS |
/* external storage state management */
int mm_camcorder_manage_external_storage_state(MMHandleType camcorder, int storage_state);
+/* get log level */
+int mm_camcorder_get_log_level(void);
+
/**
@}
*/
MM_CAM_SUPPORT_USER_BUFFER,
MM_CAM_USER_BUFFER_FD,
MM_CAM_PLATFORM_PRIVILEGE_CAMERA,
- MM_CAM_LOG_LEVEL,
MM_CAM_STROBE_BRIGHTNESS,
MM_CAM_ATTRIBUTE_NUM
} MMCamcorderAttrsID;
/*=======================================================================================
| GLOBAL DEFINITIONS AND DECLARATIONS FOR CAMCORDER |
========================================================================================*/
-extern int mmcam_log_level;
+
/*=======================================================================================
| MACRO DEFINITIONS |
/* log */
#define MMCAM_LOG_CRITICAL(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_CRITICAL) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_CRITICAL) \
SLOGF(format, ##args); \
} while (0)
#define MMCAM_LOG_ERROR(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_ERROR) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_ERROR) \
SLOGE(format, ##args); \
} while (0)
#define MMCAM_LOG_WARNING(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_WARNING) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_WARNING) \
SLOGW(format, ##args); \
} while (0)
#define MMCAM_LOG_INFO(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_INFO) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_INFO) \
SLOGI(format, ##args); \
} while (0)
#define MMCAM_LOG_DEBUG(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_DEBUG) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_DEBUG) \
SLOGD(format, ##args); \
} while (0)
#define MMCAM_LOG_VERBOSE(format, args...) \
do { \
- if (mmcam_log_level >= MM_CAMCORDER_LOG_LEVEL_VERBOSE) \
+ if (_mmcamcorder_get_log_level() >= MM_CAMCORDER_LOG_LEVEL_VERBOSE) \
SLOGD("[V] "format, ##args); \
} while (0)
/* check encoded pixel format */
gboolean _mmcamcorder_is_encoded_preview_pixel_format(int pixel_format);
+/* log */
+void _mmcamcorder_set_log_level(int level);
+int _mmcamcorder_get_log_level(void);
+
#ifdef __cplusplus
}
return _mmcamcorder_manage_external_storage_state(camcorder, storage_state);
}
+
+int mm_camcorder_get_log_level(void)
+{
+ return _mmcamcorder_get_log_level();
+}
MM_CAM_SUPPORT_ZSL_CAPTURE,
MM_CAM_SUPPORT_ZERO_COPY_FORMAT,
MM_CAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB,
- MM_CAM_PLATFORM_PRIVILEGE_CAMERA,
- MM_CAM_LOG_LEVEL
+ MM_CAM_PLATFORM_PRIVILEGE_CAMERA
};
/*-----------------------------------------------------------------------
NULL,
},
{
- MM_CAM_LOG_LEVEL,
- "log-level",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- {(void*)MM_CAMCORDER_LOG_LEVEL_INFO},
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_CAMCORDER_LOG_LEVEL_CRITICAL},
- {.int_max = MM_CAMCORDER_LOG_LEVEL_VERBOSE},
- NULL,
- },
- {
MM_CAM_STROBE_BRIGHTNESS,
"strobe-brightness",
MM_ATTRS_TYPE_INT,
#include "mm_camcorder_rm.h"
#endif /* _MMCAMCORDER_RM_SUPPORT */
-/* log level */
-int mmcam_log_level = MM_CAMCORDER_LOG_LEVEL_INFO;
-
/*---------------------------------------------------------------------------------------
| LOCAL VARIABLE DEFINITIONS for internal |
---------------------------------------------------------------------------------------*/
static gint __mmcamcorder_init_handle(mmf_camcorder_t **hcamcorder, int device_type)
{
int ret = MM_ERROR_NONE;
+ int log_level = MM_CAMCORDER_LOG_LEVEL_INFO;
mmf_camcorder_t *new_handle = NULL;
if (!hcamcorder) {
_mmcamcorder_conf_get_value_int((MMHandleType)new_handle, new_handle->conf_main,
CONFIGURE_CATEGORY_MAIN_GENERAL,
"LogLevel",
- &mmcam_log_level);
+ &log_level);
+
+ _mmcamcorder_set_log_level(log_level);
/* allocate attribute */
new_handle->attributes = _mmcamcorder_alloc_attribute((MMHandleType)new_handle);
goto _INIT_HANDLE_FAILED;
}
- /* Set log level to attribute */
- ret = mm_camcorder_set_attributes((MMHandleType)new_handle, NULL,
- MMCAM_LOG_LEVEL, mmcam_log_level,
- NULL);
-
- MMCAM_LOG_INFO("set log level[%d], ret[0x%x]", mmcam_log_level, ret);
-
*hcamcorder = new_handle;
MMCAM_LOG_INFO("new handle %p", new_handle);
/*-----------------------------------------------------------------------
| GLOBAL VARIABLE DEFINITIONS for internal |
-----------------------------------------------------------------------*/
+static int mmcam_log_level = MM_CAMCORDER_LOG_LEVEL_INFO;
/*-----------------------------------------------------------------------
| LOCAL VARIABLE DEFINITIONS for internal |
return (pixel_format == MM_PIXEL_FORMAT_ENCODED_H264 ||
pixel_format == MM_PIXEL_FORMAT_ENCODED_MJPEG);
}
+
+void _mmcamcorder_set_log_level(int level)
+{
+ MMCAM_LOG_WARNING("set log level[%d]", level);
+ mmcam_log_level = level;
+}
+
+int _mmcamcorder_get_log_level(void)
+{
+ return mmcam_log_level;
+}