mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
gl/dmabuf: add some debug logging about why things may fail to be uploaded
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1145>
This commit is contained in:
parent
42597181e2
commit
ee1255079b
1 changed files with 30 additions and 9 deletions
|
@ -639,21 +639,31 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!gst_gl_context_check_feature (dmabuf->upload->context,
|
if (!gst_gl_context_check_feature (dmabuf->upload->context,
|
||||||
"EGL_KHR_image_base"))
|
"EGL_KHR_image_base")) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "no EGL_KHR_image_base extension");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (dmabuf->target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES &&
|
if (dmabuf->target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES &&
|
||||||
!gst_gl_context_check_feature (dmabuf->upload->context,
|
!gst_gl_context_check_feature (dmabuf->upload->context,
|
||||||
"GL_OES_EGL_image_external"))
|
"GL_OES_EGL_image_external")) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload,
|
||||||
|
"no EGL_KHR_image_base_external extension");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* This will eliminate most non-dmabuf out there */
|
/* This will eliminate most non-dmabuf out there */
|
||||||
if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0)))
|
if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0))) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "input not dmabuf");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* We cannot have multiple dmabuf per plane */
|
/* We cannot have multiple dmabuf per plane */
|
||||||
if (n_mem > n_planes)
|
if (n_mem > n_planes) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload,
|
||||||
|
"number of memory (%u) != number of planes (%u)", n_mem, n_planes);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Update video info based on video meta */
|
/* Update video info based on video meta */
|
||||||
if (meta) {
|
if (meta) {
|
||||||
|
@ -690,18 +700,25 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
|
||||||
plane_size = gst_gl_get_plane_data_size (in_info, NULL, i);
|
plane_size = gst_gl_get_plane_data_size (in_info, NULL, i);
|
||||||
|
|
||||||
if (!gst_buffer_find_memory (buffer, in_info->offset[i], plane_size,
|
if (!gst_buffer_find_memory (buffer, in_info->offset[i], plane_size,
|
||||||
&mem_idx, &length, &mem_skip))
|
&mem_idx, &length, &mem_skip)) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "could not find memory %u", i);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* We can't have more then one dmabuf per plane */
|
/* We can't have more then one dmabuf per plane */
|
||||||
if (length != 1)
|
if (length != 1) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "data for plane %u spans %u memories",
|
||||||
|
i, length);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
mems[i] = gst_buffer_peek_memory (buffer, mem_idx);
|
mems[i] = gst_buffer_peek_memory (buffer, mem_idx);
|
||||||
|
|
||||||
/* And all memory found must be dmabuf */
|
/* And all memory found must be dmabuf */
|
||||||
if (!gst_is_dmabuf_memory (mems[i]))
|
if (!gst_is_dmabuf_memory (mems[i])) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "memory %u is not dmabuf", i);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
offset[i] = mems[i]->offset + mem_skip;
|
offset[i] = mems[i]->offset + mem_skip;
|
||||||
fd[i] = gst_dmabuf_memory_get_fd (mems[i]);
|
fd[i] = gst_dmabuf_memory_get_fd (mems[i]);
|
||||||
|
@ -711,8 +728,10 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
|
||||||
/* Check if this format is supported by the driver */
|
/* Check if this format is supported by the driver */
|
||||||
dmabuf->n_mem = 1;
|
dmabuf->n_mem = 1;
|
||||||
if (!gst_egl_image_check_dmabuf_direct (dmabuf->upload->context, in_info,
|
if (!gst_egl_image_check_dmabuf_direct (dmabuf->upload->context, in_info,
|
||||||
dmabuf->target))
|
dmabuf->target)) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "direct check failed");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
dmabuf->n_mem = n_planes;
|
dmabuf->n_mem = n_planes;
|
||||||
|
|
||||||
|
@ -736,8 +755,10 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
|
||||||
dmabuf->eglimage[i] = gst_egl_image_from_dmabuf (dmabuf->upload->context,
|
dmabuf->eglimage[i] = gst_egl_image_from_dmabuf (dmabuf->upload->context,
|
||||||
fd[i], in_info, i, offset[i]);
|
fd[i], in_info, i, offset[i]);
|
||||||
|
|
||||||
if (!dmabuf->eglimage[i])
|
if (!dmabuf->eglimage[i]) {
|
||||||
|
GST_DEBUG_OBJECT (dmabuf->upload, "could not create eglimage");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
_set_cached_eglimage (mems[i], dmabuf->eglimage[i], cache_id);
|
_set_cached_eglimage (mems[i], dmabuf->eglimage[i], cache_id);
|
||||||
dmabuf->formats[i] = dmabuf->eglimage[i]->format;
|
dmabuf->formats[i] = dmabuf->eglimage[i]->format;
|
||||||
|
|
Loading…
Reference in a new issue