Skip to content

Commit

Permalink
opengl: interop: avoid generic interop with opaque
Browse files Browse the repository at this point in the history
The generic interop is designed for CPU buffers which are not available
anyway with GPU buffers (zero planes available). Avoid loading the
generic interop in that case.

Refs #25256
  • Loading branch information
alexandre-janniaux committed Nov 18, 2020
1 parent e13bc45 commit f367b9f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions modules/video_output/opengl/interop.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,28 @@ vlc_gl_interop_New(struct vlc_gl_t *gl, const struct vlc_gl_api *api,
vlc_object_delete(interop);
return NULL;
}

if (desc->plane_count == 0)
{
/* Opaque chroma: load a module to handle it */
interop->vctx = context;
interop->module = module_need_var(interop, "glinterop", "glinterop");
if (interop->module == NULL)
goto error;
}

int ret;
if (interop->module != NULL)
ret = VLC_SUCCESS;
else
{
/* Software chroma or gl hw converter failed: use a generic
* converter */
ret = opengl_interop_generic_init(interop, true);
}

if (ret != VLC_SUCCESS)
{
vlc_object_delete(interop);
return NULL;
/* No opengl interop module found: use a generic interop. */
int ret = opengl_interop_generic_init(interop, true);
if (ret != VLC_SUCCESS)
goto error;
}

return interop;

error:
vlc_object_delete(interop);
return NULL;
}

struct vlc_gl_interop *
Expand Down

0 comments on commit f367b9f

Please sign in to comment.