From: Steinar H. Gunderson Date: Mon, 17 Mar 2014 00:46:29 +0000 (+0100) Subject: Merge branch 'master' into epoxy X-Git-Tag: 1.1~12^2~27^2 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=144496bf79000c3971090195fbfedcb2cb22a0be;hp=-c;p=movit Merge branch 'master' into epoxy Conflicts: Makefile.in movit.pc.in --- 144496bf79000c3971090195fbfedcb2cb22a0be diff --combined Makefile.in index ee3626b,445f5b7..cd56fa6 --- a/Makefile.in +++ b/Makefile.in @@@ -1,5 -1,14 +1,14 @@@ GTEST_DIR ?= /usr/src/gtest + # This will be upgraded for each release, although not necessarily for every git commit. + # See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html + # for the rules as of how this is changed. This does not really mean that Movit will + # strive towards having a rock-stable ABI, but at least the soversion will increase + # whenever it breaks, so that you will not have silent failures, and distribution package + # management can run its course. + movit_ltversion = 1:3:0 + movit_version = 1.0.3 + prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ @@@ -8,17 -17,15 +17,19 @@@ datarootdir = @datarootdir datadir = @datadir@ top_builddir = @top_builddir@ with_demo_app = @with_demo_app@ +with_SDL2 = @with_SDL2@ with_coverage = @with_coverage@ CC=@CC@ CXX=@CXX@ -CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @GLEW_CFLAGS@ @FFTW3_CFLAGS@ +CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @SDL2_CFLAGS@ @SDL_CFLAGS@ @Eigen3_CFLAGS@ @epoxy_CFLAGS@ @FFTW3_CFLAGS@ +ifeq ($(with_SDL2),yes) +CXXFLAGS += -DHAVE_SDL2 +endif - LDFLAGS=@epoxy_LIBS@ @SDL2_LIBS@ @SDL_LIBS@ @FFTW3_LIBS@ -lpthread - DEMO_LDLIBS=@SDL2_image_LIBS@ @SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ @FFTW3_LIBS@ + LDFLAGS=@LDFLAGS@ -LDLIBS=@GLEW_LIBS@ @FFTW3_LIBS@ -lpthread -TEST_LDLIBS=@GLEW_LIBS@ @SDL_LIBS@ -lpthread ++LDLIBS=@epoxy_LIBS@ @FFTW3_LIBS@ -lpthread ++TEST_LDLIBS=@epoxy_LIBS@ @SDL_LIBS@ -lpthread + DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ @FFTW3_LIBS@ SHELL=@SHELL@ LIBTOOL=@LIBTOOL@ --tag=CXX RANLIB=ranlib @@@ -86,7 -93,8 +97,8 @@@ all: dem endif # Google Test and other test library functions. - TEST_OBJS = gtest-all.o gtest_sdl_main.o test_util.o + OWN_TEST_OBJS = gtest_sdl_main.o test_util.o + TEST_OBJS = gtest-all.o $(OWN_TEST_OBJS) gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc $(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@ @@@ -95,8 -103,9 +107,9 @@@ gtest_sdl_main.o: gtest_sdl_main.cp # Unit tests. $(TESTS): %: %.o $(TEST_OBJS) libmovit.la - $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS) + OWN_OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(OWN_TEST_OBJS) $(TESTS:=.o) OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o) # A small demo program. @@@ -105,7 -114,7 +118,7 @@@ demo: libmovit.la $(DEMO_OBJS # The library itself. libmovit.la: $(LIB_OBJS:.o=.lo) - $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -rpath $(libdir) -o $@ $^ $(LDLIBS) + $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -rpath $(libdir) -version-info $(movit_ltversion) -o $@ $^ $(LDLIBS) %.lo: %.cpp $(LIBTOOL) --mode=compile $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $< @@@ -159,15 -168,30 +172,30 @@@ SHADERS += texture1d.fra # These purposefully do not exist. MISSING_SHADERS = diffusion_effect.frag glow_effect.frag unsharp_mask_effect.frag resize_effect.frag + MISSING_SHADERS += fft_convolution_effect.frag fft_input.frag SHADERS := $(filter-out $(MISSING_SHADERS),$(SHADERS)) install: libmovit.la - $(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(libdir)/ - $(MKDIR) -p $(includedir)/movit/ - $(INSTALL) -m 0644 $(HDRS) $(includedir)/movit/ - $(MKDIR) -p $(datadir)/movit/ - $(INSTALL) -m 0644 $(SHADERS) $(datadir)/movit/ - $(MKDIR) -p $(libdir)/pkgconfig/ - $(INSTALL) -m 644 movit.pc $(libdir)/pkgconfig/ - - .PHONY: coverage clean distclean check all install + $(MKDIR) -p $(DESTDIR)$(libdir)/ + $(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(DESTDIR)$(libdir)/ + $(MKDIR) -p $(DESTDIR)$(includedir)/movit/ + $(INSTALL) -m 0644 $(HDRS) $(DESTDIR)$(includedir)/movit/ + $(MKDIR) -p $(DESTDIR)$(datadir)/movit/ + $(INSTALL) -m 0644 $(SHADERS) $(DESTDIR)$(datadir)/movit/ + $(MKDIR) -p $(DESTDIR)$(libdir)/pkgconfig/ + $(INSTALL) -m 644 movit.pc $(DESTDIR)$(libdir)/pkgconfig/ + + DISTDIR=movit-$(movit_version) + OTHER_DIST_FILES=add.frag autogen.sh blue.frag configure.ac d65.h identity.frag invert_effect.frag Makefile.in mipmap_needing_effect.frag movit.pc.in README NEWS test_util.h widgets.h + + dist: + $(MKDIR) $(DISTDIR) + cp $(OWN_OBJS:.o=.cpp) $(DISTDIR)/ + cp $(HDRS) $(DISTDIR)/ + cp $(SHADERS) $(DISTDIR)/ + cp $(OTHER_DIST_FILES) $(DISTDIR)/ + ( cd $(DISTDIR) && aclocal && libtoolize --install --copy && autoconf && $(RM) -r autom4te.cache/ ) + tar zcvvf ../$(DISTDIR).tar.gz $(DISTDIR) + $(RM) -r $(DISTDIR) + + .PHONY: coverage clean distclean check all install dist diff --combined README index 0537f68,e738f7f..b6b2b9d --- a/README +++ b/README @@@ -9,7 -9,7 +9,7 @@@ Movit is the Modern Video Toolkit, notw called “modern” usually isn't, and it's really not a toolkit. Movit aims to be a _high-quality_, _high-performance_, _open-source_ - library for video filters. It is currently in alpha stage. + library for video filters. TL;DR, please give me download link and system demands @@@ -21,13 -21,12 +21,13 @@@ OK, you nee works fine on Linux and OS X, and Movit is not very POSIX-bound.) * GNU Make. * A GPU capable of running GLSL fragment shaders, - process floating-point textures, and a few other things. If your machine - is less than five years old _and you have the appropriate drivers_, - you're home free. + processing floating-point textures, and a few other things (all are + part of OpenGL 3.0 or newer, although most OpenGL 2.0 cards also + have what's needed through extensions). If your machine is less than five + years old _and you have the appropriate drivers_, you're home free. * The [Eigen 3] and [Google Test] libraries. (The library itself depends only on the former, but you probably want to run the unit tests.) -* The [GLEW] library, for dealing with OpenGL extensions on various +* The [epoxy] library, for dealing with OpenGL extensions on various platforms. Movit has been tested with Intel GPUs with the Mesa drivers @@@ -55,8 -54,7 +55,8 @@@ all research-grade problems, and Movit TL;DR, but I am interested in a programming example instead =========================================================== -Assuming you have an OpenGL context already set up: +Assuming you have an OpenGL context already set up (currently you need +a classic OpenGL context; a GL 3.2+ core context won't do): using namespace movit; diff --combined complex_modulate_effect.cpp index 656de3a,6af589c..9483f6b --- a/complex_modulate_effect.cpp +++ b/complex_modulate_effect.cpp @@@ -1,4 -1,4 +1,4 @@@ -#include +#include #include "complex_modulate_effect.h" #include "effect_chain.h" @@@ -25,7 -25,7 +25,7 @@@ void ComplexModulateEffect::set_gl_stat { Effect::set_gl_state(glsl_program_num, prefix, sampler_num); - float num_repeats[] = { num_repeats_x, num_repeats_y }; + float num_repeats[] = { float(num_repeats_x), float(num_repeats_y) }; set_uniform_vec2(glsl_program_num, prefix, "num_repeats", num_repeats); // Set the secondary input to repeat (and nearest while we're at it). diff --combined configure.ac index 1007ce2,93e168b..823740b --- a/configure.ac +++ b/configure.ac @@@ -1,33 -1,26 +1,35 @@@ AC_CONFIG_MACRO_DIR([m4]) AC_INIT(movit, git) LT_INIT + PKG_PROG_PKG_CONFIG AC_CONFIG_SRCDIR(effect.cpp) + AC_CONFIG_AUX_DIR(.) AC_PROG_CC AC_PROG_CXX PKG_CHECK_MODULES([Eigen3], [eigen3]) -PKG_CHECK_MODULES([GLEW], [glew]) +PKG_CHECK_MODULES([epoxy], [epoxy]) PKG_CHECK_MODULES([FFTW3], [fftw3]) -# Needed for unit tests and the demo app. -PKG_CHECK_MODULES([SDL], [sdl]) +# Needed for unit tests and the demo app. We prefer SDL2 if possible, +# but can also use classic SDL. +with_SDL2=no +with_demo_app=yes +PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [ + PKG_CHECK_MODULES([SDL], [sdl]) +]) # These are only needed for the demo app. -with_demo_app=yes -PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +if test $with_SDL2 = "yes"; then + PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])]) +else + PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +fi PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])]) AC_SUBST([with_demo_app]) +AC_SUBST([with_SDL2]) with_coverage=no AC_ARG_ENABLE([coverage], [ --enable-coverage build with information needed to compute test coverage], [with_coverage=yes]) diff --combined movit.pc.in index 6069a06,b11ba15..20427c6 --- a/movit.pc.in +++ b/movit.pc.in @@@ -13,5 -13,6 +13,6 @@@ Description: Movit is a library for hig Version: git Requires: Conflicts: - Libs: -lmovit @epoxy_LIBS@ - Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @epoxy_CFLAGS@ + Libs: -lmovit -Libs.private: @GLEW_LIBS@ @FFTW3_LIBS@ -Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @GLEW_CFLAGS@ @FFTW3_CFLAGS@ ++Libs.private: @epoxy_LIBS@ @FFTW3_LIBS@ ++Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @epoxy_CFLAGS@ @FFTW3_CFLAGS@