The reference to the sink is not really needed anyway in waylandpool,
what matters basically is that the display is active as long as the
pool is active, so we really want to reference the display object
instead of the sink.
size = info.size;
/* create a new pool for the new configuration */
size = info.size;
/* create a new pool for the new configuration */
- newpool = gst_wayland_buffer_pool_new (sink);
+ newpool = gst_wayland_buffer_pool_new (sink->display);
if (!newpool) {
GST_DEBUG_OBJECT (sink, "Failed to create new pool");
if (!newpool) {
GST_DEBUG_OBJECT (sink, "Failed to create new pool");
goto invalid_caps;
GST_DEBUG_OBJECT (sink, "create new pool");
goto invalid_caps;
GST_DEBUG_OBJECT (sink, "create new pool");
- pool = gst_wayland_buffer_pool_new (sink);
+ pool = gst_wayland_buffer_pool_new (sink->display);
/* the normal size of a frame */
size = info.size;
/* the normal size of a frame */
size = info.size;
meta = gst_buffer_get_wl_meta (buffer);
meta = gst_buffer_get_wl_meta (buffer);
- if (meta && meta->sink == sink) {
+ if (meta && meta->display == sink->display) {
GST_LOG_OBJECT (sink, "buffer %p from our pool, writing directly", buffer);
to_render = buffer;
} else {
GST_LOG_OBJECT (sink, "buffer %p from our pool, writing directly", buffer);
to_render = buffer;
} else {
static void
gst_wl_meta_free (GstWlMeta * meta, GstBuffer * buffer)
{
static void
gst_wl_meta_free (GstWlMeta * meta, GstBuffer * buffer)
{
- gst_object_unref (meta->sink);
+ g_object_unref (meta->display);
munmap (meta->data, meta->size);
wl_buffer_destroy (meta->wbuffer);
}
munmap (meta->data, meta->size);
wl_buffer_destroy (meta->wbuffer);
}
if (pool->wl_pool)
gst_wayland_buffer_pool_stop (GST_BUFFER_POOL (pool));
if (pool->wl_pool)
gst_wayland_buffer_pool_stop (GST_BUFFER_POOL (pool));
- gst_object_unref (pool->sink);
+ g_object_unref (pool->display);
G_OBJECT_CLASS (gst_wayland_buffer_pool_parent_class)->finalize (object);
}
G_OBJECT_CLASS (gst_wayland_buffer_pool_parent_class)->finalize (object);
}
- self->wl_pool =
- wl_shm_create_pool (self->sink->display->shm,
- fd, size);
+ self->wl_pool = wl_shm_create_pool (self->display->shm, fd, size);
close (fd);
self->size = size;
close (fd);
self->size = size;
/* create buffer and its metadata object */
*buffer = gst_buffer_new ();
meta = (GstWlMeta *) gst_buffer_add_meta (*buffer, GST_WL_META_INFO, NULL);
/* create buffer and its metadata object */
*buffer = gst_buffer_new ();
meta = (GstWlMeta *) gst_buffer_add_meta (*buffer, GST_WL_META_INFO, NULL);
- meta->sink = gst_object_ref (self->sink);
+ meta->display = g_object_ref (self->display);
meta->wbuffer = wl_shm_pool_create_buffer (self->wl_pool, offset,
width, height, stride, format);
meta->data = data;
meta->wbuffer = wl_shm_pool_create_buffer (self->wl_pool, offset,
width, height, stride, format);
meta->data = data;
-gst_wayland_buffer_pool_new (GstWaylandSink * waylandsink)
+gst_wayland_buffer_pool_new (GstWlDisplay * display)
{
GstWaylandBufferPool *pool;
{
GstWaylandBufferPool *pool;
- g_return_val_if_fail (GST_IS_WAYLAND_SINK (waylandsink), NULL);
+ g_return_val_if_fail (GST_IS_WL_DISPLAY (display), NULL);
pool = g_object_new (GST_TYPE_WAYLAND_BUFFER_POOL, NULL);
pool = g_object_new (GST_TYPE_WAYLAND_BUFFER_POOL, NULL);
- pool->sink = gst_object_ref (waylandsink);
+ pool->display = g_object_ref (display);
return GST_BUFFER_POOL_CAST (pool);
}
return GST_BUFFER_POOL_CAST (pool);
}
#include <gst/video/video.h>
#include <gst/video/gstvideometa.h>
#include <gst/video/video.h>
#include <gst/video/gstvideometa.h>
-#include "gstwaylandsink.h"
struct _GstWlMeta {
GstMeta meta;
struct _GstWlMeta {
GstMeta meta;
struct wl_buffer *wbuffer;
void *data;
struct wl_buffer *wbuffer;
void *data;
struct _GstWaylandBufferPool
{
GstBufferPool bufferpool;
struct _GstWaylandBufferPool
{
GstBufferPool bufferpool;
/* external configuration */
GstVideoInfo info;
/* external configuration */
GstVideoInfo info;
GType gst_wayland_buffer_pool_get_type (void);
GType gst_wayland_buffer_pool_get_type (void);
-GstBufferPool *gst_wayland_buffer_pool_new (GstWaylandSink * waylandsink);
+GstBufferPool *gst_wayland_buffer_pool_new (GstWlDisplay * display);