GST_DEBUG_OBJECT (sink, "window geometry changed to (%d, %d) %d x %d",
x, y, w, h);
- gst_wl_window_set_render_rectangle (sink->window, x, y, w, h);
-
+ if (gst_wl_window_set_render_rectangle (sink->window, x, y, w, h)) {
+ sink->video_info_changed = TRUE;
+ if (sink->window && GST_STATE (sink) == GST_STATE_PAUSED)
+ gst_wayland_sink_update_last_buffer_geometry (sink);
+ }
g_mutex_unlock (&sink->render_lock);
}
}
/*set tizen destination mode */
- if (window->disp_geo_method.changed) {
+ if (window->disp_geo_method.changed || window->roi_area_changed) {
int tizen_disp_mode = -1;
switch (window->disp_geo_method.value) {
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->roi_area_changed = FALSE;
}
window->disp_geo_method.changed = FALSE;
}
#endif
}
-void
+#if TIZEN_FEATURE_WLSINK_ENHANCEMENT
+gboolean
gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
gint w, gint h)
{
-#if TIZEN_FEATURE_WLSINK_ENHANCEMENT
FUNCTION;
- g_return_if_fail (window != NULL);
+ g_return_val_if_fail (window != NULL, FALSE);
if (window->disp_geo_method.value != DISP_GEO_METHOD_CUSTOM_ROI) {
GST_ERROR
("must be set display-geometry-method to DISP_GEO_METHOD_CUSTOM_ROI before setting render rectangle()");
- return;
+ return FALSE;
}
if (w < 0 || h < 0) {
GST_ERROR ("Error : wrong roi size w(%d), h(%d)", w, h);
- return;
+ return FALSE;
}
window->roi.x = x;
window->roi.w = w;
window->roi.h = h;
GST_LOG ("set roi x(%d), y(%d), w(%d), h(%d)", x, y, w, h);
+ window->roi_area_changed = TRUE;
- return;
-
+ return TRUE;
+}
#else /* open source */
+void
+gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
+ gint w, gint h)
+{
g_return_if_fail (window != NULL);
if (window->video_width != 0)
wl_subsurface_set_desync (window->video_subsurface);
-#endif
}
+#endif
#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT
void
WinGeometryRange mode_align;
#endif
GstVideoRectangle roi;
+ gboolean roi_area_changed;
#endif
/* the size and position of the area_(sub)surface */
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 TIZEN_FEATURE_WLSINK_ENHANCEMENT
+gboolean gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
+ gint w, gint h);
void gst_wl_window_set_video_info (GstWlWindow * window,
const GstVideoInfo * info);
void gst_wl_window_set_rotate_angle (GstWlWindow * window, guint rotate_angle);
void gst_wl_window_set_destination_mode_align (GstWlWindow * window, gdouble w, gdouble h);
#endif
void gst_wl_window_set_video_info_change (GstWlWindow * window, guint changed);
+#else
+void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
+ gint w, gint h);
#endif
G_END_DECLS