Set display handle for directvideosink 43/217543/5 accepted/tizen/unified/20191120.034533 submit/tizen/20191119.110334
authorHyuntae Kim <ht1211.kim@samsung.com>
Tue, 12 Nov 2019 08:50:09 +0000 (17:50 +0900)
committerHyuntae Kim <ht1211.kim@samsung.com>
Thu, 14 Nov 2019 05:19:36 +0000 (14:19 +0900)
    [Version] 0.10.189
    [Profile] TV
    [Issue Type] Update

Change-Id: Ic8cf1ddd6470ddd4786ca083e479d613130920ec

packaging/libmm-camcorder.spec
src/mm_camcorder_attribute.c
src/mm_camcorder_gstcommon.c

index c0d3db9..d20b3d1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.188
+Version:    0.10.189
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 48d962f..d4bc7f6 100644 (file)
@@ -3806,6 +3806,20 @@ bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const
                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 if (!strcmp(videosink_name, "directvideosink")) {
+               window_info = (MMCamWindowInfo *)dp_handle;
+               _mmcam_dbg_log("wayland global surface id : %d, x,y,w,h (%d,%d,%d,%d)",
+                       window_info->surface_id,
+                       window_info->rect.x,
+                       window_info->rect.y,
+                       window_info->rect.width,
+                       window_info->rect.height);
+               gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)window_info->surface_id);
+               gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst),
+                       window_info->rect.x,
+                       window_info->rect.y,
+                       window_info->rect.width,
+                       window_info->rect.height);
        } else {
                _mmcam_dbg_warn("Commit : Nothing to commit with this element[%s]", videosink_name);
                return FALSE;
@@ -3942,7 +3956,8 @@ bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, cons
        }
 
        if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink") ||
-               !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink")) {
+               !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "evasimagesink") ||
+               !strcmp(videosink_name, "directvideosink")) {
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "visible", value->value.i_val);
                _mmcam_dbg_log("Set visible [%d] done.", value->value.i_val);
        } else {
index 5a9377b..a0da705 100644 (file)
@@ -1439,8 +1439,7 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
        _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 (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink")) {
                if (dp_handle) {
                        xid = *dp_handle;
                        _mmcam_dbg_log("xid = %lu )", xid);
@@ -1473,6 +1472,29 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                } else {
                        _mmcam_dbg_warn("Handle is NULL. skip setting.");
                }
+       } else if (!strcmp(videosink_name, "directvideosink")) {
+               if (dp_handle) {
+                       window_info = (MMCamWindowInfo *)dp_handle;
+                       _mmcam_dbg_log("wayland global surface id : %d, x,y,w,h (%d,%d,%d,%d)",
+                               window_info->surface_id,
+                               window_info->rect.x,
+                               window_info->rect.y,
+                               window_info->rect.width,
+                               window_info->rect.height);
+                       gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), (guintptr)window_info->surface_id);
+                       gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(vsink),
+                               window_info->rect.x,
+                               window_info->rect.y,
+                               window_info->rect.width,
+                               window_info->rect.height);
+               } else {
+                       _mmcam_dbg_warn("dp_handle is null");
+               }
+#ifdef _MMCAMCORDER_RM_SUPPORT
+               if (hcamcorder->request_resources.category_id[0] == RM_CATEGORY_VIDEO_DECODER_SUB)
+                       display_scaler = 1;
+               MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", display_scaler);
+#endif /* _MMCAMCORDER_RM_SUPPORT */
        } else {
                _mmcam_dbg_warn("Who are you?? (Videosink: %s)", videosink_name);
        }