[vlc-devel] [PATCH] modules: move copy.c in a locally built static library

Steve Lhomme robux4 at videolabs.io
Sat Nov 11 15:33:26 CET 2017


So it's not built multiple times and also make it easier to do a clean static
build.
---
 modules/codec/Makefile.am        | 16 +++++++---------
 modules/hw/vaapi/Makefile.am     |  4 ++--
 modules/video_chroma/Makefile.am | 18 +++++++++++-------
 modules/video_output/Makefile.am | 20 ++++++++------------
 4 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index cefbf87330..1fd99cfee3 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -338,7 +338,7 @@ liboggspots_plugin_la_LIBADD = $(OGGSPOTS_LIBS)
 EXTRA_LTLIBRARIES += liboggspots_plugin.la
 codec_LTLIBRARIES += $(LTLIBoggspots)
 
-libvideotoolbox_plugin_la_SOURCES = video_chroma/copy.c video_chroma/copy.h \
+libvideotoolbox_plugin_la_SOURCES = \
 	codec/vt_utils.c codec/vt_utils.h \
 	codec/videotoolbox.m codec/hxxx_helper.c codec/hxxx_helper.h \
 	packetizer/hxxx_nal.h packetizer/hxxx_nal.c \
@@ -355,7 +355,7 @@ endif
 if HAVE_TVOS
 libvideotoolbox_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -mtvos-version-min=10.2
 endif
-libvideotoolbox_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)' -Wl,-framework,Foundation -Wl,-framework,VideoToolbox -Wl,-framework,CoreMedia -Wl,-framework,CoreVideo
+libvideotoolbox_plugin_la_LDFLAGS = video_chroma_copy.la $(AM_LDFLAGS) -rpath '$(codecdir)' -Wl,-framework,Foundation -Wl,-framework,VideoToolbox -Wl,-framework,CoreMedia -Wl,-framework,CoreVideo
 EXTRA_LTLIBRARIES += libvideotoolbox_plugin.la
 codec_LTLIBRARIES += $(LTLIBvideotoolbox)
 
@@ -458,19 +458,18 @@ libomxil_plugin_la_SOURCES = \
 	packetizer/h264_nal.c packetizer/h264_nal.h \
 	packetizer/hevc_nal.c packetizer/hevc_nal.h \
 	codec/omxil/qcom.c codec/omxil/qcom.h \
-	codec/omxil/omxil.c codec/omxil/omxil.h codec/omxil/omxil_core.c codec/omxil/omxil_core.h \
-	video_chroma/copy.c
+	codec/omxil/omxil.c codec/omxil/omxil.h codec/omxil/omxil_core.c codec/omxil/omxil_core.h
 if HAVE_ANDROID
 libomxil_plugin_la_SOURCES += video_output/android/utils.c video_output/android/utils.h \
 	video_output/android/display.h
 endif
 libomxil_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/codec/omxil $(CFLAGS_omxil)
-libomxil_plugin_la_LIBADD = $(LIBDL)
+libomxil_plugin_la_LIBADD = video_chroma_copy.la $(LIBDL)
 libomxil_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 
-libomxil_vout_plugin_la_SOURCES = codec/omxil/vout.c codec/omxil/omxil_core.c codec/omxil/utils.c codec/omxil/qcom.c video_chroma/copy.c
+libomxil_vout_plugin_la_SOURCES = codec/omxil/vout.c codec/omxil/omxil_core.c codec/omxil/utils.c codec/omxil/qcom.c
 libomxil_vout_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/codec/omxil $(CFLAGS_omxil_vout)
-libomxil_vout_plugin_la_LIBADD = $(LIBDL)
+libomxil_vout_plugin_la_LIBADD = video_chroma_copy.la $(LIBDL)
 libomxil_vout_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 
 libiomx_plugin_la_SOURCES = $(libomxil_plugin_la_SOURCES)
@@ -480,14 +479,13 @@ libiomx_plugin_la_LIBADD = $(libomxil_plugin_la_LIBADD)
 libmediacodec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/codec/omxil
 libmediacodec_plugin_la_SOURCES = codec/omxil/mediacodec.c codec/omxil/mediacodec.h \
 	codec/omxil/mediacodec_jni.c codec/omxil/mediacodec_ndk.c codec/omxil/utils.c \
-	video_chroma/copy.c \
 	video_output/android/utils.c video_output/android/utils.h \
 	video_output/android/display.h \
 	codec/hxxx_helper.c codec/hxxx_helper.h \
 	packetizer/hxxx_nal.h packetizer/hxxx_nal.c \
 	packetizer/h264_nal.c packetizer/h264_nal.h \
 	packetizer/hevc_nal.c packetizer/hevc_nal.h
