mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ximagesink: implement buffer_alloc from the pool
Use the bufferpool for pad_alloc when we are asked for the same caps as the bufferpool.
This commit is contained in:
parent
ea05fe1278
commit
e993bde873
1 changed files with 5 additions and 1 deletions
|
@ -420,6 +420,8 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
!gst_structure_get_int (structure, "height", &height))
|
!gst_structure_get_int (structure, "height", &height))
|
||||||
goto wrong_caps;
|
goto wrong_caps;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (pool, "%dx%d, caps %" GST_PTR_FORMAT, width, height, caps);
|
||||||
|
|
||||||
/* keep track of the width and height and caps */
|
/* keep track of the width and height and caps */
|
||||||
if (priv->caps)
|
if (priv->caps)
|
||||||
gst_caps_unref (priv->caps);
|
gst_caps_unref (priv->caps);
|
||||||
|
@ -489,6 +491,8 @@ gst_ximage_buffer_pool_new (GstXImageSink * ximagesink)
|
||||||
pool = g_object_new (GST_TYPE_XIMAGE_BUFFER_POOL, NULL);
|
pool = g_object_new (GST_TYPE_XIMAGE_BUFFER_POOL, NULL);
|
||||||
pool->sink = gst_object_ref (ximagesink);
|
pool->sink = gst_object_ref (ximagesink);
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (pool, "new XImage buffer pool %p", pool);
|
||||||
|
|
||||||
return GST_BUFFER_POOL_CAST (pool);
|
return GST_BUFFER_POOL_CAST (pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,7 +523,7 @@ gst_ximage_buffer_pool_finalize (GObject * object)
|
||||||
GstXImageBufferPool *pool = GST_XIMAGE_BUFFER_POOL_CAST (object);
|
GstXImageBufferPool *pool = GST_XIMAGE_BUFFER_POOL_CAST (object);
|
||||||
GstXImageBufferPoolPrivate *priv = pool->priv;
|
GstXImageBufferPoolPrivate *priv = pool->priv;
|
||||||
|
|
||||||
GST_LOG_OBJECT (pool->sink, "finalize XImage buffer pool");
|
GST_LOG_OBJECT (pool, "finalize XImage buffer pool %p", pool);
|
||||||
|
|
||||||
if (priv->caps)
|
if (priv->caps)
|
||||||
gst_caps_unref (priv->caps);
|
gst_caps_unref (priv->caps);
|
||||||
|
|
Loading…
Reference in a new issue