From 79b0fb190f9b28fdbdbf5d437f25e8bf934091d4 Mon Sep 17 00:00:00 2001 From: NAMJEONGYOON Date: Mon, 11 Jan 2016 11:12:22 +0900 Subject: [PATCH] [waylandsink] add properties related to display geometry Change-Id: I0c0e08fd9848d19ae660c54a4f6b56d691b0aac8 --- ext/wayland/gstwaylandsink.c | 219 ++++++++++++++++++++++++++++++++++++++++++- ext/wayland/gstwaylandsink.h | 37 ++++++++ ext/wayland/wlwindow.c | 214 +++++++++++++++++++++++++++++++++++++++++- ext/wayland/wlwindow.h | 13 +++ 4 files changed, 477 insertions(+), 6 deletions(-) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 11f665e..ffe580f 100755 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -58,6 +58,75 @@ #include //#define DUMP_BUFFER +#ifdef GST_WLSINK_ENHANCEMENT +#define GST_TYPE_WAYLANDSINK_DISPLAY_GEOMETRY_METHOD (gst_waylandsink_display_geometry_method_get_type()) +#define GST_TYPE_WAYLANDSINK_ROTATE_ANGLE (gst_waylandsink_rotate_angle_get_type()) +#define GST_TYPE_WAYLANDSINK_FLIP (gst_waylandsink_flip_get_type()) + +static GType +gst_waylandsink_rotate_angle_get_type (void) +{ + static GType waylandsink_rotate_angle_type = 0; + static const GEnumValue rotate_angle_type[] = { + {0, "No rotate", "DEGREE_0"}, + {1, "Rotate 90 degree", "DEGREE_90"}, + {2, "Rotate 180 degree", "DEGREE_180"}, + {3, "Rotate 270 degree", "DEGREE_270"}, + {4, NULL, NULL}, + }; + + if (!waylandsink_rotate_angle_type) { + waylandsink_rotate_angle_type = + g_enum_register_static ("GstWaylandSinkRotateAngleType", + rotate_angle_type); + } + + return waylandsink_rotate_angle_type; +} + + +static GType +gst_waylandsink_display_geometry_method_get_type (void) +{ + static GType waylandsink_display_geometry_method_type = 0; + static const GEnumValue display_geometry_method_type[] = { + {0, "Letter box", "LETTER_BOX"}, + {1, "Origin size", "ORIGIN_SIZE"}, + {2, "Full-screen", "FULL_SCREEN"}, + {3, "Cropped full-screen", "CROPPED_FULL_SCREEN"}, + {4, "Origin size(if screen size is larger than video size(width/height)) or Letter box(if video size(width/height) is larger than screen size)", "ORIGIN_SIZE_OR_LETTER_BOX"}, + {5, NULL, NULL}, + }; + + if (!waylandsink_display_geometry_method_type) { + waylandsink_display_geometry_method_type = + g_enum_register_static ("GstWaylandSinkDisplayGeometryMethodType", + display_geometry_method_type); + } + return waylandsink_display_geometry_method_type; +} + +static GType +gst_waylandsink_flip_get_type (void) +{ + static GType waylandsink_flip_type = 0; + static const GEnumValue flip_type[] = { + {FLIP_NONE, "Flip NONE", "FLIP_NONE"}, + {FLIP_HORIZONTAL, "Flip HORIZONTAL", "FLIP_HORIZONTAL"}, + {FLIP_VERTICAL, "Flip VERTICAL", "FLIP_VERTICAL"}, + {FLIP_BOTH, "Flip BOTH", "FLIP_BOTH"}, + {FLIP_NUM, NULL, NULL}, + }; + + if (!waylandsink_flip_type) { + waylandsink_flip_type = + g_enum_register_static ("GstWaylandSinkFlipType", flip_type); + } + + return waylandsink_flip_type; +} + +#endif /* signals */ enum @@ -72,7 +141,11 @@ enum PROP_0, PROP_DISPLAY, #ifdef GST_WLSINK_ENHANCEMENT - PROP_USE_TBM + PROP_USE_TBM, + PROP_ROTATE_ANGLE, + PROP_DISPLAY_GEOMETRY_METHOD, + PROP_ORIENTATION, + PROP_FLIP #endif }; int dump__cnt = 0; @@ -127,7 +200,10 @@ static void gst_wayland_sink_waylandvideo_init (GstWaylandVideoInterface * iface); static void gst_wayland_sink_begin_geometry_change (GstWaylandVideo * video); static void gst_wayland_sink_end_geometry_change (GstWaylandVideo * video); - +#ifdef GST_WLSINK_ENHANCEMENT +static void gst_wayland_sink_update_window_geometry (GstWaylandSink * sink); +static void render_last_buffer (GstWaylandSink * sink); +#endif #define gst_wayland_sink_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstWaylandSink, gst_wayland_sink, GST_TYPE_VIDEO_SINK, G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY, @@ -176,12 +252,40 @@ gst_wayland_sink_class_init (GstWaylandSinkClass * klass) g_param_spec_string ("display", "Wayland Display name", "Wayland " "display name to connect to, if not supplied via the GstContext", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - +#ifdef GST_WLSINK_ENHANCEMENT g_object_class_install_property (gobject_class, PROP_USE_TBM, g_param_spec_boolean ("use-tbm", "Use Tizen Buffer Memory insted of Shared memory", "When enabled, Memory is alloced by TBM insted of SHM ", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_ROTATE_ANGLE, + g_param_spec_enum ("rotate", "Rotate angle", + "Rotate angle of display output", + GST_TYPE_WAYLANDSINK_ROTATE_ANGLE, DEGREE_0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_DISPLAY_GEOMETRY_METHOD, + g_param_spec_enum ("display-geometry-method", "Display geometry method", + "Geometrical method for display", + GST_TYPE_WAYLANDSINK_DISPLAY_GEOMETRY_METHOD, + DEF_DISPLAY_GEOMETRY_METHOD, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_ORIENTATION, + g_param_spec_enum ("orientation", + "Orientation information used for ROI/ZOOM", + "Orientation information for display", + GST_TYPE_WAYLANDSINK_ROTATE_ANGLE, DEGREE_0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_FLIP, + g_param_spec_enum ("flip", "Display flip", + "Flip for display", + GST_TYPE_WAYLANDSINK_FLIP, DEF_DISPLAY_FLIP, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + +#endif } #ifdef DUMP_BUFFER @@ -204,7 +308,13 @@ static void gst_wayland_sink_init (GstWaylandSink * sink) { FUNCTION; +#ifdef GST_WLSINK_ENHANCEMENT sink->USE_TBM = TRUE; + sink->display_geometry_method = DEF_DISPLAY_GEOMETRY_METHOD; + sink->flip = DEF_DISPLAY_FLIP; + sink->rotate_angle = DEGREE_0; + sink->orientation = DEGREE_0; +#endif g_mutex_init (&sink->display_lock); g_mutex_init (&sink->render_lock); } @@ -226,6 +336,18 @@ gst_wayland_sink_get_property (GObject * object, case PROP_USE_TBM: g_value_set_boolean (value, sink->USE_TBM); break; + case PROP_ROTATE_ANGLE: + g_value_set_enum (value, sink->rotate_angle); + break; + case PROP_DISPLAY_GEOMETRY_METHOD: + g_value_set_enum (value, sink->display_geometry_method); + break; + case PROP_ORIENTATION: + g_value_set_enum (value, sink->orientation); + break; + case PROP_FLIP: + g_value_set_enum (value, sink->flip); + break; #endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -251,6 +373,64 @@ gst_wayland_sink_set_property (GObject * object, sink->USE_TBM = g_value_get_boolean (value); GST_LOG ("1:USE TBM 0: USE SHM set(%d)", sink->USE_TBM); break; + case PROP_ROTATE_ANGLE: + sink->rotate_angle = g_value_get_enum (value); + GST_WARNING_OBJECT (sink, "Rotate angle is set (%d)", sink->rotate_angle); + if (sink->window) { + gst_wl_window_set_rotate_angle (sink->window, sink->rotate_angle); + } + sink->video_info_changed = TRUE; + if (GST_STATE (sink) == GST_STATE_PAUSED) { + /*need to render last buffer */ + g_mutex_lock (&sink->render_lock); + render_last_buffer(sink); + g_mutex_unlock (&sink->render_lock); + } + break; + case PROP_DISPLAY_GEOMETRY_METHOD: + sink->display_geometry_method = g_value_get_enum (value); + GST_WARNING_OBJECT (sink, "Display geometry method is set (%d)", + sink->display_geometry_method); + if (sink->window) { + gst_wl_window_set_disp_geo_method (sink->window, + sink->display_geometry_method); + } + sink->video_info_changed = TRUE; + if (GST_STATE (sink) == GST_STATE_PAUSED) { + /*need to render last buffer */ + g_mutex_lock (&sink->render_lock); + render_last_buffer(sink); + g_mutex_unlock (&sink->render_lock); + } + break; + case PROP_ORIENTATION: + sink->orientation = g_value_get_enum (value); + GST_WARNING_OBJECT (sink, "Orientation is set (%d)", sink->orientation); + if (sink->window) { + gst_wl_window_set_orientation (sink->window, sink->orientation); + } + sink->video_info_changed = TRUE; + if (GST_STATE (sink) == GST_STATE_PAUSED) { + /*need to render last buffer */ + g_mutex_lock (&sink->render_lock); + render_last_buffer(sink); + g_mutex_unlock (&sink->render_lock); + } + break; + case PROP_FLIP: + sink->flip = g_value_get_enum (value); + GST_WARNING_OBJECT (sink, "flip is set (%d)", sink->flip); + if (sink->flip) { + gst_wl_window_set_flip (sink->window, sink->flip); + } + sink->video_info_changed = TRUE; + if (GST_STATE (sink) == GST_STATE_PAUSED) { + /*need to render last buffer */ + g_mutex_lock (&sink->render_lock); + render_last_buffer(sink); + g_mutex_unlock (&sink->render_lock); + } + break; #endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -768,6 +948,21 @@ static const struct wl_callback_listener frame_callback_listener = { frame_redraw_callback }; +#ifdef GST_WLSINK_ENHANCEMENT +static void +gst_wayland_sink_update_window_geometry (GstWaylandSink * sink) +{ + FUNCTION; + g_return_if_fail (sink != NULL); + g_return_if_fail (sink->window != NULL); + + gst_wl_window_set_rotate_angle (sink->window, sink->rotate_angle); + gst_wl_window_set_disp_geo_method (sink->window, + sink->display_geometry_method); + gst_wl_window_set_orientation (sink->window, sink->orientation); + gst_wl_window_set_flip (sink->window, sink->flip); +} +#endif /* must be called with the render lock */ static void render_last_buffer (GstWaylandSink * sink) @@ -790,7 +985,17 @@ render_last_buffer (GstWaylandSink * sink) info = &sink->video_info; sink->video_info_changed = FALSE; } +#ifdef GST_WLSINK_ENHANCEMENT + if(sink->last_buffer) + gst_wl_window_render (sink->window, wlbuffer, info); + else { + if (G_UNLIKELY (info)) { + gst_wl_window_set_video_info (sink->window, &info); + } + } +#else gst_wl_window_render (sink->window, wlbuffer, info); +#endif } static GstFlowReturn @@ -819,6 +1024,10 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer) gst_wl_window_new_toplevel (sink->display, &sink->video_info); } } +#ifdef GST_WLSINK_ENHANCEMENT + gst_wayland_sink_update_window_geometry (sink); + sink->video_info_changed = TRUE; +#endif /* drop buffers until we get a frame callback */ if (g_atomic_int_get (&sink->redraw_pending) == TRUE) goto done; @@ -1171,7 +1380,9 @@ gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle) "ignoring window handle"); } } - +#ifdef GST_WLSINK_ENHANCEMENT + gst_wayland_sink_update_window_geometry (sink); +#endif g_mutex_unlock (&sink->render_lock); } diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h index acea2cf..568be9f 100644 --- a/ext/wayland/gstwaylandsink.h +++ b/ext/wayland/gstwaylandsink.h @@ -43,6 +43,39 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAYLAND_SINK)) #define GST_WAYLAND_SINK_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass)) +#ifdef GST_WLSINK_ENHANCEMENT +enum +{ + DISP_GEO_METHOD_LETTER_BOX = 0, + DISP_GEO_METHOD_ORIGIN_SIZE, + DISP_GEO_METHOD_FULL_SCREEN, + DISP_GEO_METHOD_CROPPED_FULL_SCREEN, + DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX, + 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_FULL_SCREEN +#endif + typedef struct _GstWaylandSink GstWaylandSink; typedef struct _GstWaylandSinkClass GstWaylandSinkClass; @@ -66,6 +99,10 @@ struct _GstWaylandSink #ifdef GST_WLSINK_ENHANCEMENT gboolean USE_TBM; GstCaps *caps; + guint rotate_angle; + guint display_geometry_method; + guint orientation; + guint flip; #endif }; diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index 4c34b88..59a33ed 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -23,8 +23,11 @@ #ifdef HAVE_CONFIG_H #include #endif - +#ifdef GST_WLSINK_ENHANCEMENT +#include "gstwaylandsink.h" +#else #include "wlwindow.h" +#endif #include "wlshmallocator.h" #include "wlbuffer.h" @@ -297,11 +300,167 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit) /* center the video_subsurface inside area_subsurface */ src.w = window->video_width; src.h = window->video_height; +#ifdef GST_WLSINK_ENHANCEMENT // need to change ifndef to ifdef + + GstVideoRectangle src_origin = { 0, 0, 0, 0 }; + GstVideoRectangle src_input = { 0, 0, 0, 0 }; + GstVideoRectangle dst = { 0, 0, 0, 0 }; + + gint rotate = 0; + gint transform = WL_OUTPUT_TRANSFORM_NORMAL; + + src.x = src.y = 0; + src_input.w = src_origin.w = window->video_width; + src_input.h = src_origin.h = window->video_height; + GST_INFO ("video (%d x %d)", window->video_width, window->video_height); + GST_INFO ("src_input(%d, %d, %d x %d)", src_input.x, src_input.y, src_input.w, + src_input.h); + GST_INFO ("src_origin(%d, %d, %d x %d)", src_origin.x, src_origin.y, + src_origin.w, src_origin.h); + + if (window->rotate_angle == DEGREE_0 || window->rotate_angle == DEGREE_180) { + src.w = window->video_width; //video_width + src.h = window->video_height; //video_height + } else { + src.w = window->video_height; + src.h = window->video_width; + } + GST_INFO ("src(%d, %d, %d x %d)", src.x, src.y, src.w, src.h); + + /*default res.w and res.h */ + dst.w = window->render_rectangle.w; + dst.h = window->render_rectangle.h; + GST_INFO ("dst(%d,%d,%d x %d)", dst.x, dst.y, dst.w, dst.h); + GST_INFO ("window->render_rectangle(%d,%d,%d x %d)", + window->render_rectangle.x, window->render_rectangle.y, + window->render_rectangle.w, window->render_rectangle.h); + switch (window->disp_geo_method) { + case DISP_GEO_METHOD_LETTER_BOX: + GST_INFO ("DISP_GEO_METHOD_LETTER_BOX"); + gst_video_sink_center_rect (src, dst, &res, TRUE); + gst_video_sink_center_rect (dst, src, &src_input, FALSE); + res.x += window->render_rectangle.x; + res.y += window->render_rectangle.y; + break; + case DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX: + if (src.w > dst.w || src.h > dst.h) { + /*LETTER BOX */ + GST_INFO + ("DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX -> set LETTER BOX"); + gst_video_sink_center_rect (src, dst, &res, TRUE); + gst_video_sink_center_rect (dst, src, &src_input, FALSE); + res.x += window->render_rectangle.x; + res.y += window->render_rectangle.y; + } else { + /*ORIGIN SIZE */ + GST_INFO ("DISP_GEO_METHOD_ORIGIN_SIZE"); + gst_video_sink_center_rect (src, dst, &res, FALSE); + gst_video_sink_center_rect (dst, src, &src_input, FALSE); + } + break; + case DISP_GEO_METHOD_ORIGIN_SIZE: //is working + GST_INFO ("DISP_GEO_METHOD_ORIGIN_SIZE"); + gst_video_sink_center_rect (src, dst, &res, FALSE); + gst_video_sink_center_rect (dst, src, &src_input, FALSE); + break; + case DISP_GEO_METHOD_FULL_SCREEN: //is working + GST_INFO ("DISP_GEO_METHOD_FULL_SCREEN"); + res.x = res.y = 0; + res.w = window->render_rectangle.w; + res.h = window->render_rectangle.h; + break; + case DISP_GEO_METHOD_CROPPED_FULL_SCREEN: + GST_INFO ("DISP_GEO_METHOD_CROPPED_FULL_SCREEN"); + gst_video_sink_center_rect (src, dst, &res, FALSE); + gst_video_sink_center_rect (dst, src, &src_input, FALSE); + res.x = res.y = 0; + res.w = dst.w; + res.h = dst.h; + break; + default: + break; + } + + switch (window->rotate_angle) { + case DEGREE_0: + transform = WL_OUTPUT_TRANSFORM_NORMAL; + break; + case DEGREE_90: + transform = WL_OUTPUT_TRANSFORM_90; + break; + case DEGREE_180: + transform = WL_OUTPUT_TRANSFORM_180; + break; + case DEGREE_270: + transform = WL_OUTPUT_TRANSFORM_270; + break; + + default: + GST_ERROR ("Unsupported rotation [%d]... set DEGREE 0.", + window->rotate_angle); + break; + } + + switch (window->flip) { + case FLIP_NONE: + break; + case FLIP_VERTICAL: + transform = WL_OUTPUT_TRANSFORM_FLIPPED; + break; + case FLIP_HORIZONTAL: + transform = WL_OUTPUT_TRANSFORM_FLIPPED_180; + break; + case FLIP_BOTH: + transform = WL_OUTPUT_TRANSFORM_180; + break; + default: + GST_ERROR ("Unsupported flip [%d]... set FLIP_NONE.", window->flip); + } + + GST_INFO + ("window[%d x %d] src[%d,%d,%d x %d],dst[%d,%d,%d x %d],input[%d,%d,%d x %d],result[%d,%d,%d x %d]", + window->render_rectangle.w, window->render_rectangle.h, + src.x, src.y, src.w, src.h, + dst.x, dst.y, dst.w, dst.h, + src_input.x, src_input.y, src_input.w, src_input.h, + res.x, res.y, res.w, res.h); + + GST_INFO ("video (%d x %d)", window->video_width, window->video_height); + GST_INFO ("src_input(%d, %d, %d x %d)", src_input.x, src_input.y, src_input.w, + src_input.h); + GST_INFO ("src_origin(%d, %d, %d x %d)", src_origin.x, src_origin.y, + src_origin.w, src_origin.h); + GST_INFO ("src(%d, %d, %d x %d)", src.x, src.y, src.w, src.h); + GST_INFO ("dst(%d,%d,%d x %d)", dst.x, dst.y, dst.w, dst.h); + GST_INFO ("window->render_rectangle(%d,%d,%d x %d)", + window->render_rectangle.x, window->render_rectangle.y, + window->render_rectangle.w, window->render_rectangle.h); + GST_INFO ("res(%d, %d, %d x %d)", res.x, res.y, res.w, res.h); + + if (window->video_subsurface) { + GST_INFO ("have window->subsurface"); + wl_subsurface_set_position (window->video_subsurface, + window->render_rectangle.x + res.x, window->render_rectangle.y + res.y); + GST_INFO ("wl_subsurface_set_position(%d,%d)", + window->render_rectangle.x + res.x, window->render_rectangle.y + res.y); + } + wl_viewport_set_destination (window->video_viewport, res.w, res.h); + GST_INFO ("wl_viewport_set_destination(%d,%d)", res.w, res.h); + + wl_viewport_set_source (window->video_viewport, wl_fixed_from_int (src_input.x), + wl_fixed_from_int (src_input.y), wl_fixed_from_int (src_input.w), + wl_fixed_from_int (src_input.h)); + GST_INFO ("wl_viewport_set_source(%d,%d, %d x %d)", src_input.x, src_input.y, + src_input.w, src_input.h); + + wl_surface_set_buffer_transform (window->video_surface, transform); + GST_INFO ("wl_surface_set_buffer_transform (%d)", transform); +#else gst_video_sink_center_rect (src, window->render_rectangle, &res, TRUE); wl_subsurface_set_position (window->video_subsurface, res.x, res.y); wl_viewport_set_destination (window->video_viewport, res.w, res.h); - +#endif if (commit) { wl_surface_damage (window->video_surface, 0, 0, res.w, res.h); wl_surface_commit (window->video_surface); @@ -401,3 +560,54 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, if (window->video_width != 0) wl_subsurface_set_desync (window->video_subsurface); } +#ifdef GST_WLSINK_ENHANCEMENT +void +gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info) +{ + FUNCTION; + g_return_if_fail (window != NULL); + + window->video_width = + gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d); + window->video_height = info->height; + + if (window->render_rectangle.w != 0) + gst_wl_window_resize_video_surface (window, FALSE); +} +void +gst_wl_window_set_rotate_angle (GstWlWindow * window, guint rotate_angle) +{ + FUNCTION; + g_return_if_fail (window != NULL); + window->rotate_angle = rotate_angle; + GST_INFO ("rotate_angle value is (%d)", window->rotate_angle); +} + +void +gst_wl_window_set_disp_geo_method (GstWlWindow * window, guint disp_geo_method) +{ + FUNCTION; + g_return_if_fail (window != NULL); + window->disp_geo_method = disp_geo_method; + GST_INFO ("disp_geo_method value is (%d)", window->disp_geo_method); +} + +void +gst_wl_window_set_orientation (GstWlWindow * window, guint orientation) +{ + FUNCTION; + g_return_if_fail (window != NULL); + window->orientation = orientation; + GST_INFO ("orientation value is (%d)", window->orientation); +} + +void +gst_wl_window_set_flip (GstWlWindow * window, guint flip) +{ + FUNCTION; + g_return_if_fail (window != NULL); + window->flip = flip; + GST_INFO ("flip value is (%d)", window->flip); +} +#endif + diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h index c5777e0..2547408 100644 --- a/ext/wayland/wlwindow.h +++ b/ext/wayland/wlwindow.h @@ -49,6 +49,11 @@ struct _GstWlWindow struct wl_shell_surface *shell_surface; #ifdef GST_WLSINK_ENHANCEMENT struct tizen_video_object *video_object; +/*Display geometry method */ + guint disp_geo_method; + guint rotate_angle; + guint orientation; + guint flip; #endif /* the size and position of the area_(sub)surface */ @@ -79,6 +84,14 @@ void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, const GstVideoInfo * info); void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, gint w, gint h); +#ifdef GST_WLSINK_ENHANCEMENT +void gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info); +void gst_wl_window_set_rotate_angle (GstWlWindow * window, guint rotate_angle); +void gst_wl_window_set_disp_geo_method (GstWlWindow * window, + guint disp_geo_method); +void gst_wl_window_set_orientation (GstWlWindow * window, guint orientation); +void gst_wl_window_set_flip (GstWlWindow * window, guint flip); +#endif G_END_DECLS #endif /* __GST_WL_WINDOW_H__ */ -- 2.7.4