[vlc-devel] [PATCH 2/2] opengl: split into convenience library

Alexandre Janniaux ajanni at videolabs.io
Thu Jun 25 11:11:02 CEST 2020


Hi,

Missing the move of libm to libvlc_opengl, I fixed it locally.

Regards,
--
Alexandre Janniaux
Videolabs

On Wed, Jun 24, 2020 at 07:12:23PM +0200, Alexandre Janniaux wrote:
> Create a libvlc_opengl and libvlc_opengles library that are built only
> if one other target is needing it, avoiding to compile the OpenGL code
> once per module using it and removing the need for OPENGL_COMMON* vars.
>
> As the fact we're using OpenGL or OpenGL ES is defined at compile time,
> the clients must use the correct variant depending on what they use.
> ---
>  modules/video_output/Makefile.am        | 20 ++++++-------
>  modules/video_output/opengl/Makefile.am | 38 +++++++++++++++++++++----
>  2 files changed, 43 insertions(+), 15 deletions(-)
>
> diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
> index 33d7d91cbb1..a2af2f322c4 100644
> --- a/modules/video_output/Makefile.am
> +++ b/modules/video_output/Makefile.am
> @@ -27,15 +27,15 @@ libglinterop_cvpx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
>  	-Wl,-framework,Foundation,-framework,CoreVideo
>
>  if HAVE_OSX
> -libvout_macosx_plugin_la_SOURCES = video_output/macosx.m $(OPENGL_COMMONSOURCES)
> -libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DHAVE_GL_CORE_SYMBOLS
> -libvout_macosx_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
> +libvout_macosx_plugin_la_SOURCES = video_output/macosx.m
> +libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) -DHAVE_GL_CORE_SYMBOLS
> +libvout_macosx_plugin_la_LIBADD = libvlc_opengl.la
>  libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
>  	-Wl,-framework,OpenGL,-framework,Cocoa
>
> -libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m $(OPENGL_COMMONSOURCES)
> -libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DHAVE_GL_CORE_SYMBOLS
> -libcaopengllayer_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
> +libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m
> +libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS)  -DHAVE_GL_CORE_SYMBOLS
> +libcaopengllayer_plugin_la_LIBADD = libvlc_opengl.la
>  libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
>  	-Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
>
> @@ -47,9 +47,9 @@ if HAVE_IOS
>  libglinterop_cvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -DUSE_OPENGL_ES2
>  endif
>
> -libvout_ios_plugin_la_SOURCES = video_output/ios.m $(OPENGL_COMMONSOURCES)
> +libvout_ios_plugin_la_SOURCES = video_output/ios.m
>  libvout_ios_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DUSE_OPENGL_ES2
> -libvout_ios_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
> +libvout_ios_plugin_la_LIBADD = libvlc_opengles.la
>  libvout_ios_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
>  	-Wl,-framework,Foundation,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit
>  if HAVE_IOS
> @@ -114,7 +114,7 @@ libdirect3d11_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
>  vout_LTLIBRARIES += $(LTLIBdirect3d11)
>  EXTRA_LTLIBRARIES += libdirect3d11_plugin.la
>
> -libglwin32_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) \
> +libglwin32_plugin_la_SOURCES = \
>  	video_output/win32/glwin32.c \
>  	video_output/win32/common.c video_output/win32/common.h \
>  	video_output/win32/events.c video_output/win32/events.h \
> @@ -125,7 +125,7 @@ libwgl_plugin_la_SOURCES = video_output/win32/wgl.c $(OPENGL_COMMONSOURCES)
>  libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
>  	-DMODULE_NAME_IS_glwin32
>
> -libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid $(OPENGL_COMMONLIBS)
> +libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid libvlc_opengl.la
>  libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 $(OPENGL_COMMONLIBS)
>
>  libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DHAVE_GL_CORE_SYMBOLS
> diff --git a/modules/video_output/opengl/Makefile.am b/modules/video_output/opengl/Makefile.am
> index d64896a56d4..45c441ae190 100644
> --- a/modules/video_output/opengl/Makefile.am
> +++ b/modules/video_output/opengl/Makefile.am
> @@ -22,18 +22,46 @@ endif
>  OPENGL_COMMONCFLAGS = $(LIBPLACEBO_CFLAGS)
>  OPENGL_COMMONLIBS = $(LIBPLACEBO_LIBS)
>
> +# Convenience library for OpenGL components -- OpenGL only
> +libvlc_opengl_la_SOURCES = $(OPENGL_COMMONSOURCES)
> +libvlc_opengl_la_CFLAGS = $(OPENGL_COMMONCFLAGS)
> +libvlc_opengl_la_LIBADD = $(OPENGL_COMMONLIBS)
> +libvlc_opengl_la_LDFLAGS = \
> +    -static \
> +    -no-undefined \
> +    -export-symbols-regex "^vlc_gl_|^vout_display_opengl_" \
> +    -version-info 0:0:0
> +
> +if HAVE_GL
> +EXTRA_LTLIBRARIES += libvlc_opengl.la
> +endif
> +
> +# Convenience library for OpenGL components -- OpenGL ES only
> +libvlc_opengles_la_SOURCES = $(OPENGL_COMMONSOURCES)
> +libvlc_opengles_la_CFLAGS = $(OPENGL_COMMONCFLAGS) -DUSE_OPENGL_ES2
> +libvlc_opengles_la_LIBADD = $(OPENGL_COMMONLIBS)
> +libvlc_opengles_la_LDFLAGS = \
> +    -static \
> +    -no-undefined \
> +    -export-symbols-regex "^vlc_gl_|^vout_display_opengl_" \
> +    -version-info 0:0:0
> +
> +libvlc_opengles_la_CFLAGS += $(GLES2_CFLAGS)
> +libvlc_opengles_la_LIBADD += $(GLES2_LIBS)
> +EXTRA_LTLIBRARIES += libvlc_opengles.la
> +
>  ### OpenGL ###
> -libgles2_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c
> -libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES2 $(OPENGL_COMMONCFLAGS)
> -libgles2_plugin_la_LIBADD = $(GLES2_LIBS) $(LIBM) $(OPENGL_COMMONLIBS)
> +libgles2_plugin_la_SOURCES = video_output/opengl/display.c
> +libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES2
> +libgles2_plugin_la_LIBADD = $(GLES2_LIBS) $(LIBM) libvlc_opengles.la
>  libgles2_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
>
>  EXTRA_LTLIBRARIES += libgles2_plugin.la
>  vout_LTLIBRARIES += $(LTLIBgles2)
>
> -libgl_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c
> +libgl_plugin_la_SOURCES = video_output/opengl/display.c
>  libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) $(OPENGL_COMMONCFLAGS)
> -libgl_plugin_la_LIBADD = $(LIBM) $(OPENGL_COMMONLIBS)
> +libgl_plugin_la_LIBADD = $(LIBM) libvlc_opengl.la
>  if HAVE_WIN32
>  libgl_plugin_la_CFLAGS += -DHAVE_GL_CORE_SYMBOLS
>  libgl_plugin_la_LIBADD += $(GL_LIBS)
> --
> 2.27.0
>


More information about the vlc-devel mailing list