ret = mm_camcorder_set_attributes(handle->mm_handle, &error,
MMCAM_MODE, MM_CAMCORDER_MODE_VIDEO_CAPTURE,
- MMCAM_CAMERA_FORMAT, preview_format,
+ MMCAM_CAMERA_FORMAT, preview_format,
MMCAM_IMAGE_ENCODER, MM_IMAGE_CODEC_JPEG,
- MMCAM_CAPTURE_FORMAT, MM_PIXEL_FORMAT_ENCODED,
+ MMCAM_CAPTURE_FORMAT, MM_PIXEL_FORMAT_ENCODED,
MMCAM_DISPLAY_SURFACE, MM_DISPLAY_SURFACE_NULL,
MMCAM_DISPLAY_ROTATION, rotation,
MMCAM_CAPTURE_COUNT, 1,
MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
int supported_zsl = FALSE;
int ret = MM_ERROR_NONE;
+ camera_attr_hdr_mode_e hdr_mode = CAMERA_ATTR_HDR_MODE_DISABLE;
mm_camcorder_get_state(handle->mm_handle, &state);
if (state != MM_CAMCORDER_STATE_PREPARE) {
return __convert_camera_error_code(__func__, ret);
}
+ /* check current HDR mode */
+ if (legacy_camera_attr_get_hdr_mode(camera, &hdr_mode) == CAMERA_ERROR_NONE) {
+ LOGD("current HDR mode %d", hdr_mode);
+ if (hdr_mode != CAMERA_ATTR_HDR_MODE_DISABLE) {
+ LOGE("continuous capture is not supported in HDR mode");
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+ }
+
handle->capture_count = count;
handle->is_continuous_shot_break = false;
handle->current_capture_count = 0;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (width <= 0 || height <= 0) {
+ LOGE("invalid preview resolution %dx%d", width, height);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
MMCamAttrsInfo info;
}
-int legacy_camera_set_capture_resolution(camera_h camera, int width, int height)
+int legacy_camera_set_capture_resolution(camera_h camera, int width, int height)
{
if (camera == NULL) {
LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (width <= 0 || height <= 0) {
+ LOGE("invalid capture resolution %dx%d", width, height);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (format < CAMERA_PIXEL_FORMAT_NV12 || format > CAMERA_PIXEL_FORMAT_H264 ||
+ (format > CAMERA_PIXEL_FORMAT_JPEG && format < CAMERA_PIXEL_FORMAT_H264)) {
+ LOGE("invalid preview format %d", format);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (format < CAMERA_PIXEL_FORMAT_NV12 || format > CAMERA_PIXEL_FORMAT_H264 ||
+ (format > CAMERA_PIXEL_FORMAT_JPEG && format < CAMERA_PIXEL_FORMAT_H264)) {
+ LOGE("invalid preview format %d", format);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int i = 0;
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270) {
+ LOGE("invalid rotation %d", rotation);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH) {
+ LOGE("invalid flip %d", flip);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_DISPLAY_MODE_LETTER_BOX || mode > CAMERA_DISPLAY_MODE_CROPPED_FULL) {
+ LOGE("invalid mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_THEATER_MODE_DISABLE || mode > CAMERA_ATTR_THEATER_MODE_ENABLE) {
+ LOGE("invalid theater mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
}
-int legacy_camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
+int legacy_camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
{
if (camera == NULL) {
LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (fps < CAMERA_ATTR_FPS_AUTO || fps > CAMERA_ATTR_FPS_120) {
+ LOGE("invalid preview fps %d", fps);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (quality <= 0 || quality > 100) {
+ LOGE("invalid image quality %d", quality);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (zoom < 0) {
+ LOGE("invalid zoom %d", zoom);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_AF_NONE || mode > CAMERA_ATTR_AF_FULL) {
+ LOGE("invalid mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
int focus_mode;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (x < 0 || y < 0) {
+ LOGE("invalid AF area %d, %d", x, y);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
camera_attr_af_mode_e mode;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
+ LOGE("invalid exposure mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int maptable[] = {MM_CAMCORDER_AUTO_EXPOSURE_OFF, /* CAMERA_ATTR_EXPOSURE_MODE_OFF */
MM_CAMCORDER_AUTO_EXPOSURE_ALL, /* CAMERA_ATTR_EXPOSURE_MODE_ALL */
MM_CAMCORDER_AUTO_EXPOSURE_CENTER_1, /* CAMERA_ATTR_EXPOSURE_MODE_CENTER */
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (iso < CAMERA_ATTR_ISO_AUTO || iso > CAMERA_ATTR_ISO_3200) {
+ LOGE("invalid iso %d", iso);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s*)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
+ LOGE("invalid white balance %d", wb);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (effect < CAMERA_ATTR_EFFECT_NONE || effect > CAMERA_ATTR_EFFECT_OTHER_GRAPHICS) {
+ LOGE("invalid effect %d", effect);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_SCENE_MODE_NORMAL || mode > CAMERA_ATTR_SCENE_MODE_AQUA) {
+ LOGE("invalid scene mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
camera_s *handle = (camera_s *)camera;
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
- MMCAM_TAG_IMAGE_DESCRIPTION, description, strlen(description),
- NULL);
+ MMCAM_TAG_IMAGE_DESCRIPTION, description, description ? strlen(description) : 0,
+ NULL);
return __convert_camera_error_code(__func__, ret);
}
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (orientation < CAMERA_ATTR_TAG_ORIENTATION_TOP_LEFT || orientation > CAMERA_ATTR_TAG_ORIENTATION_LEFT_BOTTOM) {
+ LOGE("invalid tag orientation %d", orientation);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
- MMCAM_TAG_ORIENTATION, orientation,
- NULL);
+ MMCAM_TAG_ORIENTATION, orientation,
+ NULL);
return __convert_camera_error_code(__func__, ret);
}
camera_s *handle = (camera_s *)camera;
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
- MMCAM_TAG_SOFTWARE, software, strlen(software),
- NULL);
+ MMCAM_TAG_SOFTWARE, software, software ? strlen(software) : 0,
+ NULL);
return __convert_camera_error_code(__func__, ret);
}
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (latitude > 90.0 || latitude < -90.0 ||
+ longitude > 180.0 || longitude < -180.0) {
+ LOGE("invalid geotag: latitude %lf, logitude %lf", latitude, longitude);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_FLASH_MODE_OFF || mode > CAMERA_ATTR_FLASH_MODE_PERMANENT) {
+ LOGE("invalid flash mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
}
if (rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270) {
- LOGE("INVALID_PARAMETER - %d", rotation);
+ LOGE("invalid stream rotation %d", rotation);
return CAMERA_ERROR_INVALID_PARAMETER;
}
}
if (flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH) {
- LOGE("INVALID_PARAMETER - %d", flip);
+ LOGE("invalid stream flip %d", flip);
return CAMERA_ERROR_INVALID_PARAMETER;
}
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (mode < CAMERA_ATTR_HDR_MODE_DISABLE || mode > CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL) {
+ LOGE("invalid HDR mode %d", mode);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
if (legacy_camera_attr_is_supported_hdr_capture(camera) == false) {
LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
return CAMERA_ERROR_NOT_SUPPORTED;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (bitrate <= 0) {
+ LOGE("invalid encoded preview bitrate %d", bitrate);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (interval < 0) {
+ LOGE("invalid encoded preview gop interval %d", interval);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;