-
+libmediacodec_plugin_la_LIBADD = video_chroma_copy.la 
 codec_LTLIBRARIES += $(LTLIBomxil) $(LTLIBomxil_vout)
 EXTRA_LTLIBRARIES += libomxil_plugin.la libomxil_vout_plugin.la
 if HAVE_ANDROID
diff --git a/modules/hw/vaapi/Makefile.am b/modules/hw/vaapi/Makefile.am
index f78b729742..7ec66a224d 100644
--- a/modules/hw/vaapi/Makefile.am
+++ b/modules/hw/vaapi/Makefile.am
@@ -2,11 +2,11 @@ vaapidir = $(pluginsdir)/vaapi
 
 libvaapi_filters_plugin_la_SOURCES = hw/vaapi/filters.c hw/vaapi/filters.h \
 	hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h \
-	hw/vaapi/chroma.c video_chroma/copy.c video_chroma/copy.h
+	hw/vaapi/chroma.c
 
 libvaapi_filters_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
 libvaapi_filters_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBVA_CFLAGS)
-libvaapi_filters_plugin_la_LIBADD = $(AM_LIBADD) $(LIBVA_LIBS)
+libvaapi_filters_plugin_la_LIBADD = video_chroma_copy.la $(AM_LIBADD) $(LIBVA_LIBS)
 
 if HAVE_VAAPI
 vaapi_LTLIBRARIES = libvaapi_filters_plugin.la
diff --git a/modules/video_chroma/Makefile.am b/modules/video_chroma/Makefile.am
index e0298d50bf..4d8756fcf5 100644
--- a/modules/video_chroma/Makefile.am
+++ b/modules/video_chroma/Makefile.am
@@ -2,6 +2,9 @@ chromadir = $(pluginsdir)/video_chroma
 
 libchain_plugin_la_SOURCES = video_chroma/chain.c
 
+video_chroma_copy_la_SOURCES = video_chroma/copy.c video_chroma/copy.h
+noinst_LTLIBRARIES += video_chroma_copy.la
+
 libchroma_omx_plugin_la_SOURCES = video_chroma/omxdl.c
 libchroma_omx_plugin_la_CFLAGS = $(AM_CFLAGS) $(OMXIP_CFLAGS)
 libchroma_omx_plugin_la_LIBADD = $(OMXIP_LIBS)
@@ -21,15 +24,15 @@ libi420_yuy2_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2
 libi420_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_i420_yuy2
 
-libi420_nv12_plugin_la_SOURCES = video_chroma/i420_nv12.c \
-	video_chroma/copy.c video_chroma/copy.h
+libi420_nv12_plugin_la_SOURCES = video_chroma/i420_nv12.c
 libi420_nv12_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_i420_nv12
+libi420_nv12_plugin_la_LIBADD = video_chroma_copy.la
 
-libi420_10_p010_plugin_la_SOURCES = video_chroma/i420_10_p010.c \
-	video_chroma/copy.c video_chroma/copy.h
+libi420_10_p010_plugin_la_SOURCES = video_chroma/i420_10_p010.c
 libi420_10_p010_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_i420_10_p010
+libi420_10_p010_plugin_la_LIBADD = video_chroma_copy.la
 
 libi422_i420_plugin_la_SOURCES = video_chroma/i422_i420.c
 
@@ -115,7 +118,8 @@ endif
 
 # DXVA2
 libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c \
-        video_chroma/d3d9_fmt.h video_chroma/copy.c video_chroma/copy.h
+        video_chroma/d3d9_fmt.h
+libdxa9_plugin_la_LIBADD = video_chroma_copy.la
 
 if HAVE_AVCODEC_DXVA2
 chroma_LTLIBRARIES += \
@@ -124,8 +128,8 @@ endif
 
 # D3D11VA
 libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c \
-	video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
-        video_chroma/copy.c video_chroma/copy.h
+	video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h
+libd3d11_surface_plugin_la_LIBADD = video_chroma_copy.la
 
 if HAVE_AVCODEC_D3D11VA
 chroma_LTLIBRARIES += \
diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index 2785504d8c..3dbd814c69 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -249,7 +249,6 @@ endif
 
 ### Win32 ###
 libdirect3d9_plugin_la_SOURCES = video_output/win32/direct3d9.c \
-	video_chroma/copy.c video_chroma/copy.h \
 	video_output/win32/common.c video_output/win32/common.h \
 	video_output/win32/events.c video_output/win32/events.h \
 	video_output/win32/sensors.cpp \
