Bug 983953 - Don't try to use vpx_mem if --with-system-libvpx doesn't provide. r=glandium

This commit is contained in:
Jan Beich 2014-04-22 08:44:04 -04:00
Родитель cc36660a2f
Коммит 0760d17b4f
3 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -1103,6 +1103,7 @@ vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx_mem/vpx_mem.h
#endif
#ifdef GKMEDIAS_SHARED_LIBRARY
vpx/vpx_codec.h
@ -1110,6 +1111,7 @@ vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx_mem/vpx_mem.h
vorbis/codec.h
theora/theoradec.h
tremor/ivorbiscodec.h

Просмотреть файл

@ -5397,6 +5397,8 @@ if test -n "$MOZ_VPX"; then
AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT)
fi
_SAVE_CFLAGS=$CFLAGS
_SAVE_LIBS=$LIBS
if test -n "$MOZ_NATIVE_LIBVPX"; then
dnl ============================
dnl === libvpx Version check ===
@ -5404,14 +5406,24 @@ if test -n "$MOZ_VPX"; then
dnl Check to see if we have a system libvpx package.
PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.3.0)
CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
LIBS="$LIBS $MOZ_LIBVPX_LIBS"
MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
[AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
_SAVE_LIBS=$LIBS
AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
[AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
LIBS=$_SAVE_LIBS
MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
[AC_CHECK_FUNC(vpx_mem_set_functions)])
if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
"$ac_cv_func_vpx_mem_set_functions" = no; then
AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
fi
fi
CFLAGS=$_SAVE_CFLAGS
LIBS=$_SAVE_LIBS
fi
AC_SUBST(MOZ_NATIVE_LIBVPX)

Просмотреть файл

@ -134,7 +134,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
#endif
#include "ogg/ogg.h"
#ifdef MOZ_VPX
#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
#include "vpx_mem/vpx_mem.h"
#endif
#ifdef MOZ_WEBM
@ -602,7 +602,7 @@ NS_InitXPCOM2(nsIServiceManager* *result,
OggReporter::CountingRealloc,
OggReporter::CountingFree);
#ifdef MOZ_VPX
#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
// And for VPX.
vpx_mem_set_functions(VPXReporter::CountingMalloc,
VPXReporter::CountingCalloc,