From: Hyuntae Kim Date: Tue, 12 Nov 2019 08:50:09 +0000 (+0900) Subject: Set display handle for directvideosink X-Git-Tag: submit/tizen_5.5/20191119.104045^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1044299a1d7b6c0b0ea979fe5d244af8dcca3741;p=platform%2Fcore%2Fmultimedia%2Flibmm-camcorder.git Set display handle for directvideosink [Version] 0.10.189 [Profile] TV [Issue Type] Update Change-Id: Ic8cf1ddd6470ddd4786ca083e479d613130920ec --- diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index c0d3db9..d20b3d1 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -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 diff --git a/src/mm_camcorder_attribute.c b/src/mm_camcorder_attribute.c index 48d962f..d4bc7f6 100644 --- a/src/mm_camcorder_attribute.c +++ b/src/mm_camcorder_attribute.c @@ -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 { diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c index 5a9377b..a0da705 100644 --- a/src/mm_camcorder_gstcommon.c +++ b/src/mm_camcorder_gstcommon.c @@ -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); }