From a72b321f623889456494173e41d019d390a6d84b Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 15 Nov 2016 17:11:55 +0900 Subject: [PATCH] waylandsink : 1. Add SR32(BGRA) Format (tbm zero copy). 2. Change ROI interface between client and server. Change-Id: I8ea31cbacebc6cf40598dbb5dbec8a10ef8b4fac Signed-off-by: Hyunil (cherry picked from commit c8501d1f72c22d303a888dcd7dc9157493efd3ef) --- ext/wayland/gstwaylandsink.c | 7 +- ext/wayland/gstwaylandsink.h | 18 -- ext/wayland/tizen-wlvideoformat.c | 2 + ext/wayland/wlbuffer.c | 2 +- ext/wayland/wldisplay.c | 2 +- ext/wayland/wlshmallocator.c | 5 +- ext/wayland/wlwindow.c | 265 +++++++++--------------------- ext/wayland/wlwindow.h | 21 ++- 8 files changed, 113 insertions(+), 209 deletions(-) mode change 100755 => 100644 ext/wayland/tizen-wlvideoformat.c diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 6302eb5e2..c19509b83 100755 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -1400,6 +1400,10 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter) g_value_set_string (&value, gst_video_format_to_string (GST_VIDEO_FORMAT_ST12)); gst_value_list_append_value (&list, &value); + } else if (tbm_fmt == TBM_FORMAT_ARGB8888) { + g_value_set_string (&value, + gst_video_format_to_string (GST_VIDEO_FORMAT_SR32)); + gst_value_list_append_value (&list, &value); } } else { /* USE SHM */ fmt = g_array_index (formats, uint32_t, i); @@ -1513,7 +1517,8 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) if (sink->USE_TBM) { if (GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_SN12 || - GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_ST12) { + GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_ST12 || + GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_SR32) { sink->display->is_native_format = TRUE; /* store the video info */ diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h index 03e45f813..2a1f6aa4a 100644 --- a/ext/wayland/gstwaylandsink.h +++ b/ext/wayland/gstwaylandsink.h @@ -55,24 +55,6 @@ enum DISP_GEO_METHOD_NUM, }; -enum -{ - DEGREE_0, - DEGREE_90, - DEGREE_180, - DEGREE_270, - DEGREE_NUM, -}; - -enum -{ - FLIP_NONE = 0, - FLIP_HORIZONTAL, - FLIP_VERTICAL, - FLIP_BOTH, - FLIP_NUM, -}; - #define DEF_DISPLAY_FLIP FLIP_NONE #define DEF_DISPLAY_GEOMETRY_METHOD DISP_GEO_METHOD_LETTER_BOX #endif diff --git a/ext/wayland/tizen-wlvideoformat.c b/ext/wayland/tizen-wlvideoformat.c old mode 100755 new mode 100644 index 90f2f90d0..a9dc1475c --- a/ext/wayland/tizen-wlvideoformat.c +++ b/ext/wayland/tizen-wlvideoformat.c @@ -46,12 +46,14 @@ static const wl_TbmVideoFormat tbm_formats[] = { {TBM_FORMAT_ABGR8888, GST_VIDEO_FORMAT_RGBA}, {TBM_FORMAT_RGBA8888, GST_VIDEO_FORMAT_RGBA}, {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_BGRA}, + {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_SR32} #else {TBM_FORMAT_XRGB8888, GST_VIDEO_FORMAT_BGRx}, {TBM_FORMAT_XBGR8888, GST_VIDEO_FORMAT_RGBx}, {TBM_FORMAT_RGBX8888, GST_VIDEO_FORMAT_xBGR}, {TBM_FORMAT_BGRX8888, GST_VIDEO_FORMAT_xRGB}, {TBM_FORMAT_ARGB8888, GST_VIDEO_FORMAT_BGRA}, + {TBM_FORMAT_ARGB8888, GST_VIDEO_FORMAT_SR32}, {TBM_FORMAT_ABGR8888, GST_VIDEO_FORMAT_RGBA}, {TBM_FORMAT_RGBA8888, GST_VIDEO_FORMAT_ABGR}, {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_ARGB}, diff --git a/ext/wayland/wlbuffer.c b/ext/wayland/wlbuffer.c index f668a8852..e49d98d2f 100644 --- a/ext/wayland/wlbuffer.c +++ b/ext/wayland/wlbuffer.c @@ -248,7 +248,7 @@ gst_buffer_add_wl_buffer (GstBuffer * gstbuffer, struct wl_buffer *wlbuffer, ("wl_buffer_add_listener (wl_buffer@%p, wl_buffer_listener@%p, GstWlBuffer@%p)", self->wlbuffer, &buffer_listener, self); wl_buffer_add_listener (self->wlbuffer, &buffer_listener, self); -#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT //need to contribute to upstream !! +#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT //need to contribute to upstream !! wl_proxy_set_queue ((struct wl_proxy *) self->wlbuffer, self->display->queue); #endif gst_mini_object_set_qdata ((GstMiniObject *) gstbuffer, diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c index 2b58ef86a..b46f9cce7 100644 --- a/ext/wayland/wldisplay.c +++ b/ext/wayland/wldisplay.c @@ -194,7 +194,7 @@ gst_wl_display_roundtrip (GstWlDisplay * self) self->display); wl_callback_add_listener (callback, &sync_listener, &done); GST_INFO - ("wl_callback_add_listener (wl_callback@%p, wl_callback_listener@%p, done@%p)", + ("wl_callback_add_listener (wl_callback@%p, sync_listener@%p, done@%p)", callback, &sync_listener, &done); wl_proxy_set_queue ((struct wl_proxy *) callback, self->queue); GST_INFO ("wl_proxy_set_queue (wl_callback@%p, wl_event_queue@%p)", callback, diff --git a/ext/wayland/wlshmallocator.c b/ext/wayland/wlshmallocator.c index a5f75d90d..855be0017 100644 --- a/ext/wayland/wlshmallocator.c +++ b/ext/wayland/wlshmallocator.c @@ -288,7 +288,7 @@ gst_wl_shm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display, #endif GST_LOG ("TBM bo %p %p", display->bo[0], display->bo[1]); GST_LOG ("stride_width[0]: %d stride_height[0]:%d", - display->stride_width[0], display->stride_height[1]); + display->stride_width[0], display->stride_height[0]); width = display->stride_width[0]; height = display->stride_height[0]; ts_info.width = width; @@ -394,7 +394,8 @@ gst_wl_shm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display, } display->buffer_width = width; display->buffer_height = height; - + GST_LOG ("buffer_width(%d) buffer_height(%d)", display->buffer_width, + display->buffer_height); return wbuffer; #else /* open source */ diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index 1e6fa866a..4ef7375df 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -31,36 +31,6 @@ #include "wlshmallocator.h" #include "wlbuffer.h" -enum -{ - ROTATE_0, - ROTATE_90, - ROTATE_180, - ROTATE_270, -}; - - -enum -{ - ROTATE_0_FLIP_NONE, - ROTATE_0_FLIP_HORIZONTAL, - ROTATE_0_FLIP_VERTICAL, - ROTATE_0_FLIP_BOTH, - ROTATE_90_FLIP_NONE = 10, - ROTATE_90_FLIP_HORIZONTAL, - ROTATE_90_FLIP_VERTICAL, - ROTATE_90_FLIP_BOTH, - ROTATE_180_FLIP_NONE = 20, - ROTATE_180_FLIP_HORIZONTAL, - ROTATE_180_FLIP_VERTICAL, - ROTATE_180_FLIP_BOTH, - ROTATE_270_FLIP_NONE = 30, - ROTATE_270_FLIP_HORIZONTAL, - ROTATE_270_FLIP_VERTICAL, - ROTATE_270_FLIP_BOTH, - ROTATE_NUM, -}; - GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); #define GST_CAT_DEFAULT gstwayland_debug @@ -92,31 +62,6 @@ static const struct wl_shell_surface_listener shell_surface_listener = { handle_popup_done }; -static void -parent_size (void *data, struct tizen_viewport *tizen_viewport, uint32_t width, - uint32_t height) -{ - GstWlWindow *self = data; - FUNCTION; - g_return_if_fail (self != NULL); - self->parent_win.w = width; - self->parent_win.h = height; - GST_LOG ("parent size is (w)%d x (h)%d", self->parent_win.w, - self->parent_win.h); -} - -static void -destination_changed (void *data, struct tizen_viewport *tizen_viewport, - uint32_t transform, int32_t x, int32_t y, uint32_t width, uint32_t height) -{ -} - -static const struct tizen_viewport_listener viewport_listener = { - destination_changed, - parent_size, -}; - - static void gst_wl_window_class_init (GstWlWindowClass * klass) { @@ -131,9 +76,8 @@ gst_wl_window_init (GstWlWindow * self) g_return_if_fail (self != NULL); self->buffer_width = self->buffer_height = 0; self->buffer_x = self->buffer_y = 0; - self->parent_win.x = self->parent_win.y = 0; - self->parent_win.w = self->parent_win.h = 0; self->roi.x = self->roi.y = self->roi.w = self->roi.h = 0; + self->flip.changed = FALSE; } static void @@ -331,16 +275,6 @@ gst_wl_window_new_internal (GstWlDisplay * display) GST_INFO ("tizen_area_viewport(tizen_viewport)@%p = tizen_video_get_viewport(tizen_video@%p, area_surface(wl_surface)@%p)", window->tizen_area_viewport, display->tizen_video, window->area_surface); - - /* query parent size */ - if (window->tizen_area_viewport) { - tizen_viewport_query_parent_size (window->tizen_area_viewport); - tizen_viewport_add_listener (window->tizen_area_viewport, - &viewport_listener, window); - /* to execute query(tizen_viewport_query_parent_size) immediately */ - wl_display_roundtrip (display->display); - } - window->tizen_video_viewport = tizen_video_get_viewport (display->tizen_video, window->video_surface); GST_INFO @@ -350,8 +284,12 @@ gst_wl_window_new_internal (GstWlDisplay * display) window->tizen_video_dest_mode = tizen_viewport_get_destination_mode (window->tizen_video_viewport); GST_INFO - ("tizen_destination_mode@%p = tizen_viewport_get_destination_mode (tizen_video_viewport@%p)", + ("tizen_video_dest_mode(tizen_destination_mode)@%p = tizen_viewport_get_destination_mode (tizen_video_viewport@%p)", window->tizen_video_dest_mode, window->tizen_video_viewport); + /* video surface always follow area surface by below code. */ + GST_INFO ("tizen_viewport_follow_parent_transform(tizen_video_viewport@%p)", + window->tizen_video_viewport); + tizen_viewport_follow_parent_transform (window->tizen_video_viewport); #else window->area_viewport = wl_scaler_get_viewport (display->scaler, @@ -427,10 +365,11 @@ gst_wl_window_new_internal (GstWlDisplay * display) window->tizen_area_dest_mode = tizen_viewport_get_destination_mode (window->tizen_area_viewport); GST_INFO - ("tizen_destination_mode@%p = tizen_viewport_get_destination_mode (tizen_video_viewport@%p)", + ("tizen_area_dest_mode(tizen_destination_mode)@%p = tizen_viewport_get_destination_mode (tizen_video_viewport@%p)", window->tizen_area_dest_mode, window->tizen_area_viewport); if (window->tizen_area_dest_mode) { - GST_INFO ("tizen_destination_mode_set (tizen_destination_mode@%p, @%d)", + GST_INFO + ("tizen_destination_mode_set (tizen_destination_mode@%p, @%d, 3 is FULL)", window->tizen_area_dest_mode, tizen_disp_mode); tizen_destination_mode_set (window->tizen_area_dest_mode, tizen_disp_mode); @@ -460,12 +399,12 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info) window->area_surface); #endif if (window->shell_surface) { - GST_LOG + GST_INFO ("wl_shell_surface_add_listener (shell_surface@%p, wl_shell_surface_listener@%p, GstWlWindow@%p", window->shell_surface, &shell_surface_listener, window); wl_shell_surface_add_listener (window->shell_surface, &shell_surface_listener, window); - GST_LOG ("wl_shell_surface_set_toplevel (shell_surface@%p", + GST_INFO ("wl_shell_surface_set_toplevel (shell_surface@%p", window->shell_surface); wl_shell_surface_set_toplevel (window->shell_surface); } else { @@ -535,11 +474,13 @@ gst_wl_window_new_in_surface (GstWlDisplay * display, /*Area surface from App need to be under parent surface */ if (display->tizen_policy) { - GST_INFO ("tizen_policy_place_subsurface_below_parent (%p, %p)", + GST_INFO + ("tizen_policy_place_subsurface_below_parent (tizen_policy@%p, area_subsurface@%p)", display->tizen_policy, window->area_subsurface); tizen_policy_place_subsurface_below_parent (display->tizen_policy, window->area_subsurface); - GST_INFO ("tizen_policy_place_subsurface_below_parent (%p, %p)", + GST_INFO + ("tizen_policy_place_subsurface_below_parent (tizen_policy@%p, video_subsurface@%p)", display->tizen_policy, window->video_subsurface); tizen_policy_place_subsurface_below_parent (display->tizen_policy, window->video_subsurface); @@ -597,61 +538,46 @@ static gint gst_wl_window_find_transform (guint rotate_angle, guint flip) { gint transform = WL_OUTPUT_TRANSFORM_NORMAL; - guint combine = rotate_angle * 10 + flip; FUNCTION; - GST_DEBUG ("rotate %d, flip %d, combine %d", rotate_angle, flip, combine); - switch (combine) { - case ROTATE_0_FLIP_NONE: + + if ((rotate_angle == -1) && flip >= 0) + goto set_flip; + + GST_DEBUG ("rotate (%d)", rotate_angle); + switch (rotate_angle) { + case DEGREE_0: transform = WL_OUTPUT_TRANSFORM_NORMAL; break; - case ROTATE_0_FLIP_HORIZONTAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED; - break; - case ROTATE_0_FLIP_VERTICAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_180; - break; - case ROTATE_0_FLIP_BOTH: - transform = WL_OUTPUT_TRANSFORM_180; - break; - case ROTATE_90_FLIP_NONE: + case DEGREE_90: transform = WL_OUTPUT_TRANSFORM_90; break; - case ROTATE_90_FLIP_HORIZONTAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_90; - break; - case ROTATE_90_FLIP_VERTICAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; - break; - case ROTATE_90_FLIP_BOTH: - transform = WL_OUTPUT_TRANSFORM_270; - break; - case ROTATE_180_FLIP_NONE: + case DEGREE_180: transform = WL_OUTPUT_TRANSFORM_180; break; - case ROTATE_180_FLIP_HORIZONTAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_180; - break; - case ROTATE_180_FLIP_VERTICAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED; + case DEGREE_270: + transform = WL_OUTPUT_TRANSFORM_270; break; - case ROTATE_180_FLIP_BOTH: + } + return transform; + +set_flip: + GST_DEBUG ("flip (%d)", flip); + switch (flip) { + case FLIP_NONE: transform = WL_OUTPUT_TRANSFORM_NORMAL; break; - case ROTATE_270_FLIP_NONE: - transform = WL_OUTPUT_TRANSFORM_270; - break; - case ROTATE_270_FLIP_HORIZONTAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; + case FLIP_HORIZONTAL: + transform = WL_OUTPUT_TRANSFORM_FLIPPED; break; - case ROTATE_270_FLIP_VERTICAL: - transform = WL_OUTPUT_TRANSFORM_FLIPPED_90; + case FLIP_VERTICAL: + transform = WL_OUTPUT_TRANSFORM_FLIPPED_180; break; - case ROTATE_270_FLIP_BOTH: - transform = WL_OUTPUT_TRANSFORM_90; + case FLIP_BOTH: + transform = WL_OUTPUT_TRANSFORM_180; break; } - return transform; + } #endif @@ -706,9 +632,8 @@ gst_wl_window_resize_tizen_video_viewport (GstWlWindow * window, tizen_disp_mode = TIZEN_DESTINATION_MODE_TYPE_ORIGIN_OR_LETTER; break; case DISP_GEO_METHOD_CUSTOM_ROI: - GST_LOG ("DISP_GEO_METHOD_CUSTOM_ROI..need to set tizen disp mode"); - GST_LOG ("Video need to set TIZEN_DESTINATION_MODE_TYPE_FULL"); - tizen_disp_mode = TIZEN_DESTINATION_MODE_TYPE_FULL; + GST_LOG ("DISP_GEO_METHOD_CUSTOM_ROI..need to set destination ROI"); + tizen_disp_mode = -1; break; default: break; @@ -720,11 +645,20 @@ gst_wl_window_resize_tizen_video_viewport (GstWlWindow * window, tizen_destination_mode_set (window->tizen_video_dest_mode, tizen_disp_mode); } + if (window->disp_geo_method.value == DISP_GEO_METHOD_CUSTOM_ROI) { + /* set ROI destination */ + GST_INFO + ("tizen_viewport_set_destination (tizen_video_viewport(tizen_viewport)@%p, x@%d, y@%d, w@%d, h@%d)", + window->tizen_video_viewport, window->roi.x, window->roi.y, + window->roi.w, window->roi.h); + tizen_viewport_set_destination (window->tizen_video_viewport, + window->roi.x, window->roi.y, window->roi.w, window->roi.h); + } window->disp_geo_method.changed = FALSE; } - if (window->disp_geo_method.value == DISP_GEO_METHOD_CUSTOM_ROI) - goto done; + + goto done; /* Even though area_viewport is set to ROI mode, we can set below functions too if video_viewport is set to tizen_destination_mode_set. */ #ifdef ENABLE_FUNCTION @@ -816,23 +750,30 @@ gst_wl_window_resize_tizen_video_viewport (GstWlWindow * window, #endif done: + /* set rotate */ + if (window->rotate_angle.changed) { + GST_LOG ("set rotate_angle(%d)", window->rotate_angle.value); + transform = gst_wl_window_find_transform (window->rotate_angle.value, -1); + GST_INFO + ("tizen_viewport_set_transform(tizen_area_viewport@%p, transform@%d)", + window->tizen_area_viewport, transform); + tizen_viewport_set_transform (window->tizen_area_viewport, transform); + window->rotate_angle.changed = FALSE; + } + /* set flip */ + if (window->flip.changed) { + GST_LOG ("set flip(%d)", window->flip.value); - /* set transform */ - if (window->rotate_angle.changed || window->flip.changed) { - GST_LOG ("rotate_angle(%d), flip(%d)", window->rotate_angle.value, - window->flip.value); - transform = - gst_wl_window_find_transform (window->rotate_angle.value, - window->flip.value); + transform = gst_wl_window_find_transform (-1, window->flip.value); GST_INFO ("tizen_viewport_set_transform(tizen_video_viewport@%p, transform@%d)", window->tizen_video_viewport, transform); tizen_viewport_set_transform (window->tizen_video_viewport, transform); - window->rotate_angle.changed = window->flip.changed = FALSE; + window->flip.changed = FALSE; } if (commit) { - GST_INFO ("need to commit"); + GST_LOG ("need to commit"); GST_INFO ("wl_surface_damage_buffer (video_surface@%p, buffer_@x%d, buffer_y@%d, buffer_w@%d, buffer_h@%d)", window->video_surface, window->buffer_x, window->buffer_y, @@ -892,7 +833,11 @@ gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, || window->buffer_height != window->display->buffer_height) { window->buffer_width = window->display->buffer_width; window->buffer_height = window->display->buffer_height; + GST_LOG ("buffer_width(%d) buffer_height(%d)", + window->display->buffer_width, window->display->buffer_height); } + GST_LOG ("buffer_width(%d) buffer_height(%d)", window->display->buffer_width, + window->display->buffer_height); if (G_UNLIKELY (info)) { window->video_width = @@ -972,44 +917,6 @@ gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, #endif } -static void -gst_wl_window_calculate_wl_roi_rectangle (GstWlWindow * window) -{ - FUNCTION; - g_return_if_fail (window != NULL); - - switch (window->rotate_angle.value) { - case ROTATE_0: - window->wl_roi.x = window->roi.x; - window->wl_roi.y = window->roi.y; - window->wl_roi.w = window->roi.w; - window->wl_roi.h = window->roi.h; - break; - case ROTATE_90: - window->wl_roi.x = window->roi.y; - window->wl_roi.y = window->parent_win.h - (window->roi.w + window->roi.x); - window->wl_roi.w = window->roi.h; - window->wl_roi.h = window->roi.w; - break; - case ROTATE_180: - window->wl_roi.x = window->parent_win.w - (window->roi.w + window->roi.x); - window->wl_roi.y = window->parent_win.h - (window->roi.h + window->roi.y); - window->wl_roi.w = window->roi.w; - window->wl_roi.h = window->roi.h; - break; - case ROTATE_270: - window->wl_roi.x = window->parent_win.w - (window->roi.h + window->roi.y); - window->wl_roi.y = window->roi.x; - window->wl_roi.w = window->roi.h; - window->wl_roi.h = window->roi.w; - break; - default: - break; - } - GST_DEBUG ("wl roi : x(%d) y(%d) w(%d) h(%d)", window->wl_roi.x, - window->wl_roi.y, window->wl_roi.w, window->wl_roi.h); -} - void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, gint w, gint h) @@ -1023,30 +930,27 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, ("must be set display-geometry-method to DISP_GEO_METHOD_CUSTOM_ROI before setting render rectangle()"); return; } - if (window->parent_win.w <= 0 || window->parent_win.h <= 0) { - GST_ERROR ("Error : get parent win size"); - } - if (w <= 0 || h <= 0) { + + if (w < 0 || h < 0) { GST_ERROR ("Error : wrong roi size w(%d), h(%d)", w, h); + return; } window->roi.x = x; window->roi.y = y; window->roi.w = w; window->roi.h = h; - window->wl_roi.x = window->wl_roi.y = window->wl_roi.w = window->wl_roi.h = 0; - /* calculate wl roi area */ - gst_wl_window_calculate_wl_roi_rectangle (window); + GST_LOG ("set roi x(%d), y(%d), w(%d), h(%d)", x, y, w, h); + return; +#if 0 /* position the area inside the parent - needs a parent commit to apply */ /* use tizen view port */ if (window->tizen_area_viewport) { GST_INFO ("tizen_viewport_set_destination (tizen_area_viewport(tizen_viewport)@%p, x@%d, y@%d, w@%d, h@%d)", - window->tizen_area_viewport, window->wl_roi.x, window->wl_roi.y, - window->wl_roi.w, window->wl_roi.h); - tizen_viewport_set_destination (window->tizen_area_viewport, - window->wl_roi.x, window->wl_roi.y, window->wl_roi.w, window->wl_roi.h); + window->tizen_area_viewport, x, y, w, h); + tizen_viewport_set_destination (window->tizen_area_viewport, x, y, w, h); } if (window->video_width != 0) { @@ -1061,7 +965,7 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, } GST_INFO ("wl_surface_commit (area_surface@%p)", window->area_surface); wl_surface_commit (window->area_surface); - +#endif #else /* open source */ g_return_if_fail (window != NULL); @@ -1101,11 +1005,6 @@ gst_wl_window_set_rotate_angle (GstWlWindow * window, guint rotate_angle) window->rotate_angle.value = rotate_angle; GST_LOG ("rotate_angle value is (%d)", window->rotate_angle.value); window->rotate_angle.changed = TRUE; - /* if set ROI */ - if (window->disp_geo_method.value == DISP_GEO_METHOD_CUSTOM_ROI - && window->roi.w > 0 && window->roi.h > 0) - gst_wl_window_set_render_rectangle (window, window->roi.x, window->roi.y, - window->roi.w, window->roi.h); } void diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h index 7df131ced..28780e1fb 100644 --- a/ext/wayland/wlwindow.h +++ b/ext/wayland/wlwindow.h @@ -33,6 +33,24 @@ G_BEGIN_DECLS #define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW)) #define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass)) +enum +{ + DEGREE_0, + DEGREE_90, + DEGREE_180, + DEGREE_270, + DEGREE_NUM, +}; + +enum +{ + FLIP_NONE = 0, + FLIP_HORIZONTAL, + FLIP_VERTICAL, + FLIP_BOTH, + FLIP_NUM, +}; + typedef struct { guint value; @@ -92,10 +110,7 @@ struct _GstWlWindow WinGeometryRange mode_scale; WinGeometryRange mode_align; #endif - /* parent window size*/ - GstVideoRectangle parent_win; GstVideoRectangle roi; - GstVideoRectangle wl_roi; #endif /* the size and position of the area_(sub)surface */ -- 2.34.1