int *ret, camera_msg_param *param, int timeout)
{
int send_ret = 0;
+ int array_length;
char *msg = NULL;
if (!cb_info || !param) {
param->type, param->name, param->value.value_STRING,
NULL);
break;
+ case MUSE_TYPE_ARRAY:
+ array_length = param->value_size / sizeof(int) + \
+ (param->value_size % sizeof(int) ? 1 : 0);
+
+ msg = muse_core_msg_new(api,
+ param->type, param->name, array_length, param->value.value_ARRAY,
+ NULL);
+ break;
default:
LOGE("unknown type %d", param->type);
break;
pc->remote_handle = handle;
pc->cb_info->bufmgr = bufmgr;
pc->cb_info->preview_format = preview_format;
- pc->cb_info->dp_type = CAMERA_DISPLAY_TYPE_NONE;
+ pc->cb_info->dp_info.type = CAMERA_DISPLAY_TYPE_NONE;
pc->cb_info->user_buffer_supported = (gboolean)user_buffer_supported;
LOGD("default preview format %d, user buffer %d",
}
LOGD("Enter : preview format %d, display type %d",
- pc->cb_info->preview_format, pc->cb_info->dp_type);
+ pc->cb_info->preview_format, pc->cb_info->dp_info.type);
ret = camera_get_state(camera, ¤t_state);
if (ret != CAMERA_ERROR_NONE) {
}
if (pc->cb_info->preview_format == CAMERA_PIXEL_FORMAT_INVZ &&
- pc->cb_info->dp_type != CAMERA_DISPLAY_TYPE_NONE) {
+ pc->cb_info->dp_info.type != CAMERA_DISPLAY_TYPE_NONE) {
LOGE("CAMERA_DISPLAY_TYPE_NONE[current %d] should be set with INVZ format",
- pc->cb_info->dp_type);
+ pc->cb_info->dp_info.type);
return CAMERA_ERROR_INVALID_OPERATION;
}
int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
{
+ int mm_ret = MM_ERROR_NONE;
int ret = CAMERA_ERROR_NONE;
- int parent_id = 0;
camera_cli_s *pc = (camera_cli_s *)camera;
camera_cb_info_s *cb_info = NULL;
camera_state_e current_state = CAMERA_STATE_NONE;
- camera_msg_param param0;
- camera_msg_param param1;
+ camera_msg_param param;
muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
+ muse_camera_display_info_s *dp_info = NULL;
if (!pc || !pc->cb_info) {
LOGE("NULL handle");
}
cb_info = (camera_cb_info_s *)pc->cb_info;
+ dp_info = &cb_info->dp_info;
ret = camera_get_state(camera, ¤t_state);
if (ret != CAMERA_ERROR_NONE) {
return CAMERA_ERROR_NOT_SUPPORTED;
}
- ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &parent_id);
- if (ret != MM_ERROR_NONE) {
- LOGE("[INVALID_OPERATION] set display failed[0x%x]", ret);
+ mm_ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &dp_info->parent_id);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("[INVALID_OPERATION] set display failed[0x%x]", mm_ret);
return CAMERA_ERROR_INVALID_OPERATION;
}
- if (type == CAMERA_DISPLAY_TYPE_EVAS) {
+ if (type == CAMERA_DISPLAY_TYPE_OVERLAY) {
+ mm_ret = mm_display_interface_get_window_rect(cb_info->dp_interface, &dp_info->window_rect);
+
+ LOGD("ret 0x%x, parent_id %d, window rect %d,%d,%dx%d",
+ ret, dp_info->parent_id, dp_info->window_rect.x, dp_info->window_rect.y,
+ dp_info->window_rect.width, dp_info->window_rect.height);
+ } else if (type == CAMERA_DISPLAY_TYPE_EVAS) {
//LCOV_EXCL_START
camera_flip_e flip = CAMERA_FLIP_NONE;
camera_display_mode_e mode = CAMERA_DISPLAY_MODE_LETTER_BOX;
LOGD("current setting : flip %d, mode %d, rotation %d, visible %d, roi %d,%d,%dx%d",
flip, mode, rotation, visible, x, y, width, height);
- ret = mm_display_interface_evas_set_flip(cb_info->dp_interface, flip);
- ret |= mm_display_interface_evas_set_mode(cb_info->dp_interface, mode);
- ret |= mm_display_interface_evas_set_rotation(cb_info->dp_interface, rotation);
- ret |= mm_display_interface_evas_set_visible(cb_info->dp_interface, visible);
+ mm_ret = mm_display_interface_evas_set_flip(cb_info->dp_interface, flip);
+ mm_ret |= mm_display_interface_evas_set_mode(cb_info->dp_interface, mode);
+ mm_ret |= mm_display_interface_evas_set_rotation(cb_info->dp_interface, rotation);
+ mm_ret |= mm_display_interface_evas_set_visible(cb_info->dp_interface, visible);
if (mode == CAMERA_DISPLAY_MODE_CUSTOM_ROI)
- ret |= mm_display_interface_evas_set_roi_area(cb_info->dp_interface, x, y, width, height);
+ mm_ret |= mm_display_interface_evas_set_roi_area(cb_info->dp_interface, x, y, width, height);
//LCOV_EXCL_STOP
}
}
- CAMERA_MSG_PARAM_SET(param0, INT, type);
- CAMERA_MSG_PARAM_SET(param1, INT, parent_id);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_ret 0x%x failed", mm_ret);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
- _camera_msg_send_param2_int(api, cb_info, &ret,
- ¶m0, ¶m1, CAMERA_CB_TIMEOUT);
+ dp_info->type = type;
- if (ret == CAMERA_ERROR_NONE) {
- pc->cb_info->dp_type = type;
+ CAMERA_MSG_PARAM_SET_ARRAY(param, ARRAY, dp_info, sizeof(muse_camera_display_info_s));
+
+ _camera_msg_send_param1(api, cb_info, &ret, ¶m, CAMERA_CB_TIMEOUT);
+ if (ret == CAMERA_ERROR_NONE) {
if (type == CAMERA_DISPLAY_TYPE_EVAS)
SET_PREVIEW_CB_TYPE(cb_info, PREVIEW_CB_TYPE_EVAS);
}