[0.6.92] apply new enum of libmm-utility 36/169936/1 accepted/tizen/unified/20180214.144600 submit/tizen/20180212.075159
authorEunhae Choi <eunhae1.choi@samsung.com>
Mon, 12 Feb 2018 07:33:47 +0000 (16:33 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Mon, 12 Feb 2018 07:33:47 +0000 (16:33 +0900)
Change-Id: I968562da372afba0bfc8764ad62e9caf154212cf

packaging/libmm-player.spec
src/mm_player_capture.c

index 0a26877..cc8739d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.91
+Version:    0.6.92
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 65b5093..4322130 100755 (executable)
@@ -46,7 +46,7 @@ static int  __mmplayer_get_video_frame_from_buffer(mm_player_t* player, GstPad *
 static gpointer __mmplayer_capture_thread(gpointer data);
 static void __csc_tiled_to_linear_crop(unsigned char *yuv420_dest, unsigned char *nv12t_src, int yuv420_width, int yuv420_height, int left, int top, int right, int buttom);
 static int __tile_4x2_read(int x_size, int y_size, int x_pos, int y_pos);
-static int __mm_player_convert_colorspace(mm_player_t* player, unsigned char* src_data, mm_util_img_format src_fmt, unsigned int src_w, unsigned int src_h, mm_util_img_format dst_fmt);
+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);
 #ifdef CAPTURE_OUTPUT_DUMP
 static void capture_output_dump(mm_player_t* player);
 #endif
@@ -352,8 +352,8 @@ __mmplayer_capture_thread(gpointer data)
                        memcpy(src_buffer+linear_y_plane_size, linear_uv_plane, linear_uv_plane_size);
 
                        /* NV12 linear to RGB888 */
-                       ret = __mm_player_convert_colorspace(player, src_buffer, MM_UTIL_IMG_FMT_NV12,
-                               width, height, MM_UTIL_IMG_FMT_RGB888);
+                       ret = __mm_player_convert_colorspace(player, src_buffer, MM_UTIL_COLOR_NV12,
+                               width, height, MM_UTIL_COLOR_RGB24);
 
                        if (ret != MM_ERROR_NONE) {
                                LOGE("failed to convert nv12 linear");
@@ -404,8 +404,8 @@ __mmplayer_capture_thread(gpointer data)
                        }
 
                        /* NV12 -> RGB888 */
-                       ret = __mm_player_convert_colorspace(player, (unsigned char*)src_buffer, MM_UTIL_IMG_FMT_NV12,
-                               player->captured.width[0], player->captured.height[0], MM_UTIL_IMG_FMT_RGB888);
+                       ret = __mm_player_convert_colorspace(player, (unsigned char*)src_buffer, MM_UTIL_COLOR_NV12,
+                               player->captured.width[0], player->captured.height[0], MM_UTIL_COLOR_RGB24);
                        if (ret != MM_ERROR_NONE) {
                                LOGE("failed to convert nv12 linear");
                                goto ERROR;
@@ -456,8 +456,8 @@ __mmplayer_capture_thread(gpointer data)
                        }
 
                        /* I420 -> RGB888 */
-                       ret = __mm_player_convert_colorspace(player, (unsigned char*)src_buffer, MM_UTIL_IMG_FMT_I420,
-                               player->captured.width[0], player->captured.height[0], MM_UTIL_IMG_FMT_RGB888);
+                       ret = __mm_player_convert_colorspace(player, (unsigned char*)src_buffer, MM_UTIL_COLOR_I420,
+                               player->captured.width[0], player->captured.height[0], MM_UTIL_COLOR_RGB24);
                        if (ret != MM_ERROR_NONE) {
                                LOGE("failed to convert I420 linear");
                                goto ERROR;
@@ -481,7 +481,7 @@ __mmplayer_capture_thread(gpointer data)
 
                LOGD("orientation value = %d user_angle = %d", orientation, user_angle);
 
-               ret = __mmplayer_handle_orientation(player, orientation, MM_UTIL_IMG_FMT_RGB888);
+               ret = __mmplayer_handle_orientation(player, orientation, MM_UTIL_COLOR_RGB24);
                if (ret != MM_ERROR_NONE) {
                        LOGE("failed to convert nv12 linear");
                        goto ERROR;
@@ -539,8 +539,8 @@ __mmplayer_get_video_frame_from_buffer(mm_player_t* player, GstPad *pad, GstBuff
        GstStructure *structure = NULL;
        GstMapInfo mapinfo = GST_MAP_INFO_INIT;
        GstMemory *memory = NULL;
-       mm_util_img_format src_fmt = MM_UTIL_IMG_FMT_YUV420;
-       mm_util_img_format dst_fmt = MM_UTIL_IMG_FMT_RGB888; // fixed
+       mm_util_color_format_e src_fmt = MM_UTIL_COLOR_YUV420;
+       mm_util_color_format_e dst_fmt = MM_UTIL_COLOR_RGB24; // fixed
 
        MMPLAYER_FENTER();
 
@@ -684,15 +684,15 @@ __mmplayer_get_video_frame_from_buffer(mm_player_t* player, GstPad *pad, GstBuff
 
                        switch (GST_VIDEO_INFO_FORMAT(&format_info)) {
                        case GST_VIDEO_FORMAT_I420:
-                               src_fmt = MM_UTIL_IMG_FMT_I420;
+                               src_fmt = MM_UTIL_COLOR_I420;
                                player->captured.width[1] = player->captured.width[2] = src_width>>1;
                                player->captured.height[1] = player->captured.width[2] = src_height>>1;
                                break;
                        case GST_VIDEO_FORMAT_BGRA:
-                               src_fmt = MM_UTIL_IMG_FMT_BGRA8888;
+                               src_fmt = MM_UTIL_COLOR_BGRA;
                                break;
                        case GST_VIDEO_FORMAT_BGRx:
-                               src_fmt = MM_UTIL_IMG_FMT_BGRX8888;
+                               src_fmt = MM_UTIL_COLOR_BGRX;
                                break;
                        default:
                                LOGE("unknown format to capture\n");
@@ -767,7 +767,7 @@ __mmplayer_video_capture_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_da
 }
 
 static int
-__mm_player_convert_colorspace(mm_player_t* player, unsigned char* src_data, mm_util_img_format src_fmt, unsigned int src_w, unsigned int src_h, mm_util_img_format dst_fmt)
+__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;