static void gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc);
/* Called when a buffer is returned from the pipeline */
-static void
+static gboolean
gst_ximage_src_return_buf (GstXImageSrc * ximagesrc, GstBuffer * ximage)
{
GstMetaXImage *meta = GST_META_XIMAGE_GET (ximage);
+ /* True will make dispose free the buffer, while false will keep it */
+ gboolean ret = TRUE;
/* If our geometry changed we can't reuse that image. */
if ((meta->width != ximagesrc->width) || (meta->height != ximagesrc->height)) {
GST_BUFFER_FLAGS (GST_BUFFER (ximage)) = 0; /* clear out any flags from the previous use */
ximagesrc->buffer_pool = g_slist_prepend (ximagesrc->buffer_pool, ximage);
g_mutex_unlock (&ximagesrc->pool_lock);
+ ret = FALSE;
}
+
+ return ret;
}
static Window
GST_DEBUG ("set xcontext PAR to %d/%d\n", xcontext->par_n, xcontext->par_d);
}
-static void
+static gboolean
gst_ximagesrc_buffer_dispose (GstBuffer * ximage)
{
GstElement *parent;
GstMetaXImage *meta;
+ gboolean ret = TRUE;
g_return_if_fail (ximage != NULL);
}
if (meta->return_func)
- meta->return_func (parent, ximage);
+ ret = meta->return_func (parent, ximage);
beach:
- return;
+ return ret;
}
void
/* custom ximagesrc buffer, copied from ximagesink */
/* BufferReturnFunc is called when a buffer is finalised */
-typedef void (*BufferReturnFunc) (GstElement *parent, GstBuffer *buf);
+typedef gboolean (*BufferReturnFunc) (GstElement *parent, GstBuffer *buf);
/**
* GstMetaXImage: