From: Jeongmo Yang Date: Wed, 16 Mar 2016 12:04:07 +0000 (+0900) Subject: [Release version 0.10.39] 1. Fix build warnings, 2. Remove hard-coding for ini file... X-Git-Tag: submit/tizen/20160321.072619^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F62543%2F1;p=platform%2Fcore%2Fmultimedia%2Flibmm-camcorder.git [Release version 0.10.39] 1. Fix build warnings, 2. Remove hard-coding for ini file path Change-Id: I69cac4385fb7adadd68a5212a826e7ba922dbe2f Signed-off-by: Jeongmo Yang --- diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 73108cd..243a3a1 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -30,6 +30,7 @@ BuildRequires: pkgconfig(storage) BuildRequires: pkgconfig(murphy-resource) BuildRequires: pkgconfig(murphy-glib) BuildRequires: pkgconfig(ttrace) +BuildRequires: pkgconfig(libtzplatform-config) %description Camera and recorder function supported library. @@ -51,9 +52,9 @@ Camera and recorder function supported library for development. %build %if %{with wayland} -export CFLAGS+=" -DHAVE_WAYLAND" +export CFLAGS+=" -DHAVE_WAYLAND -DGST_USE_UNSTABLE_API" %endif -export CFLAGS+=" -D_LARGEFILE64_SOURCE" +export CFLAGS+=" -D_LARGEFILE64_SOURCE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\" -DTZ_SYS_ETC=\\\"%{TZ_SYS_ETC}\\\"" ./autogen.sh %configure \ %if %{with wayland} @@ -63,8 +64,8 @@ export CFLAGS+=" -D_LARGEFILE64_SOURCE" make %{?jobs:-j%jobs} %install -mkdir -p %{buildroot}/usr/share/license -cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name} +mkdir -p %{buildroot}%{_datadir}/license +cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name} %make_install @@ -78,7 +79,7 @@ cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name} %defattr(-,root,root,-) %{_bindir}/* %{_libdir}/*.so.* -/usr/share/sounds/mm-camcorder/* +%{_datadir}/sounds/mm-camcorder/* %{_datadir}/license/%{name} %files devel diff --git a/src/include/mm_camcorder_attribute.h b/src/include/mm_camcorder_attribute.h index a03e3d7..51ee5a4 100644 --- a/src/include/mm_camcorder_attribute.h +++ b/src/include/mm_camcorder_attribute.h @@ -192,7 +192,7 @@ typedef bool (*mmf_cam_commit_func_t)(MMHandleType handle, int attr_idx, const m ========================================================================================*/ typedef struct { MMCamcorderAttrsID attrid; - const char *name; + char *name; int value_type; int flags; union { diff --git a/src/mm_camcorder_configure.c b/src/mm_camcorder_configure.c index 80eae5d..172f09e 100644 --- a/src/mm_camcorder_configure.c +++ b/src/mm_camcorder_configure.c @@ -33,8 +33,6 @@ /*----------------------------------------------------------------------- | MACRO DEFINITIONS: | -----------------------------------------------------------------------*/ -#define CONFIGURE_PATH "/usr/etc" -#define CONFIGURE_PATH_RETRY "/opt/etc" /*----------------------------------------------------------------------- | GLOBAL VARIABLE DEFINITIONS | @@ -897,25 +895,20 @@ int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFi { int ret = MM_ERROR_NONE; FILE *fd = NULL; - char *conf_path = NULL; + char conf_path[60] = {'\0',}; _mmcam_dbg_log("Opening...[%s]", ConfFile); mmf_return_val_if_fail(ConfFile, FALSE); - conf_path = (char *)malloc(strlen(ConfFile) + strlen(CONFIGURE_PATH) + 3); - if (conf_path == NULL) { - _mmcam_dbg_err("malloc failed."); - return MM_ERROR_CAMCORDER_LOW_MEMORY; - } - - snprintf(conf_path, strlen(ConfFile) + strlen(CONFIGURE_PATH) + 2, "%s/%s", CONFIGURE_PATH, ConfFile); + snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", SYSCONFDIR, ConfFile); _mmcam_dbg_log("Try open Configure File[%s]", conf_path); fd = fopen(conf_path, "r"); if (fd == NULL) { _mmcam_dbg_warn("File open failed.[%s] retry...", conf_path); - snprintf(conf_path, strlen(ConfFile) + strlen(CONFIGURE_PATH_RETRY) + 2, "%s/%s", CONFIGURE_PATH_RETRY, ConfFile); + + snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", TZ_SYS_ETC, ConfFile); _mmcam_dbg_log("Try open Configure File[%s]", conf_path); fd = fopen(conf_path, "r"); if (fd == NULL) { @@ -934,11 +927,6 @@ int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFi } } - if (conf_path != NULL) { - free(conf_path); - conf_path = NULL; - } - _mmcam_dbg_log("Leave..."); return ret; diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c index 556ffc6..1ba11c6 100644 --- a/src/mm_camcorder_gstcommon.c +++ b/src/mm_camcorder_gstcommon.c @@ -793,7 +793,7 @@ int _mmcamcorder_create_encodesink_bin(MMHandleType handle, MMCamcorderEncodebin } if (sc->info_image->preview_format == MM_PIXEL_FORMAT_ENCODED_H264) { - gst_element_venc_name = strdup("capsfilter"); + gst_element_venc_name = "capsfilter"; } else { _mmcamcorder_conf_get_value_element_name(VideoencElement, &gst_element_venc_name); } @@ -848,11 +848,6 @@ int _mmcamcorder_create_encodesink_bin(MMHandleType handle, MMCamcorderEncodebin if (use_venc_queue) { _MMCAMCORDER_ENCODEBIN_ELMGET(sc, _MMCAMCORDER_ENCSINK_VENC_QUE, "use-venc-queue", err); } - - if (sc->info_image->preview_format == MM_PIXEL_FORMAT_ENCODED_H264) { - free(gst_element_venc_name); - gst_element_venc_name = NULL; - } } if (sc->audio_disable == FALSE && diff --git a/src/mm_camcorder_stillshot.c b/src/mm_camcorder_stillshot.c index 433282d..fe750c9 100644 --- a/src/mm_camcorder_stillshot.c +++ b/src/mm_camcorder_stillshot.c @@ -1315,14 +1315,6 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl thumb.data = malloc(ed->size); memcpy(thumb.data,ed->data,ed->size); thumb.length = ed->size; - #if 0 - { - FILE *fp = NULL; - fp = fopen ("/opt/usr/media/thumbnail_test.jpg", "a+"); - fwrite (thumb.data, 1, thumb.length, fp); - fclose (fp); - } - #endif thumb.format = MM_PIXEL_FORMAT_ENCODED; thumb.width = atoi(width); thumb.height = atoi(height);