From: Nam KwanWoo Date: Mon, 24 Jun 2013 04:15:15 +0000 (+0900) Subject: change logic to get camera count, screen width, screen height X-Git-Tag: submit/tizen/20130916.212456~1^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eaa768fb4d2c5ad0aa8c205d11076c6f5e52f2d;p=platform%2Fcore%2Fapi%2Fsystem-info.git change logic to get camera count, screen width, screen height Change-Id: I5908c0b7ae03dd863ed1ea7bd5645aa9df8410ea --- diff --git a/src/system_info_device.c b/src/system_info_device.c index 35d4b0d..d3c502e 100644 --- a/src/system_info_device.c +++ b/src/system_info_device.c @@ -31,21 +31,24 @@ #define LOG_TAG "CAPI_SYSTEM_INFO" #define TETHERING_INFO_FILE_PATH "/etc/config/connectivity/sysinfo-tethering.xml" +#define CAMERA_INFO_FILE_PATH "/usr/etc/mmfw_camcorder.ini" int system_info_get_camera_count(system_info_key_e key, system_info_data_type_e data_type, void **value) { - bool camera; - int *count = 0; + int *count; + char *devicecount; count = (int *)value; *count = 0; - if (system_info_get_platform_bool("tizen.org/feature/camera.back", &camera) == SYSTEM_INFO_ERROR_NONE - && camera == true) - (*count)++; - if (system_info_get_platform_bool("tizen.org/feature/camera.front", &camera) == SYSTEM_INFO_ERROR_NONE - && camera == true) - (*count)++; + if (system_info_ini_get_string(CAMERA_INFO_FILE_PATH, "videoinput:devicecount", &devicecount) + != SYSTEM_INFO_ERROR_NONE) { + return SYSTEM_INFO_ERROR_IO_ERROR; + } + + *count = atoi(devicecount); + + free(devicecount); return SYSTEM_INFO_ERROR_NONE; } diff --git a/src/system_info_platform.c b/src/system_info_platform.c index 40cf35c..a8457cb 100644 --- a/src/system_info_platform.c +++ b/src/system_info_platform.c @@ -262,19 +262,19 @@ int system_info_get_opengles_texture_format(system_info_key_e key, system_info_d strcat(textureformat, "utc "); if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.ptc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) - strcat(textureformat, "| ptc "); + strcat(textureformat, "ptc "); if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.etc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) - strcat(textureformat, "| etc "); + strcat(textureformat, "etc "); if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.3dc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) - strcat(textureformat, "| 3dc "); + strcat(textureformat, "3dc "); if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.atc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) - strcat(textureformat, "| atc "); + strcat(textureformat, "atc "); if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.pvrtc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) - strcat(textureformat, "| pvrtc"); + strcat(textureformat, "pvrtc"); OPENGLES_TEXTURE_FORMAT = strdup(textureformat); diff --git a/src/system_info_screen.c b/src/system_info_screen.c index 36b0a82..b28f058 100644 --- a/src/system_info_screen.c +++ b/src/system_info_screen.c @@ -37,42 +37,12 @@ int system_info_get_screen_bits_per_pixel(system_info_key_e key, system_info_dat int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value) { - bool check; - int *width = 0; - - width = (int *)value; - - if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &check) == SYSTEM_INFO_ERROR_NONE - && check == true) - *width = 480; - if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &check) == SYSTEM_INFO_ERROR_NONE - && check == true) - *width = 720; - - if (*width) - return SYSTEM_INFO_ERROR_NONE; - else - return SYSTEM_INFO_ERROR_IO_ERROR; + return system_info_get_platform_int("tizen.org/feature/screen.width", (int *)value); } int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value) { - bool check; - int *height = 0; - - height = (int *)value; - - if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &check) == SYSTEM_INFO_ERROR_NONE - && check == true) - *height = 800; - if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &check) == SYSTEM_INFO_ERROR_NONE - && check == true) - *height = 1280; - - if (*height) - return SYSTEM_INFO_ERROR_NONE; - else - return SYSTEM_INFO_ERROR_IO_ERROR; + return system_info_get_platform_int("tizen.org/feature/screen.height", (int *)value); } int system_info_get_screen_DPI(system_info_key_e key, system_info_data_type_e data_type, void **value)