mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
libs: surface: egl: error message if no extension
Instead of silently fail to export the image if there is not available the EGL_MESA_drm_image, log an error message. Also a code refactoring was done. https://bugzilla.gnome.org/show_bug.cgi?id=773453
This commit is contained in:
parent
72362e1063
commit
ea503ed085
1 changed files with 20 additions and 12 deletions
|
@ -55,22 +55,30 @@ do_create_surface_with_egl_image_unlocked (GstVaapiDisplayEGL * display,
|
||||||
memset (offset, 0, sizeof (offset));
|
memset (offset, 0, sizeof (offset));
|
||||||
memset (stride, 0, sizeof (stride));
|
memset (stride, 0, sizeof (stride));
|
||||||
|
|
||||||
if (vtable->has_EGL_MESA_drm_image) {
|
if (!vtable->has_EGL_MESA_drm_image)
|
||||||
/* EGL_MESA_drm_image extension */
|
goto error_mission_extension;
|
||||||
if (!vtable->eglExportDRMImageMESA (ctx->display->base.handle.p, image,
|
|
||||||
&name, NULL, &stride[0]))
|
|
||||||
goto error_export_image_gem_buf;
|
|
||||||
|
|
||||||
size = height * stride[0];
|
/* EGL_MESA_drm_image extension */
|
||||||
return gst_vaapi_surface_new_with_gem_buf_handle (base_display, name, size,
|
if (!vtable->eglExportDRMImageMESA (ctx->display->base.handle.p, image,
|
||||||
format, width, height, offset, stride);
|
&name, NULL, &stride[0]))
|
||||||
}
|
goto error_export_image_gem_buf;
|
||||||
return NULL;
|
|
||||||
|
size = height * stride[0];
|
||||||
|
return gst_vaapi_surface_new_with_gem_buf_handle (base_display, name, size,
|
||||||
|
format, width, height, offset, stride);
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
error_export_image_gem_buf:
|
error_export_image_gem_buf:
|
||||||
GST_ERROR ("failed to export EGL image to GEM buffer");
|
{
|
||||||
return NULL;
|
GST_ERROR ("failed to export EGL image to GEM buffer");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_mission_extension:
|
||||||
|
{
|
||||||
|
GST_ERROR ("missing EGL_MESA_drm_image extension");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue