summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2011-07-05 21:35:46 +0300
committerEdward Hervey <edward.hervey@collabora.co.uk>2011-10-31 11:14:23 +0100
commit2d767fe58f6cc95a66f58f3de5a2fece7f3521ee (patch)
treedfc7cab83b609eb7748c6f76fc011088a80453a1
parentdc80daec384dbb976f47d439b09a189d951560e4 (diff)
Allow building a LGPL only gst-ffmpeg plugin
This removes --enable-gpl and --enable-postproc from the ffmpeg configure line, and disables building the postproc gstreamer plugin. https://bugzilla.gnome.org/show_bug.cgi?id=654037 Conflicts: configure.ac
-rw-r--r--configure.ac18
-rw-r--r--ext/Makefile.am5
-rw-r--r--ext/ffmpeg/gstffmpeg.c8
-rw-r--r--ext/libswscale/gstffmpegscale.c10
4 files changed, 34 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index e4ab841..cbc45dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,13 @@ if test "x$have_bz2" = "xno"; then
AC_WARN([libbz2 not found, matroska demuxer will not be able to read bz2 tracks])
fi
+AC_ARG_ENABLE(lgpl,
+ [AC_HELP_STRING([--enable-lgpl], [build a LGPL licensed gst-ffmpeg])])
+AM_CONDITIONAL(GST_FFMPEG_ENABLE_LGPL, test "x$enable_lgpl" = "xyes")
+if test "x$enable_lgpl" = "xyes"; then
+ AC_DEFINE([GST_FFMPEG_ENABLE_LGPL], [], [Defined if building a LGPL-only version of gst-ffmpeg])
+fi
+
dnl *** configure external libs ***
HAVE_FFMPEG_UNINSTALLED=1
@@ -213,7 +220,9 @@ AC_ARG_WITH(system-ffmpeg,
if test "x$with_system_ffmpeg" = "xyes"; then
PKG_CHECK_MODULES(FFMPEG, libavformat libavcodec libavutil)
- PKG_CHECK_MODULES(POSTPROC, libpostproc libavcodec libavutil)
+ if test "x$enable_lgpl" != "xyes"; then
+ PKG_CHECK_MODULES(POSTPROC, libpostproc libavcodec libavutil)
+ fi
PKG_CHECK_MODULES(SWSCALE, libswscale libavutil)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
@@ -306,11 +315,16 @@ else
# Enable pic and static so that we get .a files, but with PIC code.
embffmpeg_configure_args="$embffmpeg_configure_args --disable-ffserver --disable-ffplay\
- --disable-ffmpeg --disable-ffprobe --enable-postproc --enable-gpl --enable-static --enable-pic \
+ --disable-ffmpeg --disable-ffprobe --enable-static --enable-pic \
--disable-encoder=flac --disable-decoder=cavs --disable-protocols --disable-devices\
--disable-network --disable-hwaccels --disable-filters --disable-doc\
--enable-optimizations"
+ if test "x$enable_lgpl" != "xyes"; then
+ embffmpeg_configure_args="$embffmpeg_configure_args --enable-postproc \
+ --enable-gpl"
+ fi
+
# if we are cross-compiling, tell ffmpeg so
target_os=`echo $host_os | sed 's/-gnu//'`
if test "x$cross_compiling" = xyes; then
diff --git a/ext/Makefile.am b/ext/Makefile.am
index b13b797..d9ee1a3 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -1 +1,4 @@
-SUBDIRS = ffmpeg libpostproc libswscale
+SUBDIRS = ffmpeg libswscale
+if !GST_FFMPEG_ENABLE_LGPL
+ SUBDIRS += libpostproc
+endif
diff --git a/ext/ffmpeg/gstffmpeg.c b/ext/ffmpeg/gstffmpeg.c
index 6fccb61..88a43bc 100644
--- a/ext/ffmpeg/gstffmpeg.c
+++ b/ext/ffmpeg/gstffmpeg.c
@@ -162,4 +162,10 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"ffmpeg",
"All FFmpeg codecs and formats (" FFMPEG_SOURCE ")",
- plugin_init, PACKAGE_VERSION, "LGPL", "FFmpeg", "http://ffmpeg.org/")
+ plugin_init, PACKAGE_VERSION,
+#ifdef GST_FFMPEG_ENABLE_LGPL
+ "LGPL",
+#else
+ "GPL",
+#endif
+ "FFmpeg", "http://ffmpeg.org/")
diff --git a/ext/libswscale/gstffmpegscale.c b/ext/libswscale/gstffmpegscale.c
index 697539e..b9ef3e1 100644
--- a/ext/libswscale/gstffmpegscale.c
+++ b/ext/libswscale/gstffmpegscale.c
@@ -819,6 +819,10 @@ plugin_init (GstPlugin * plugin)
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"ffvideoscale",
- "videoscaling element (" FFMPEG_SOURCE ")",
- plugin_init,
- PACKAGE_VERSION, "GPL", "FFMpeg", "http://ffmpeg.sourceforge.net/")
+ "videoscaling element (" FFMPEG_SOURCE ")", plugin_init, PACKAGE_VERSION,
+#ifdef GST_FFMPEG_ENABLE_LGPL
+ "LGPL",
+#else
+ "GPL",
+#endif
+ "FFMpeg", "http://ffmpeg.sourceforge.net/")