[vlc-devel] [PATCH 1/4] vgl: provide a module to allow rendering in a user defined opengl context

Rémi Denis-Courmont remi at remlab.net
Tue Jul 3 18:09:00 CEST 2018


Le tiistaina 3. heinäkuuta 2018, 15.38.34 EEST Pierre Lamot a écrit :
>   This module aims to provide the same kind of functionnality as vmem but
> for opengl rendering.
> 
>   Users will have to provide different callbacks:
> 
>   * vgl-create-cb to create texture and other opengl resources
>   * vgl-destroy-cb to release resources created by vgl-create-cb
>   * vgl-render-cb that will be called before and after rending the current
> frame * vgl-make-current-cb to enter/leave the opengl context
>   * vgl-get-proc-address-cb to provide opengl functions
> 
>   Note that users will have to ensure synchronisation on their side since
>   VLC will run and render OpenGL in its own thread.
> ---
>  include/vlc_opengl.h                      |   9 ++
>  modules/video_output/Makefile.am          |   2 +
>  modules/video_output/opengl/vout_helper.c |  59 +++++++--
>  modules/video_output/vgl.c                | 145 ++++++++++++++++++++++
>  4 files changed, 203 insertions(+), 12 deletions(-)
>  create mode 100644 modules/video_output/vgl.c
> 
> diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
> index 57a1e71c3b..f9329c7675 100644
> --- a/include/vlc_opengl.h
> +++ b/include/vlc_opengl.h
> @@ -55,6 +55,7 @@ struct vlc_gl_t
>          VLC_GL_EXT_DEFAULT,
>          VLC_GL_EXT_EGL,
>          VLC_GL_EXT_WGL,
> +        VLC_GL_EXT_VGL,
>      } ext;
> 
>      union {
> @@ -74,6 +75,14 @@ struct vlc_gl_t
>          {
>              const char *(*getExtensionsString)(vlc_gl_t *);
>          } wgl;
> +        /* if ext == VLC_GL_EXT_VGL */
> +        struct
> +        {
> +            void (*createCb)(void *p_opaque, size_t width, size_t height);
> +            void (*destroyCb)(void *p_opaque);

I don't really see why this needs to be exposed here. Virtualized plugins 
generally call the initialization and deinitialization callbacks in-situ.

In fact, it looks like breaking the existing abstraction.

> +            void (*renderCb)(void *p_opaque, bool enter);
> +            void *p_opaque;
> +        } vgl;
>      };
>  };
> 

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list