And refer to the function calls for CUDA processing:
static bool
cuda_postprocess(context_t *ctx, int fd)
{
if (ctx->enable_cuda)
{
/* Create EGLImage from dmabuf fd */
ctx->egl_image = NvEGLImageFromFd(ctx->egl_display, fd);
if (ctx->egl_image == NULL)
ERROR_RETURN("Failed to map dmabuf fd (0x%X) to EGLImage",
ctx->render_dmabuf_fd);
/* Pass this buffer hooked on this egl_image to CUDA for
CUDA processing - draw a rectangle on the frame */
HandleEGLImage(&ctx->egl_image);
/* Destroy EGLImage */
NvDestroyEGLImage(ctx->egl_display, ctx->egl_image);
ctx->egl_image = NULL;
}
return true;
}