Fix bug for display custom ROI setting 91/92491/1
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 17 Oct 2016 07:26:16 +0000 (16:26 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 17 Oct 2016 07:26:16 +0000 (16:26 +0900)
The custom ROI position was not set if it's set before waylandsink creation.

[Version] 0.10.81
[Profile] Common
[Issue Type] Bug fix
[Dependency module] N/A
[Dependency commit] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20161016.2]

Change-Id: I22c137944e48fb53bf982ce95daaefa9133813d0
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/mm_camcorder_gstcommon.c

index 95bf29d..b8ddac1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.80
+Version:    0.10.81
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 7692784..267fb0c 100644 (file)
@@ -1285,10 +1285,10 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
 {
        int err = MM_ERROR_NONE;
        int size = 0;
-       int retx = 0;
-       int rety = 0;
-       int retwidth = 0;
-       int retheight = 0;
+       int rect_x = 0;
+       int rect_y = 0;
+       int rect_width = 0;
+       int rect_height = 0;
        int visible = 0;
        int rotation = MM_DISPLAY_ROTATION_NONE;
        int flip = MM_FLIP_NONE;
@@ -1324,10 +1324,10 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
 
        /* Get video display information */
        err = mm_camcorder_get_attributes(handle, &err_name,
-               MMCAM_DISPLAY_RECT_X, &retx,
-               MMCAM_DISPLAY_RECT_Y, &rety,
-               MMCAM_DISPLAY_RECT_WIDTH, &retwidth,
-               MMCAM_DISPLAY_RECT_HEIGHT, &retheight,
+               MMCAM_DISPLAY_RECT_X, &rect_x,
+               MMCAM_DISPLAY_RECT_Y, &rect_y,
+               MMCAM_DISPLAY_RECT_WIDTH, &rect_width,
+               MMCAM_DISPLAY_RECT_HEIGHT, &rect_height,
                MMCAM_DISPLAY_ROTATION, &rotation,
                MMCAM_DISPLAY_FLIP, &flip,
                MMCAM_DISPLAY_VISIBLE, &visible,
@@ -1428,12 +1428,17 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                MMCAMCORDER_G_OBJECT_SET(vsink, "zoom", zoom_level);
 
                if (display_geometry_method == MM_DISPLAY_METHOD_CUSTOM_ROI) {
-                       g_object_set(vsink,
-                               "dst-roi-x", retx,
-                               "dst-roi-y", rety,
-                               "dst-roi-w", retwidth,
-                               "dst-roi-h", retheight,
-                               NULL);
+                       if (!strcmp(videosink_name, "waylandsink")) {
+                           gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(vsink),
+                                       rect_x, rect_y, rect_width, rect_height);
+                       } else {
+                               g_object_set(vsink,
+                                       "dst-roi-x", rect_x,
+                                       "dst-roi-y", rect_y,
+                                       "dst-roi-w", rect_width,
+                                       "dst-roi-h", rect_height,
+                                       NULL);
+                       }
                }
        }