From c3c2e70a225d56def6cfa625b88c4c08cc6ac76d Mon Sep 17 00:00:00 2001 From: Hyunil Date: Thu, 10 Sep 2015 10:38:10 +0900 Subject: [PATCH] Waylandsink : modify input argument of gst_wayland_buffer_pool_remove_displaying_buffer Change-Id: Ib75439b799da9d0e85c3ec5d6e31633e381ac740 Signed-off-by: Hyunil --- ext/wayland/waylandpool.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/ext/wayland/waylandpool.c b/ext/wayland/waylandpool.c index ee6457c..82d499e 100755 --- a/ext/wayland/waylandpool.c +++ b/ext/wayland/waylandpool.c @@ -105,8 +105,7 @@ static gboolean gst_wayland_tizen_buffer_pool_stop (GstBufferPool * pool); static GstFlowReturn gst_wayland_tizen_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, GstBufferPoolAcquireParams * params); void gst_wayland_buffer_pool_remove_displaying_buffer (GstWaylandBufferPool * - self, GstWlMeta * meta, struct wl_buffer *wl_buffer); - + self, struct wl_buffer *wl_buffer); #endif #define gst_wayland_buffer_pool_parent_class parent_class @@ -179,17 +178,18 @@ buffer_release (void *data, struct wl_buffer *wl_buffer) GstWlMeta *meta; g_mutex_lock (&self->buffers_map_mutex); -#ifdef GST_WLSINK_ENHANCEMENT - buffer = g_hash_table_lookup (self->buffers_map, wl_buffer); - if (buffer) { - meta = gst_buffer_get_wl_meta (buffer); - } +#ifdef GST_WLSINK_ENHANCEMENT /*remove displaying buffer */ - gst_wayland_buffer_pool_remove_displaying_buffer (self, meta, wl_buffer); + if (self->display->is_native_format == TRUE) + gst_wayland_buffer_pool_remove_displaying_buffer (self, wl_buffer); +#endif + buffer = g_hash_table_lookup (self->buffers_map, wl_buffer); GST_LOG_OBJECT (self, "wl_buffer::release (GstBuffer: %p)", buffer); - if (meta) { + + if (buffer) { + meta = gst_buffer_get_wl_meta (buffer); if (meta->used_by_compositor) { meta->used_by_compositor = FALSE; /* unlock before unref because stop() may be called from here */ @@ -197,19 +197,6 @@ buffer_release (void *data, struct wl_buffer *wl_buffer) gst_buffer_unref (buffer); } } - #else - GST_LOG_OBJECT (self, "wl_buffer::release (GstBuffer: %p)", buffer); - - if (buffer) { - meta = gst_buffer_get_wl_meta (buffer); - if (meta->used_by_compositor) { - meta->used_by_compositor = FALSE; - /* unlock before unref because stop() may be called from here */ - GST_LOG_OBJECT (self, "Decrease ref count of buffer"); - gst_buffer_unref (buffer); - } - } - #endif g_mutex_unlock (&self->buffers_map_mutex); } @@ -731,11 +718,10 @@ gst_wayland_buffer_pool_add_displaying_buffer (GstBufferPool * pool, void gst_wayland_buffer_pool_remove_displaying_buffer (GstWaylandBufferPool * self, - GstWlMeta * meta, struct wl_buffer *wl_buffer) + struct wl_buffer *wl_buffer) { FUNCTION_ENTER (); g_return_val_if_fail (self, NULL); - g_return_val_if_fail (meta, NULL); g_return_val_if_fail (wl_buffer, NULL); GstBuffer *buffer; @@ -743,7 +729,7 @@ gst_wayland_buffer_pool_remove_displaying_buffer (GstWaylandBufferPool * self, buffer = g_hash_table_lookup (self->displaying_buffers_map, wl_buffer); if (buffer) { GST_LOG_OBJECT (self, "Decrease ref count of buffer(%p) from omx", buffer); - g_hash_table_remove (self->displaying_buffers_map, meta->wbuffer); + g_hash_table_remove (self->displaying_buffers_map, wl_buffer); gst_buffer_unref (buffer); } g_mutex_unlock (&self->displaying_buffers_map_mutex); -- 2.7.4