From efac3b067614c762bb9a60d28ec245916ef14051 Mon Sep 17 00:00:00 2001 From: Kim Kibum Date: Sun, 29 Apr 2012 17:01:19 +0900 Subject: [PATCH] upload tizen1.0 source --- debian/changelog | 8 ++++++++ gstcs/mm_util_gstcs.c | 35 +++++++++++++++++++---------------- packaging/libmm-imgp-gstcs.spec | 15 ++++++--------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3eeac48..1a789e7 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libmm-imgp-gstcs (0.1-15) unstable; urgency=low + + * Code clean for the exceptional image rotate + * Git: pkgs/l/libmm-imgp-gstcs + * Tag: libmm-imgp-gstcs_0.1-15 + + -- YoungHUn Kim Fri, 02 Mar 2012 11:57:44 +0900 + libmm-imgp-gstcs (0.1-14) unstable; urgency=low * Update rotate image size diff --git a/gstcs/mm_util_gstcs.c b/gstcs/mm_util_gstcs.c index 6272e68..2a76454 100644 --- a/gstcs/mm_util_gstcs.c +++ b/gstcs/mm_util_gstcs.c @@ -439,13 +439,14 @@ _mm_set_input_image_format_s_struct(imgp_info_s* pImgp_info) //char* __format_la } static void -_mm_round_up_output_image_widh_height(char* __colorsapce, imgp_info_s* pImgp_info) //char* __colorspace, int __width, int __height) +_mm_round_up_output_image_widh_height(image_format_s* pFormat) { - if(strcmp(__colorsapce,"YUV") ==0) { - pImgp_info->src_width =GST_ROUND_UP_8(pImgp_info->src_width); // because the result of image size is multiples of 8 - pImgp_info->src_height=GST_ROUND_UP_8(pImgp_info->src_height); - }else if(strcmp(__colorsapce, "RGB") ==0) { - pImgp_info->src_width=GST_ROUND_UP_4(pImgp_info->src_width); + if(strcmp(pFormat->colorspace,"YUV") ==0) { + pFormat->stride=MM_UTIL_ROUND_UP_8(pFormat->width); + pFormat->elevation=MM_UTIL_ROUND_UP_8(pFormat->height); + }else if(strcmp(pFormat->colorspace, "RGB") ==0) { + pFormat->stride=MM_UTIL_ROUND_UP_4(pFormat->width); + pFormat->elevation=MM_UTIL_ROUND_UP_2(pFormat->height); } } @@ -457,14 +458,15 @@ _mm_set_output_image_format_s_struct(imgp_info_s* pImgp_info) __format=(image_format_s*)malloc(sizeof(image_format_s)); strncpy(__format->format_label, pImgp_info->output_format_label, sizeof(__format->format_label)); _mm_set_image_colorspace(__format); - _mm_round_up_output_image_widh_height(__format->colorspace, pImgp_info); if(pImgp_info->angle == MM_UTIL_ROTATE_90 || pImgp_info->angle == MM_UTIL_ROTATE_270) { __format->width=pImgp_info->dst_height; - __format->height=pImgp_info->dst_width; + __format->height= pImgp_info->dst_width; + _mm_round_up_output_image_widh_height(__format); }else { __format->width=pImgp_info->dst_width; __format->height=pImgp_info->dst_height; + _mm_round_up_output_image_widh_height(__format); } __format->blocksize = mm_setup_image_size(pImgp_info->output_format_label, pImgp_info->dst_width, pImgp_info->dst_height); @@ -594,7 +596,7 @@ _mm_imgp_gstcs_processing( gstreamer_s* pGstreamer_s, image_format_s* input_form /* error */ if (ret_state == 0) { - mmf_debug(MMF_DEBUG_ERROR, "[%s][%05d] GST_STATE_CHANGE_FAILURE", __func__, __LINE__); // GST_STATE_CHANGE_SUCCESS = 1, GST_STATE_CHANGE_ASYNC = 2, GST_STATE_CHANGE_NO_PREROLL= 3 + mmf_debug(MMF_DEBUG_ERROR, "[%s][%05d] GST_STATE_CHANGE_FAILURE", __func__, __LINE__); return MM_ERROR_IMAGE_INVALID_VALUE; }else { #if 0 @@ -619,13 +621,13 @@ _mm_imgp_gstcs_processing( gstreamer_s* pGstreamer_s, image_format_s* input_form mmf_debug (MMF_DEBUG_LOG, "[%s][%05d] Success gst_element_get_state\n", __func__, __LINE__); if (ret_state == 0) { - mmf_debug(MMF_DEBUG_ERROR, "GST_STATE_CHANGE_FAILURE"); // GST_STATE_CHANGE_SUCCESS = 1, GST_STATE_CHANGE_ASYNC = 2, GST_STATE_CHANGE_NO_PREROLL= 3 + mmf_debug(MMF_DEBUG_ERROR, "GST_STATE_CHANGE_FAILURE"); }else { if(pGstreamer_s->output_buffer != NULL) { - int buffer_size = GST_BUFFER_SIZE(pGstreamer_s->output_buffer); + int buffer_size = GST_BUFFER_SIZE(pGstreamer_s->output_buffer); mmf_debug (MMF_DEBUG_LOG, "[%s][%05d] buffer size: %d\n", __func__, __LINE__, buffer_size); - if( buffer_size != mm_setup_image_size(pImgp_info->output_format_label, pImgp_info->output_stride, pImgp_info->output_elevation)) { - mmf_debug (MMF_DEBUG_ERROR, "[%s][%05d] Buffer size is different\n", __func__, __LINE__); + if( buffer_size != mm_setup_image_size(pImgp_info->output_format_label, pImgp_info->output_stride, pImgp_info->output_elevation)) { + mmf_debug (MMF_DEBUG_LOG, "[%s][%05d] Buffer size is different stride:%d elevation: %d\n", __func__, __LINE__, pImgp_info->output_stride, pImgp_info->output_elevation); } mmf_debug (MMF_DEBUG_LOG, "[%s][%05d] pGstreamer_s->output_buffer: 0x%2x\n", __func__, __LINE__, pGstreamer_s->output_buffer); memcpy( pImgp_info->dst, (char*)GST_BUFFER_DATA(pGstreamer_s->output_buffer), buffer_size); @@ -701,17 +703,18 @@ _mm_imgp_gstcs(imgp_info_s* pImgp_info) mmf_debug(MMF_DEBUG_LOG,"[%s][%05d] [input] format label : %s width: %d height: %d\t[output] format label: %s width: %d height: %d rotation vaule: %d dst: 0x%2x", __func__, __LINE__, pImgp_info->input_format_label, pImgp_info->src_width, pImgp_info->src_height, pImgp_info->output_format_label, pImgp_info->dst_width, pImgp_info->dst_height, pImgp_info->angle, pImgp_info->dst); - pImgp_info->output_stride = pImgp_info->dst_width; - pImgp_info->output_elevation = pImgp_info->dst_height; if(pImgp_info->dst == NULL) { mmf_debug(MMF_DEBUG_ERROR, "[%s][%05d] imgp_info_s->dst is NULL", __func__, __LINE__); } input_format= _mm_set_input_image_format_s_struct(pImgp_info); output_format= _mm_set_output_image_format_s_struct(pImgp_info); + pImgp_info->output_stride = output_format->stride; + pImgp_info->output_elevation = output_format->elevation; + mmf_debug(MMF_DEBUG_LOG,"[%s][%05d] mm_check_resize_format&&mm_check_rotate_format ", __func__, __LINE__); - if(__mm_check_resize_format(pImgp_info->input_format_label, pImgp_info->src_width, pImgp_info->src_height, pImgp_info->output_format_label, pImgp_info->output_stride, pImgp_info->output_elevation) + if(__mm_check_resize_format(pImgp_info->input_format_label, pImgp_info->src_width, pImgp_info->src_height, pImgp_info->output_format_label, pImgp_info->dst_width, pImgp_info->dst_height) && __mm_check_rotate_format(pImgp_info->angle, pImgp_info->input_format_label, pImgp_info->output_format_label) ) { #if 0 // def GST_EXT_TIME_ANALYSIS MMTA_INIT(); diff --git a/packaging/libmm-imgp-gstcs.spec b/packaging/libmm-imgp-gstcs.spec index f0a643c..decc871 100644 --- a/packaging/libmm-imgp-gstcs.spec +++ b/packaging/libmm-imgp-gstcs.spec @@ -7,13 +7,16 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig -BuildRequires: pkgconfig(mm-common), libmm-common-internal-devel +BuildRequires: pkgconfig(mm-common) +#BuildRequires: libmm-common-internal-devel BuildRequires: pkgconfig(mm-log) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gstreamer-0.10) BuildRequires: pkgconfig(gstreamer-app-0.10) BuildRequires: pkgconfig(gmodule-2.0) +BuildRoot: %{_tmppath}/%{name}-%{version}-build + %description Multimedia Framework Utility Library @@ -37,8 +40,6 @@ LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed" \ %build make %{?jobs:-j%jobs} -sed -i -e "s#@GSTCS_REQPKG@#$GSTCS_REQPKG#g" gstcs/mmutil-gstcs.pc - %install rm -rf %{buildroot} %make_install @@ -53,9 +54,5 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) %{_libdir}/*.so* - -%files devel -%defattr(-,root,root,-) -%{_includedir}/* -%{_libdir}/pkgconfig/* - +%exclude %{_includedir}/mmf/mm_util_gstcs.h +%exclude %{_libdir}/pkgconfig/mmutil-gstcs.pc -- 2.7.4