int camera_set_preview_resolution(camera_h camera, int width, int height)
{
int ret = CAMERA_ERROR_NONE;
+ camera_state_e current_state = CAMERA_STATE_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
camera_msg_param param;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
+ ret = camera_get_state(camera, ¤t_state);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("failed to get current state 0x%x", ret);
+ return ret;
+ }
+
+ if (current_state == CAMERA_STATE_PREVIEW) {
+ ret = _camera_stop_evas_rendering(camera, false);
+ if (ret != CAMERA_ERROR_NONE)
+ return ret;
+ }
+ }
+
value = (width << 16) | height;
CAMERA_MSG_PARAM_SET(param, INT, value);
LOGD("ret : 0x%x", ret);
+ if (current_state == CAMERA_STATE_PREVIEW) {
+ LOGW("restart evas rendering");
+ _camera_start_evas_rendering(camera);
+ }
+
return ret;
}