From 5d115ef5ee0383ea825742c40b7b189b3d89a0ee Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 8 Sep 2015 17:41:10 +0900 Subject: [PATCH] Waylandsink : Add rendering current wl_buffer for the changed geometory value Change-Id: I00a7a23918829331fde302f7c99137306dd6f77f Signed-off-by: Hyunil --- ext/wayland/gstwaylandsink.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 34cd0f5..14b9102 100755 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -196,6 +196,9 @@ 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); +static void gst_wayland_sink_render_last_buffer (GstWaylandSink * sink); + #endif #define gst_wayland_sink_parent_class parent_class @@ -345,7 +348,8 @@ gst_wayland_sink_set_property (GObject * object, } sink->video_info_changed = TRUE; if (GST_STATE (sink) == GST_STATE_PAUSED) { - /*need to render current buffer */ + /*need to render last buffer */ + gst_wayland_sink_render_last_buffer (sink); } break; case PROP_DISPLAY_GEOMETRY_METHOD: @@ -358,7 +362,8 @@ gst_wayland_sink_set_property (GObject * object, } sink->video_info_changed = TRUE; if (GST_STATE (sink) == GST_STATE_PAUSED) { - /*need to render current buffer */ + /*need to render last buffer */ + gst_wayland_sink_render_last_buffer (sink); } break; case PROP_ORIENTATION: @@ -369,7 +374,8 @@ gst_wayland_sink_set_property (GObject * object, } sink->video_info_changed = TRUE; if (GST_STATE (sink) == GST_STATE_PAUSED) { - /*need to render current buffer */ + /*need to render last buffer */ + gst_wayland_sink_render_last_buffer (sink); } break; case PROP_FLIP: @@ -380,7 +386,8 @@ gst_wayland_sink_set_property (GObject * object, } sink->video_info_changed = TRUE; if (GST_STATE (sink) == GST_STATE_PAUSED) { - /*need to render current buffer */ + /*need to render last buffer */ + gst_wayland_sink_render_last_buffer (sink); } break; #endif @@ -975,7 +982,6 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer) if (G_UNLIKELY (sink->video_info_changed)) { gst_wl_window_set_video_info (sink->window, &sink->video_info); sink->video_info_changed = FALSE; - } GST_INFO ("window->render_rectangle(%d,%d %d x %d)", sink->window->render_rectangle.x, @@ -1216,9 +1222,8 @@ static void gst_wayland_sink_update_window_geometry (GstWaylandSink * sink) { FUNCTION_ENTER (); - - if (sink == NULL || sink->window == NULL) - return; + 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, @@ -1226,6 +1231,20 @@ gst_wayland_sink_update_window_geometry (GstWaylandSink * sink) gst_wl_window_set_orientation (sink->window, sink->orientation); gst_wl_window_set_flip (sink->window, sink->flip); } + +static void +gst_wayland_sink_render_last_buffer (GstWaylandSink * sink) +{ + FUNCTION_ENTER (); + g_return_if_fail (sink != NULL); + + g_mutex_lock (&sink->render_lock); + gst_wl_window_set_video_info (sink->window, &sink->video_info); + sink->video_info_changed = FALSE; + if (sink->last_buffer) + render_last_buffer (sink); + g_mutex_unlock (&sink->render_lock); +} #endif static void gst_wayland_sink_set_render_rectangle (GstVideoOverlay * overlay, -- 2.7.4