Update code to set display handle 49/217449/3 accepted/tizen/unified/20191112.125141 submit/tizen/20191112.051613
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 12 Nov 2019 01:57:40 +0000 (10:57 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 12 Nov 2019 04:46:03 +0000 (13:46 +0900)
[Version] 0.10.188
[Profile] Common
[Issue Type] Update

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

index 5750ff3..c0d3db9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.187
+Version:    0.10.188
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 0eb6492..67e1eee 100644 (file)
@@ -1870,6 +1870,14 @@ typedef struct _MMCamFaceDetectInfo {
        MMCamFaceInfo *face_info;               /**< face information, this should be freed after use it. */
 } MMCamFaceDetectInfo;
 
+/**
+ * Window information
+ */
+typedef struct _MMCamWindowInfo {
+       int surface_id;
+       MMRectType rect;
+} MMCamWindowInfo;
+
 
 /*=======================================================================================
 | TYPE DEFINITIONS                                                                     |
index 39c3ac4..48d962f 100644 (file)
@@ -3758,7 +3758,8 @@ bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const
 {
        int current_state = MM_CAMCORDER_STATE_NONE;
        const char *videosink_name = NULL;
-       void *p_handle = NULL;
+       void *dp_handle = NULL;
+       MMCamWindowInfo *window_info = NULL;
 
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
        _MMCamcorderSubContext *sc = NULL;
@@ -3778,34 +3779,35 @@ bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const
                return TRUE;
        }
 
+       dp_handle = value->value.p_val;
+       if (!dp_handle) {
+               _mmcam_dbg_warn("Display handle is NULL");
+               return FALSE;
+       }
+
        sc = MMF_CAMCORDER_SUBCONTEXT(handle);
 
-       p_handle = value->value.p_val;
-       if (p_handle) {
-               /* get videosink name */
-               _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
-               if (videosink_name == NULL) {
-                       _mmcam_dbg_err("Please check videosink element in configuration file");
-                       return FALSE;
-               }
+       /* get videosink name */
+       _mmcamcorder_conf_get_value_element_name(sc->VideosinkElement, &videosink_name);
+       if (!videosink_name) {
+               _mmcam_dbg_err("Please check videosink element in configuration file");
+               return FALSE;
+       }
 
-               _mmcam_dbg_log("Commit : videosinkname[%s]", videosink_name);
-
-               if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink")) {
-                       _mmcam_dbg_log("Commit : Set XID[%x]", *(int *)(p_handle));
-                       gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), *(int *)(p_handle));
-               } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
-                       _mmcam_dbg_log("Commit : Set evas object [%p]", p_handle);
-                       MMCAMCORDER_G_OBJECT_SET_POINTER(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", p_handle);
-               } else if (!strcmp(videosink_name, "tizenwlsink")) {
-                       _mmcam_dbg_log("wayland global surface id : %d", *(int *)(p_handle));
-                       gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)*(int *)(p_handle));
-               } else {
-                       _mmcam_dbg_warn("Commit : Nothing to commit with this element[%s]", videosink_name);
-                       return FALSE;
-               }
+       _mmcam_dbg_log("Commit : videosinkname[%s]", videosink_name);
+
+       if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink")) {
+               _mmcam_dbg_log("Commit : Set XID[%x]", *(int *)(dp_handle));
+               gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), *(int *)(dp_handle));
+       } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
+               _mmcam_dbg_log("Commit : Set evas object [%p]", dp_handle);
+               MMCAMCORDER_G_OBJECT_SET_POINTER(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", dp_handle);
+       } else if (!strcmp(videosink_name, "tizenwlsink")) {
+               window_info = (MMCamWindowInfo *)dp_handle;
+               _mmcam_dbg_log("wayland global surface id : %d", window_info->surface_id);
+               gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)window_info->surface_id);
        } else {
-               _mmcam_dbg_warn("Display handle is NULL");
+               _mmcam_dbg_warn("Commit : Nothing to commit with this element[%s]", videosink_name);
                return FALSE;
        }
 
index 3e19d7c..5a9377b 100644 (file)
@@ -1381,7 +1381,8 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
 #ifdef _MMCAMCORDER_RM_SUPPORT
        int display_scaler = 0;
 #endif /* _MMCAMCORDER_RM_SUPPORT */
-       int *overlay = NULL;
+       int *dp_handle = NULL;
+       MMCamWindowInfo *window_info = NULL;
        gulong xid;
        char *err_name = NULL;
        const char *videosink_name = NULL;
@@ -1411,7 +1412,7 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                MMCAM_DISPLAY_ROTATION, &rotation,
                MMCAM_DISPLAY_FLIP, &flip,
                MMCAM_DISPLAY_VISIBLE, &visible,
-               MMCAM_DISPLAY_HANDLE, (void**)&overlay, &size,
+               MMCAM_DISPLAY_HANDLE, (void **)&dp_handle, &size,
                MMCAM_DISPLAY_MODE, &display_mode,
                MMCAM_DISPLAY_GEOMETRY_METHOD, &display_geometry_method,
                MMCAM_DISPLAY_SCALE, &zoom_attr,
@@ -1435,13 +1436,13 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                return MM_ERROR_CAMCORDER_INTERNAL;
        }
 
-       _mmcam_dbg_log("(overlay=%p, size=%d)", overlay, size);
+       _mmcam_dbg_log("(dp_handle=%p, size=%d)", dp_handle, size);
 
        /* Set display handle */
        if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink") ||
                !strcmp(videosink_name, "directvideosink")) {
-               if (overlay) {
-                       xid = *overlay;
+               if (dp_handle) {
+                       xid = *dp_handle;
                        _mmcam_dbg_log("xid = %lu )", xid);
                        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), xid);
                } else {
@@ -1455,19 +1456,20 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", display_scaler);
 #endif /* _MMCAMCORDER_RM_SUPPORT */
        } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
-               _mmcam_dbg_log("videosink : %s, handle : %p", videosink_name, overlay);
+               _mmcam_dbg_log("videosink : %s, handle : %p", videosink_name, dp_handle);
 
-               if (overlay) {
-                       MMCAMCORDER_G_OBJECT_SET_POINTER(vsink, "evas-object", overlay);
+               if (dp_handle) {
+                       MMCAMCORDER_G_OBJECT_SET_POINTER(vsink, "evas-object", dp_handle);
                        MMCAMCORDER_G_OBJECT_SET(vsink, "origin-size", !do_scaling);
                } else {
                        _mmcam_dbg_err("display handle(eavs object) is NULL");
                        return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
                }
        } else if (!strcmp(videosink_name, "tizenwlsink")) {
-               if (overlay) {
-                       _mmcam_dbg_log("wayland global surface id : %d", *overlay);
-                       gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(vsink), *overlay);
+               if (dp_handle) {
+                       window_info = (MMCamWindowInfo *)dp_handle;
+                       _mmcam_dbg_log("wayland global surface id : %d", window_info->surface_id);
+                       gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(vsink), window_info->surface_id);
                } else {
                        _mmcam_dbg_warn("Handle is NULL. skip setting.");
                }