diff options
author | Eunhae Choi <eunhae1.choi@samsung.com> | 2018-02-22 12:03:58 +0900 |
---|---|---|
committer | Eunhae Choi <eunhae1.choi@samsung.com> | 2018-02-23 14:57:12 +0900 |
commit | 28a5069fc3b23f86c28771517692e277cb245955 (patch) | |
tree | 219928f2fc802f0a39f14eba21c4b7e316a18cb0 | |
parent | cf629ab8710e2ccdce031c501b14760082ae2781 (diff) | |
download | libmm-player-accepted/tizen/unified/20180226.142332.tar.gz libmm-player-accepted/tizen/unified/20180226.142332.tar.bz2 libmm-player-accepted/tizen/unified/20180226.142332.zip |
[0.6.94] apply the modified mm util interfacesubmit/tizen/20180223.061228accepted/tizen/unified/20180226.142332
Change-Id: I0fd23d47d23f804511e9da718b6f330d4c4a50be
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rwxr-xr-x | src/mm_player_capture.c | 56 |
2 files changed, 16 insertions, 42 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 0a9f86d..eb42865 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.93 +Version: 0.6.94 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_capture.c b/src/mm_player_capture.c index 4322130..154de2a 100755 --- a/src/mm_player_capture.c +++ b/src/mm_player_capture.c @@ -196,7 +196,7 @@ __mmplayer_handle_orientation(mm_player_t* player, int orientation, int format) unsigned char *dst_frame = NULL; unsigned int dst_width = 0; unsigned int dst_height = 0; - unsigned int dst_size = 0; + size_t dst_size = 0; mm_util_img_rotate_type rot_enum = MM_UTIL_ROTATE_NUM; player->capture.orientation = orientation; @@ -216,21 +216,8 @@ __mmplayer_handle_orientation(mm_player_t* player, int orientation, int format) } else LOGE("wrong orientation value..."); - /* height & width will be interchanged for 90 and 270 orientation */ - ret = mm_util_get_image_size(format, dst_width, dst_height, &dst_size); - if (ret != MM_ERROR_NONE) { - LOGE("failed to get destination frame size"); - return ret; - } - + /* height & width will be interchanged for 90 and 270 orientation */ LOGD("before rotation : dst_width = %d and dst_height = %d", dst_width, dst_height); - - dst_frame = (unsigned char*) malloc(dst_size); - if (!dst_frame) { - LOGE("failed to allocate memory"); - return MM_ERROR_PLAYER_NO_FREE_SPACE; - } - src_buffer = (unsigned char*)player->capture.data; /* convert orientation degree into enum here */ @@ -252,20 +239,20 @@ __mmplayer_handle_orientation(mm_player_t* player, int orientation, int format) LOGD("source buffer for rotation = %p and rotation = %d", src_buffer, rot_enum); ret = mm_util_rotate_image(src_buffer, - player->captured.width[0], player->captured.height[0], format, - dst_frame, &dst_width, &dst_height, rot_enum); - if (ret != MM_ERROR_NONE) { + player->captured.width[0], player->captured.height[0], format, rot_enum, + &dst_frame, &dst_width, &dst_height, &dst_size); + if (ret != MM_ERROR_NONE || !dst_frame) { LOGE("failed to do rotate image"); free(dst_frame); return ret; } - LOGD("after rotation same stride: dst_width = %d and dst_height = %d", dst_width, dst_height); + LOGD("after rotation same stride: dst_width = %d and dst_height = %d, dst_size = %zu", dst_width, dst_height, dst_size); g_free(src_buffer); player->capture.data = dst_frame; - player->capture.size = dst_size; + player->capture.size = (int)dst_size; player->capture.orientation = orientation; player->capture.width = dst_width; player->capture.height = dst_height; @@ -770,36 +757,23 @@ static int __mm_player_convert_colorspace(mm_player_t* player, unsigned char* src_data, mm_util_color_format_e src_fmt, unsigned int src_w, unsigned int src_h, mm_util_color_format_e dst_fmt) { unsigned char *dst_data = NULL; - unsigned int dst_size; + unsigned int dst_width = 0; + unsigned int dst_height = 0; + size_t dst_size = 0; int ret = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_INTERNAL); - ret = mm_util_get_image_size(dst_fmt, src_w, src_h, &dst_size); + SECURE_LOGD("src size info. width: %d, height: %d \n", src_w, src_h); - if (ret != MM_ERROR_NONE) { - LOGE("failed to get image size for capture, %d\n", ret); - return MM_ERROR_PLAYER_INTERNAL; - } - - SECURE_LOGD("width: %d, height: %d to capture, dest size: %d\n", src_w, src_h, dst_size); - - dst_data = (unsigned char*)g_malloc0(dst_size); - - if (!dst_data) { - LOGE("no free space to capture\n"); - g_free(dst_data); - return MM_ERROR_PLAYER_NO_FREE_SPACE; - } - - ret = mm_util_convert_colorspace(src_data, src_w, src_h, src_fmt, dst_data, dst_fmt); - - if (ret != MM_ERROR_NONE) { + ret = mm_util_convert_colorspace(src_data, src_w, src_h, src_fmt, dst_fmt, &dst_data, &dst_width, &dst_height, &dst_size); + if (ret != MM_ERROR_NONE || !dst_data) { LOGE("failed to convert for capture, %d\n", ret); g_free(dst_data); return MM_ERROR_PLAYER_INTERNAL; } + SECURE_LOGD("dst size info. width: %d, height: %d, size: %zu\n", dst_width, dst_height, dst_size); - player->capture.size = dst_size; + player->capture.size = (int)dst_size; player->capture.data = dst_data; return MM_ERROR_NONE; |