gldownload: improve logging of gl-dmabuf pool usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8938>
This commit is contained in:
parent
f9941b135f
commit
9f4f543bf7
@ -415,9 +415,19 @@ GstBufferPool *
|
||||
gst_gl_dmabuf_buffer_pool_new (GstGLContext * context,
|
||||
GstBufferPool * dmabuf_pool, GstCaps * dmabuf_caps)
|
||||
{
|
||||
GstGLDMABufBufferPool *pool;
|
||||
static gint pool_seq = 0;
|
||||
|
||||
pool = g_object_new (GST_TYPE_GL_DMABUF_BUFFER_POOL, NULL);
|
||||
GstGLDMABufBufferPool *pool;
|
||||
gchar *name;
|
||||
gchar *dmabuf_pool_name;
|
||||
|
||||
/* setting a significant unique name */
|
||||
dmabuf_pool_name = gst_object_get_name (GST_OBJECT (dmabuf_pool));
|
||||
name = g_strdup_printf ("%s:gldmabufpool%d",
|
||||
dmabuf_pool_name, g_atomic_int_add (&pool_seq, 1));
|
||||
g_clear_pointer (&dmabuf_pool_name, g_free);
|
||||
|
||||
pool = g_object_new (GST_TYPE_GL_DMABUF_BUFFER_POOL, "name", name, NULL);
|
||||
gst_object_ref_sink (pool);
|
||||
|
||||
GST_GL_BUFFER_POOL (pool)->context = gst_object_ref (context);
|
||||
@ -427,8 +437,10 @@ gst_gl_dmabuf_buffer_pool_new (GstGLContext * context,
|
||||
|
||||
gst_video_info_dma_drm_from_caps (&pool->priv->drm_info, dmabuf_caps);
|
||||
|
||||
GST_LOG_OBJECT (pool, "new GL-DMABuf buffer pool for pool %" GST_PTR_FORMAT
|
||||
" and context %" GST_PTR_FORMAT, dmabuf_pool, context);
|
||||
GST_INFO_OBJECT (pool, "new GL-DMABuf buffer pool %s with context "
|
||||
"%" GST_PTR_FORMAT, name, context);
|
||||
|
||||
g_clear_pointer (&name, g_free);
|
||||
|
||||
return GST_BUFFER_POOL_CAST (pool);
|
||||
}
|
||||
|
@ -1388,6 +1388,8 @@ gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt,
|
||||
*outbuf = wrapped_dmabuf;
|
||||
|
||||
return GST_FLOW_OK;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (dl, "could not unwrap dma-buf-backed GL buffer");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1493,6 +1495,8 @@ gst_gl_download_element_decide_allocation (GstBaseTransform * trans,
|
||||
|
||||
gst_query_parse_nth_allocation_pool (query, 0,
|
||||
&download->foreign_dmabuf_pool, NULL, NULL, NULL);
|
||||
GST_INFO_OBJECT (trans, "using foreign dmabuf pool %" GST_PTR_FORMAT,
|
||||
download->foreign_dmabuf_pool);
|
||||
download->foreign_dmabuf_caps = gst_caps_ref (caps);
|
||||
|
||||
gst_query_remove_nth_allocation_pool (query, 0);
|
||||
@ -1579,7 +1583,8 @@ gst_gl_download_element_propose_allocation (GstBaseTransform * bt,
|
||||
GST_GL_DOWNLOAD_ELEMENT (bt)->foreign_dmabuf_pool,
|
||||
GST_GL_DOWNLOAD_ELEMENT (bt)->foreign_dmabuf_caps);
|
||||
|
||||
GST_LOG_OBJECT (bt, "offering dma-buf-backed GL buffer pool");
|
||||
GST_INFO_OBJECT (bt,
|
||||
"offering dma-buf-backed GL buffer pool %" GST_PTR_FORMAT, pool);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user