Use gst_video_overlay_set_roi_area interface instead of old interface 52/185852/2 accepted/tizen/unified/20180816.062859 submit/tizen/20180814.031739
authorHyunil <hyunil46.park@samsung.com>
Fri, 3 Aug 2018 04:12:33 +0000 (13:12 +0900)
committerHyunil Park <hyunil46.park@samsung.com>
Tue, 14 Aug 2018 01:39:06 +0000 (01:39 +0000)
Change-Id: I0ac4776fbcee5de1a0a4d145366461fe6d8468ed
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
src/mm_player_attrs.c
src/mm_player_priv.c

index 4a61de0..dc7e95c 100644 (file)
@@ -182,7 +182,7 @@ __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
                return MM_ERROR_NONE;
        }
 
-       if (g_strrstr(attribute_name, "display") || g_strrstr(attribute_name, "wl_window_render_x")) {
+       if (g_strrstr(attribute_name, "display")) {
                char *param_name = NULL;
                int str_len = strlen(attribute_name);
                param_name = g_malloc0(str_len + 1);
@@ -549,7 +549,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        0
                },
                {
-                       "wl_window_render_x",
+                       "display_win_roi_x",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -558,7 +558,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        MMPLAYER_MAX_INT
                },
                {
-                       "wl_window_render_y",
+                       "display_win_roi_y",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -567,7 +567,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        MMPLAYER_MAX_INT
                },
                {
-                       "wl_window_render_width",
+                       "display_win_roi_width",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -576,7 +576,7 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        MMPLAYER_MAX_INT
                },
                {
-                       "wl_window_render_height",
+                       "display_win_roi_height",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
index 9fb8a3b..3b8b7bf 100644 (file)
@@ -3805,15 +3805,15 @@ __mmplayer_video_param_set_display_method(mm_player_t* player)
 }
 
 void
-__mmplayer_video_param_set_render_rectangle(mm_player_t* player)
+__mmplayer_video_param_set_roi_area(mm_player_t* player)
 {
        MMHandleType attrs = 0;
        void *handle = NULL;
        /*set wl_display*/
-       int wl_window_x = 0;
-       int wl_window_y = 0;
-       int wl_window_width = 0;
-       int wl_window_height = 0;
+       int win_roi_x = 0;
+       int win_roi_y = 0;
+       int win_roi_width = 0;
+       int win_roi_height = 0;
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
@@ -3826,18 +3826,18 @@ __mmplayer_video_param_set_render_rectangle(mm_player_t* player)
        mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
 
        if (handle) {
-               /*It should be set after setting window*/
-               mm_attrs_get_int_by_name(attrs, "wl_window_render_x", &wl_window_x);
-               mm_attrs_get_int_by_name(attrs, "wl_window_render_y", &wl_window_y);
-               mm_attrs_get_int_by_name(attrs, "wl_window_render_width", &wl_window_width);
-               mm_attrs_get_int_by_name(attrs, "wl_window_render_height", &wl_window_height);
-
-               /* After setting window handle, set render      rectangle */
-               gst_video_overlay_set_render_rectangle(
+               /* It should be set after setting window */
+               mm_attrs_get_int_by_name(attrs, "display_win_roi_x", &win_roi_x);
+               mm_attrs_get_int_by_name(attrs, "display_win_roi_y", &win_roi_y);
+               mm_attrs_get_int_by_name(attrs, "display_win_roi_width", &win_roi_width);
+               mm_attrs_get_int_by_name(attrs, "display_win_roi_height", &win_roi_height);
+
+               /* After setting window handle, set display roi area */
+               gst_video_overlay_set_display_roi_area(
                         GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
-                        wl_window_x, wl_window_y, wl_window_width, wl_window_height);
-               LOGD("set video param : render rectangle : x(%d) y(%d) width(%d) height(%d)",
-                       wl_window_x, wl_window_y, wl_window_width, wl_window_height);
+                        win_roi_x, win_roi_y, win_roi_width, win_roi_height);
+               LOGD("set video param : roi area : x(%d) y(%d) width(%d) height(%d)",
+                       win_roi_x, win_roi_y, win_roi_width, win_roi_height);
 
        }
 }
@@ -3894,12 +3894,12 @@ __mmplayer_update_wayland_videosink_video_param(mm_player_t* player, char *param
                __mmplayer_video_param_set_display_overlay(player);
        if (update_all_param || !g_strcmp0(param_name, "display_method"))
                __mmplayer_video_param_set_display_method(player);
-       if (update_all_param || !g_strcmp0(param_name, "wl_window_render_x"))
-               __mmplayer_video_param_set_render_rectangle(player);
        if (update_all_param || !g_strcmp0(param_name, "display_visible"))
                __mmplayer_video_param_set_display_visible(player);
        if (update_all_param || !g_strcmp0(param_name, "display_rotation"))
                __mmplayer_video_param_set_display_rotation(player);
+       if (update_all_param || !g_strcmp0(param_name, "display_win_roi_x"))
+               __mmplayer_video_param_set_roi_area(player);
 
        return MM_ERROR_NONE;
 }