if (GST_STATE (sink) == GST_STATE_PAUSED) {
/*need to render last buffer */
g_mutex_lock (&sink->render_lock);
- render_last_buffer(sink);
+ render_last_buffer (sink);
g_mutex_unlock (&sink->render_lock);
}
break;
if (GST_STATE (sink) == GST_STATE_PAUSED) {
/*need to render last buffer */
g_mutex_lock (&sink->render_lock);
- render_last_buffer(sink);
+ render_last_buffer (sink);
g_mutex_unlock (&sink->render_lock);
}
break;
if (GST_STATE (sink) == GST_STATE_PAUSED) {
/*need to render last buffer */
g_mutex_lock (&sink->render_lock);
- render_last_buffer(sink);
+ render_last_buffer (sink);
g_mutex_unlock (&sink->render_lock);
}
break;
if (GST_STATE (sink) == GST_STATE_PAUSED) {
/*need to render last buffer */
g_mutex_lock (&sink->render_lock);
- render_last_buffer(sink);
+ render_last_buffer (sink);
g_mutex_unlock (&sink->render_lock);
}
break;
sink->video_info_changed = FALSE;
}
#ifdef GST_WLSINK_ENHANCEMENT
- if(sink->last_buffer)
+ if (sink->last_buffer)
gst_wl_window_render (sink->window, wlbuffer, info);
else {
if (G_UNLIKELY (info)) {
gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
{
FUNCTION;
+#if GST_WLSINK_ENHANCEMENT /* use unique_id */
GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
- struct wl_surface *surface = (struct wl_surface *) handle;
-
g_return_if_fail (sink != NULL);
-#ifdef GST_WLSINK_ENHANCEMENT
+
if (sink->window != NULL) {
GST_WARNING_OBJECT (sink, "changing window handle is not supported");
return;
}
-#endif
+ g_mutex_lock (&sink->render_lock);
+ g_clear_object (&sink->window);
+
+ GST_INFO ("parent_id %d %p", (int) handle, handle);
+
+ if (handle) {
+ if (G_LIKELY (gst_wayland_sink_find_display (sink))) {
+ /* we cannot use our own display with an external window handle */
+ if (G_UNLIKELY (sink->display->own_display)) {
+ sink->display->parent_id = (int) handle;
+ GST_INFO ("parent_id %d", sink->display->parent_id);
+ //GST_DEBUG_OBJECT (sink, "Setting parent id %d", handle);
+ sink->window = gst_wl_window_new_in_surface (sink->display, NULL);
+ }
+ } else {
+ GST_ERROR_OBJECT (sink, "Failed to find display handle, "
+ "ignoring window handle");
+ }
+ }
+ gst_wayland_sink_update_window_geometry (sink);
+
+ g_mutex_unlock (&sink->render_lock);
+
+
+#else
+ GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
+ struct wl_surface *surface = (struct wl_surface *) handle;
+
+ g_return_if_fail (sink != NULL);
+
g_mutex_lock (&sink->render_lock);
GST_DEBUG_OBJECT (sink, "Setting window handle %" GST_PTR_FORMAT,
if (G_LIKELY (gst_wayland_sink_find_display (sink))) {
/* we cannot use our own display with an external window handle */
if (G_UNLIKELY (sink->display->own_display)) {
-#ifdef GST_WLSINK_ENHANCEMENT
- GST_ELEMENT_WARNING (sink, RESOURCE, OPEN_READ_WRITE,
- ("Application did not provide a wayland display handle"),
- ("Now waylandsink use internal display handle "
- "which is created ourselves. Consider providing a "
- "display handle from your application with GstContext"));
-#else
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_READ_WRITE,
("waylandsink cannot use an externally-supplied surface without "
"an externally-supplied display handle. Consider providing a "
"display handle from your application with GstContext"));
-#endif
} else {
sink->window = gst_wl_window_new_in_surface (sink->display, surface);
}
"ignoring window handle");
}
}
-#ifdef GST_WLSINK_ENHANCEMENT
- gst_wayland_sink_update_window_geometry (sink);
-#endif
g_mutex_unlock (&sink->render_lock);
+
+#endif /* use unique_id */
}
static void
if (display->need_shell_surface) {
window->shell_surface = wl_shell_get_shell_surface (display->shell,
window->area_surface);
- }
- if (display->use_parent_wl_surface && parent != NULL) {
+ } else if (display->use_parent_wl_surface) {
+#ifdef GST_WLSINK_ENHANCEMENT
+ GST_INFO("call tizen_policy_get_subsurface");
window->area_subsurface =
- wl_subcompositor_get_subsurface (display->subcompositor,
- window->area_surface, parent);
+ tizen_policy_get_subsurface (display->tizen_policy,
+ window->area_surface, display->parent_id);
wl_subsurface_set_desync (window->area_subsurface);
+ wl_surface_commit (window->area_surface);
+#else
+ window->area_subsurface =
+ wl_subcompositor_get_subsurface (display->subcompositor,
+ window->area_surface, parent);
+ wl_subsurface_set_desync (window->area_subsurface);
+#endif
}
#endif
wl_subcompositor_get_subsurface (display->subcompositor,
window->video_surface, window->area_surface);
wl_subsurface_set_desync (window->video_subsurface);
+ wl_surface_commit (window->video_surface);
window->area_viewport = wl_scaler_get_viewport (display->scaler,
window->area_surface);
GstWlWindow *window;
display->use_parent_wl_surface = TRUE;
+#ifdef GST_WLSINK_ENHANCEMENT
+ window = gst_wl_window_new_internal (display, NULL);
+#else
window = gst_wl_window_new_internal (display, parent);
+#endif
-#if 0
+#if 0 /*for enlightment */
/* embed in parent */
window->area_subsurface =
wl_subcompositor_get_subsurface (display->subcompositor,
#ifdef GST_WLSINK_ENHANCEMENT
/*Area surface from App need to be under parent surface */
if (display->tizen_policy) {
+ GST_INFO(" call tizen_policy_place_subsurface_below_parent ");
tizen_policy_place_subsurface_below_parent (display->tizen_policy,
window->area_subsurface);
tizen_policy_place_subsurface_below_parent (display->tizen_policy,
window->video_subsurface);
}
+#else
wl_surface_commit (parent);
#endif
return window;
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));
+ 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_damage (window->video_surface, 0, 0, window->surface_width,
window->surface_height);
#ifdef GST_WLSINK_ENHANCEMENT
- GST_LOG("update area width %d, height %d", window->surface_width, window->surface_height);
+ GST_LOG ("update area width %d, height %d", window->surface_width,
+ window->surface_height);
#endif
/* wl_surface_commit change surface state, if wl_buffer is not attached newly, then surface is not changed */
wl_surface_commit (window->video_surface);
/* commit also the parent (area_surface) in order to change
* the position of the video_subsurface */
#ifdef GST_WLSINK_ENHANCEMENT
- GST_DEBUG("render_rectangle %d*%d", window->render_rectangle.w, window->render_rectangle.h);
+ GST_DEBUG ("render_rectangle %d*%d", window->render_rectangle.w,
+ window->render_rectangle.h);
#endif
wl_surface_damage (window->area_surface, 0, 0, window->render_rectangle.w,
window->render_rectangle.h);
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)
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)
{
GST_INFO ("flip value is (%d)", window->flip);
}
#endif
-