vp8: allow compilation without the built-in libvpx.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 21 Apr 2014 15:49:38 +0000 (17:49 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 21 Apr 2014 15:53:06 +0000 (17:53 +0200)
The built-in libvpx serves multiple purposes, among which the most
important ones could be: track the most up-to-date, and optimized,
range decoder; allow for future hybrid implementations (non-VLD);
and have a completely independent range decoder implementation.

configure.ac
ext/libvpx/Makefile.am
gst-libs/gst/codecparsers/Makefile.am

index d6928f1e21c4983d70479b54fe9cb5ac1b721b42..12b1d1764284aea1af99d6bdee5d0ae8259feace 100644 (file)
@@ -97,7 +97,7 @@ AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"])
 
 AC_ARG_VAR([YASM], [Path to yasm program, if any])
 AC_PATH_PROG([YASM], [yasm])
-if test -z "$YASM"; then
+if test -z "$YASM" -a "$enable_builtin_libvpx" = "yes"; then
     AC_MSG_ERROR([yasm is needed to build libvpx sources])
 fi
 
@@ -110,6 +110,11 @@ AC_ARG_ENABLE(builtin_codecparsers,
                    [enable built-in codecparsers @<:@default=yes@:>@]),
     [], [enable_builtin_codecparsers="yes"])
 
+AC_ARG_ENABLE(builtin_libvpx,
+    AS_HELP_STRING([--enable-builtin-libvpx],
+                   [enable built-in libvpx @<:@default=yes@:>@]),
+    [], [enable_builtin_libvpx="yes"])
+
 AC_ARG_ENABLE([encoders],
     AS_HELP_STRING([--enable-encoders],
                    [enable video encoders @<:@default=yes@:>@]),
@@ -421,6 +426,9 @@ AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_JPEG],
     [test "$ac_cv_have_gst_jpeg_parser" != "yes"])
 
 dnl ... VP8 parser, not upstream yet
+if test "$enable_builtin_libvpx" = "yes"; then
+    ac_cv_have_gst_vp8_parser="no"
+fi
 AC_CACHE_CHECK([for VP8 parser],
     ac_cv_have_gst_vp8_parser, [
     saved_CPPFLAGS="$CPPFLAGS"
@@ -439,6 +447,7 @@ AC_CACHE_CHECK([for VP8 parser],
 ])
 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP8],
     [test "$ac_cv_have_gst_vp8_parser" != "yes"])
+AM_CONDITIONAL([USE_BUILTIN_LIBVPX], [test "$enable_builtin_libvpx" = "yes"])
 
 case $GST_API_VERSION in
 0.10)   lt_bias=gst0_vaapi_lt_current_bias;;
index 4f54b93c150b6d7787a3e1c71cc5ff03aaab158c..f945dce6080256f17eadd99e5c2c5294c61bfbf2 100644 (file)
@@ -19,7 +19,7 @@
 # Boston, MA 02110-1301, USA.
 
 lib_LTLIBRARIES =
-if USE_LOCAL_CODEC_PARSERS_VP8
+if USE_BUILTIN_LIBVPX
 lib_LTLIBRARIES += libgstcodecparsers_vpx.la
 endif
 
index d7c9dd8305210aecdde0b9bfcb93c70056c09b80..ecd2f5e923d8e479cbb19ee672914ae1cc475c5a 100644 (file)
@@ -45,8 +45,8 @@ endif
 if USE_LOCAL_CODEC_PARSERS_VP8
 gen_source_c += gstvp8parser.c
 gen_source_h += gstvp8parser.h gstvp8rangedecoder.h vp8utils.h
-#gen_source_c += dboolhuff.c gstvp8rangedecoder.c vp8utils.c
-#gen_source_h += dboolhuff.h
+
+if USE_BUILTIN_LIBVPX
 add_source_c += gstvaapilibvpx.c
 
 libgstvaapi_codecparsers_cflags += \
@@ -56,6 +56,10 @@ libgstvaapi_codecparsers_cflags += \
 
 libgstvaapi_codecparsers_libs += \
        $(top_builddir)/ext/libvpx/libgstcodecparsers_vpx.la
+else
+gen_source_c += dboolhuff.c gstvp8rangedecoder.c vp8utils.c
+gen_source_h += dboolhuff.h
+endif
 endif
 
 GENFILES = \