@@ -258,7 +257,7 @@ libdirect3d9_plugin_la_SOURCES = video_output/win32/direct3d9.c \
 	video_chroma/d3d9_fmt.h
 libdirect3d9_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_direct3d9
-libdirect3d9_plugin_la_LIBADD = -lgdi32 $(LIBCOM) -luuid
+libdirect3d9_plugin_la_LIBADD = video_chroma_copy.la -lgdi32 $(LIBCOM) -luuid
 libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
 libdirect3d9_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c \
         video_filter/deinterlace/common.c video_filter/deinterlace/common.h \
@@ -277,18 +276,18 @@ endif
 
 libdirect3d11_plugin_la_SOURCES = video_output/win32/direct3d11.c \
  video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
- video_output/win32/common.c video_output/win32/common.h \
- video_chroma/copy.c video_chroma/copy.h
+ video_output/win32/common.c video_output/win32/common.h
 libdirect3d11_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
  -DMODULE_NAME_IS_direct3d11
+libdirect3d11_plugin_la_LIBADD = video_chroma_copy.la $(LIBCOM) -luuid
 if !HAVE_WINSTORE
 libdirect3d11_plugin_la_SOURCES += video_output/win32/events.c \
  video_output/win32/events.h \
  video_output/win32/sensors.cpp \
  video_output/win32/win32touch.c video_output/win32/win32touch.h
-libdirect3d11_plugin_la_LIBADD = -lgdi32 $(LIBCOM) -luuid
+libdirect3d11_plugin_la_LIBADD += -lgdi32
 else
-libdirect3d11_plugin_la_LIBADD = -ld3dcompiler_47 $(LIBCOM) -luuid
+libdirect3d11_plugin_la_LIBADD += -ld3dcompiler_47
 endif
 libdirect3d11_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
 vout_LTLIBRARIES += $(LTLIBdirect3d11)
@@ -306,13 +305,12 @@ EXTRA_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_pl
 
 libdirectdraw_plugin_la_SOURCES = video_output/win32/directdraw.c \
 	video_output/win32/common.c video_output/win32/common.h \
-	video_chroma/copy.c video_chroma/copy.h \
 	video_output/win32/events.c video_output/win32/events.h \
 	video_output/win32/sensors.cpp \
 	video_output/win32/win32touch.c video_output/win32/win32touch.h
 libdirectdraw_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_directdraw
-libdirectdraw_plugin_la_LIBADD = -luser32 -lgdi32 $(LIBCOM) -luuid
+libdirectdraw_plugin_la_LIBADD = video_chroma_copy.la -luser32 -lgdi32 $(LIBCOM) -luuid
 libdirectdraw_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
 if HAVE_WIN32_DESKTOP
 vout_LTLIBRARIES += $(LTLIBdirectdraw)
@@ -322,7 +320,6 @@ endif
 libglwin32_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) \
 	video_output/win32/glwin32.c \
 	video_output/win32/common.c video_output/win32/common.h \
-	video_chroma/copy.c video_chroma/copy.h \
 	video_output/win32/events.c video_output/win32/events.h \
 	video_output/win32/sensors.cpp \
 	video_output/win32/win32touch.c video_output/win32/win32touch.h
@@ -333,7 +330,7 @@ libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 libwgl_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
         -DMODULE_NAME_IS_wgl
 
-libglwin32_plugin_la_LIBADD = -lopengl32 -lgdi32 $(LIBCOM) -luuid $(OPENGL_COMMONLIBS)
+libglwin32_plugin_la_LIBADD = video_chroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid $(OPENGL_COMMONLIBS)
 libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 $(OPENGL_COMMONLIBS)
 
 libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS)
@@ -349,13 +346,12 @@ endif
 
 libwingdi_plugin_la_SOURCES = video_output/win32/wingdi.c \
 	video_output/win32/common.c video_output/win32/common.h \
-	video_chroma/copy.c video_chroma/copy.h \
 	video_output/win32/events.c video_output/win32/events.h \
 	video_output/win32/sensors.cpp \
 	video_output/win32/win32touch.c video_output/win32/win32touch.h
 libwingdi_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_wingdi
-libwingdi_plugin_la_LIBADD = -lgdi32 $(LIBCOM) -luuid
+libwingdi_plugin_la_LIBADD = video_chroma_copy.la -lgdi32 $(LIBCOM) -luuid
 if HAVE_WIN32_DESKTOP
 vout_LTLIBRARIES += libwingdi_plugin.la
 endif
-- 
2.14.2



More information about the vlc-devel mailing list