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");
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;
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 {
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);
}
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);
}
return FALSE;
}
- 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;
/* 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;
}
GstBufferPool *
-gst_wayland_buffer_pool_new (GstWaylandSink * waylandsink)
+gst_wayland_buffer_pool_new (GstWlDisplay * display)
{
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->sink = gst_object_ref (waylandsink);
+ pool->display = g_object_ref (display);
return GST_BUFFER_POOL_CAST (pool);
}
#include <gst/video/video.h>
#include <gst/video/gstvideometa.h>
-#include "gstwaylandsink.h"
+#include "wldisplay.h"
G_BEGIN_DECLS
struct _GstWlMeta {
GstMeta meta;
- GstWaylandSink *sink;
+ GstWlDisplay *display;
struct wl_buffer *wbuffer;
void *data;
struct _GstWaylandBufferPool
{
GstBufferPool bufferpool;
- GstWaylandSink *sink;
+ GstWlDisplay *display;
/* external configuration */
GstVideoInfo info;
GType gst_wayland_buffer_pool_get_type (void);
-GstBufferPool *gst_wayland_buffer_pool_new (GstWaylandSink * waylandsink);
+GstBufferPool *gst_wayland_buffer_pool_new (GstWlDisplay * display);
G_END_DECLS