}
+static bool __is_supported_common(camera_h camera, muse_camera_api_e api)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+
+ if (!pc || !pc->cb_info) {
+ CAM_LOG_ERROR("api[%d] NULL handle[%p]", api, pc);
+ set_last_result(CAMERA_ERROR_INVALID_PARAMETER);
+ return false;
+ }
+
+ CAM_LOG_INFO("Enter - api[%d]", api);
+
+ _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+
+ CAM_LOG_INFO("Leave - api[%d], ret[%d]", api, ret);
+
+ return (bool)ret;
+}
+
+
int _camera_client_wait_for_cb_return(muse_camera_api_e api, camera_cb_info_s *cb_info, int time_out)
{
int ret = CAMERA_ERROR_NONE;
bool camera_is_supported_continuous_capture(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE);
}
bool camera_is_supported_face_detection(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_SUPPORT_FACE_DETECTION);
}
bool camera_is_supported_zero_shutter_lag(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG);
}
bool camera_is_supported_media_packet_preview_cb(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB);
}
bool camera_is_supported_extra_preview(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_EXTRA_PREVIEW;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_SUPPORT_EXTRA_PREVIEW);
}
bool camera_attr_is_supported_hdr_capture(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE);
}
bool camera_attr_is_supported_anti_shake(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE);
}
bool camera_attr_is_supported_video_stabilization(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION);
}
bool camera_attr_is_supported_auto_contrast(camera_h camera)
{
- int ret = CAMERA_ERROR_NONE;
- camera_cli_s *pc = (camera_cli_s *)camera;
- muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
-
- if (!pc || !pc->cb_info) {
- CAM_LOG_ERROR("NULL handle[%p]", pc);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- CAM_LOG_INFO("Enter");
-
- _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
-
- if (ret < 0) {
- CAM_LOG_ERROR("error is occurred 0x%x", ret);
- ret = false;
- }
-
- CAM_LOG_INFO("ret : %d", ret);
-
- return (bool)ret;
+ return __is_supported_common(camera, MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST);
}