Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.256
+Version: 0.10.257
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
*/
int _mmcamcorder_lock_readonly_attributes(MMHandleType handle);
-/**
- * This function disable pre-defined attributes.
- *
- * @param[in] handle Handle of camcorder.
- * @return int Success on MM_ERROR_NONE or return ERROR with error code
- */
-int _mmcamcorder_set_disabled_attributes(MMHandleType handle);
-
/**
* check whether supported or not
*
#define MMF_CAM_W1280 1280
#define MMF_CAM_H720 720
-//Zero
-#define MMF_CAM_W0 0
-#define MMF_CAM_H0 0
-
-
-/* Capture related */
-/* High quality resolution */
-#define MMFCAMCORDER_HIGHQUALITY_WIDTH MMF_CAM_W0 /* High quality resolution is not needed, */
-#define MMFCAMCORDER_HIGHQUALITY_HEIGHT MMF_CAM_H0 /* because camsensor has a JPEG encoder inside */
-
/* VGA (1 : 0.75) */
#define MMF_CROP_VGA_LEFT 0
#define MMF_CROP_VGA_RIGHT 0
}
-int _mmcamcorder_set_disabled_attributes(MMHandleType handle)
-{
- mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
- MMHandleType attrs;
- int i = 0;
- type_string_array * disabled_attr = NULL;
- int cnt_str = 0;
- int nerror = MM_ERROR_NONE ;
-
- mmf_return_val_if_fail(hcamcorder, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
-
- attrs = MMF_CAMCORDER_ATTRS(handle);
- mmf_return_val_if_fail(attrs, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
-
- MMCAM_LOG_INFO("");
-
- /* add gst_param */
- _mmcamcorder_conf_get_value_string_array(hcamcorder->conf_main,
- CONFIGURE_CATEGORY_MAIN_GENERAL,
- "DisabledAttributes",
- &disabled_attr);
- if (disabled_attr != NULL && disabled_attr->value) {
- cnt_str = disabled_attr->count;
- for (i = 0; i < cnt_str; i++) {
- int idx = 0;
- MMCAM_LOG_INFO("[%d]%s", i, disabled_attr->value[i]);
- nerror = mm_attrs_get_index(attrs, disabled_attr->value[i], &idx);
-
- if (nerror == MM_ERROR_NONE)
- mm_attrs_set_disabled(attrs, idx);
- else
- MMCAM_LOG_WARNING("No ATTR named %s[%d]", disabled_attr->value[i], i);
- }
- }
-
- return nerror;
-}
-
-
/*---------------------------------------------------------------------------------------
| INTERNAL FUNCTION DEFINITIONS: |
---------------------------------------------------------------------------------------*/
/* [General] matching table */
static conf_info_table conf_main_general_table[] = {
- { "SyncStateChange", CONFIGURE_VALUE_INT, {.value_int = 1} },
{ "GSTInitOption", CONFIGURE_VALUE_STRING_ARRAY, {NULL} },
- { "ModelName", CONFIGURE_VALUE_STRING, {NULL} },
- { "DisabledAttributes", CONFIGURE_VALUE_STRING_ARRAY, {NULL} },
{ "PlatformPrivilegeCamera", CONFIGURE_VALUE_STRING, {NULL} },
{ "LogLevel", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_LOG_LEVEL_INFO} },
{ "NetworkCameraHALName", CONFIGURE_VALUE_STRING, {NULL} },
/* [Capture] matching table */
static conf_info_table conf_main_capture_table[] = {
{ "UseEncodebin", CONFIGURE_VALUE_INT, {.value_int = 0} },
- { "UseCaptureMode", CONFIGURE_VALUE_INT, {.value_int = 0} },
{ "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} },
{ "PlayCaptureSound", CONFIGURE_VALUE_INT, {.value_int = 1} },
};
/* Make some attributes as read-only type */
_mmcamcorder_lock_readonly_attributes((MMHandleType)hcamcorder);
- /* Disable attributes in each model */
- _mmcamcorder_set_disabled_attributes((MMHandleType)hcamcorder);
-
/* get system information */
__mmcamcorder_get_system_info(hcamcorder);
int _mmcamcorder_image_cmd_capture(MMHandleType handle)
{
int ret = MM_ERROR_NONE;
- int UseCaptureMode = 0;
int width = 0;
int height = 0;
int fps = 0;
return MM_ERROR_CAMCORDER_DEVICE_BUSY;
}
- _mmcamcorder_conf_get_value_int(handle, hcamcorder->conf_main,
- CONFIGURE_CATEGORY_MAIN_CAPTURE,
- "UseCaptureMode",
- &UseCaptureMode);
-
/* get current state */
mm_camcorder_get_state(handle, ¤t_state);
control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
gst_camera_control_set_capture_command(control, GST_CAMERA_CONTROL_CAPTURE_COMMAND_START);
} else {
- int need_change = 0;
- int set_width = 0;
- int set_height = 0;
int cap_jpeg_quality = 0;
- if (UseCaptureMode) {
- if (width != MMFCAMCORDER_HIGHQUALITY_WIDTH || height != MMFCAMCORDER_HIGHQUALITY_HEIGHT)
- need_change = 1;
- } else {
- if (width != info->width || height != info->height)
- need_change = 1;
- }
-
- if (need_change) {
+ if (width != info->width || height != info->height) {
int rotation = 0;
MMCAM_LOG_INFO("Need to change resolution");
goto cmd_done;
}
- if (UseCaptureMode) {
- set_width = MMFCAMCORDER_HIGHQUALITY_WIDTH;
- set_height = MMFCAMCORDER_HIGHQUALITY_HEIGHT;
- } else {
- set_width = info->width;
- set_height = info->height;
- }
-
mm_camcorder_get_attributes(handle, &err_name,
MMCAM_CAMERA_ROTATION, &rotation,
NULL);
}
/* set new caps */
- ret = _mmcamcorder_set_videosrc_caps(handle, sc->fourcc, set_width, set_height, fps, rotation);
+ ret = _mmcamcorder_set_videosrc_caps(handle, sc->fourcc, info->width, info->height, fps, rotation);
if (!ret) {
MMCAM_LOG_ERROR("_mmcamcorder_set_videosrc_caps failed");
ret = MM_ERROR_CAMCORDER_INTERNAL;
goto cmd_done;
}
- MMCAM_LOG_INFO("Change to target resolution(%d, %d)", set_width, set_height);
+ MMCAM_LOG_INFO("Change to target resolution(%d, %d)", info->width, info->height);
} else {
MMCAM_LOG_INFO("No need to change resolution. Open toggle now.");
info->resolution_change = FALSE;