зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1460367 - move audio sample-related settings to moz.configure; r=ted.mielczarek,nalexander
With moz.configure, it's a little more obvious that MOZ_TREMOR and MOZ_VORBIS are mutually exclusive.
This commit is contained in:
Родитель
375bdf507f
Коммит
5141d7d645
|
@ -1903,10 +1903,6 @@ if test "$MOZ_IOS"; then
|
|||
MOZ_AUTH_EXTENSION=
|
||||
fi
|
||||
MOZ_RAW=
|
||||
MOZ_VORBIS=
|
||||
MOZ_TREMOR=
|
||||
MOZ_SAMPLE_TYPE_FLOAT32=
|
||||
MOZ_SAMPLE_TYPE_S16=
|
||||
MOZ_SRTP=
|
||||
MOZ_WEBRTC_HARDWARE_AEC_NS=
|
||||
MOZ_SCTP=
|
||||
|
@ -2377,20 +2373,6 @@ AC_SUBST(MOZ_SCTP)
|
|||
AC_SUBST(MOZ_SRTP)
|
||||
AC_SUBST_LIST(MOZ_WEBRTC_X11_LIBS)
|
||||
|
||||
dnl Use integers over floats for audio on B2G and Android
|
||||
dnl (regarless of the CPU architecture, because audio
|
||||
dnl backends for those platforms don't support floats. We also
|
||||
dnl use integers on ARM with other OS, because it's more efficient.
|
||||
if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
|
||||
MOZ_SAMPLE_TYPE_S16=1
|
||||
AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
|
||||
AC_SUBST(MOZ_SAMPLE_TYPE_S16)
|
||||
else
|
||||
MOZ_SAMPLE_TYPE_FLOAT32=1
|
||||
AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
|
||||
AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable Raw Codecs
|
||||
dnl ========================================================
|
||||
|
@ -2460,12 +2442,6 @@ AC_SUBST(MOZ_SYSTEM_LIBVPX)
|
|||
AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS)
|
||||
AC_SUBST_LIST(MOZ_LIBVPX_LIBS)
|
||||
|
||||
if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
|
||||
MOZ_VORBIS=1
|
||||
else
|
||||
MOZ_TREMOR=1
|
||||
fi
|
||||
|
||||
if test -z "$MOZ_SYSTEM_LIBVPX"; then
|
||||
|
||||
dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
|
||||
|
@ -2562,18 +2538,6 @@ dnl ========================================================
|
|||
dnl = Handle dependent MEDIA defines
|
||||
dnl ========================================================
|
||||
|
||||
if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
|
||||
AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive! The build system should not allow them both to be set, but they are. Please file a bug at https://bugzilla.mozilla.org/])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_VORBIS"; then
|
||||
AC_DEFINE(MOZ_VORBIS)
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_TREMOR"; then
|
||||
AC_DEFINE(MOZ_TREMOR)
|
||||
fi
|
||||
|
||||
MOZ_WEBM_ENCODER=1
|
||||
AC_DEFINE(MOZ_WEBM_ENCODER)
|
||||
AC_SUBST(MOZ_WEBM_ENCODER)
|
||||
|
@ -4501,8 +4465,6 @@ AC_SUBST(NS_ENABLE_TSF)
|
|||
AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
|
||||
AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
|
||||
|
||||
AC_SUBST(MOZ_VORBIS)
|
||||
AC_SUBST(MOZ_TREMOR)
|
||||
AC_SUBST(MOZ_FFVPX)
|
||||
AC_SUBST(MOZ_FFVPX_FLACONLY)
|
||||
AC_SUBST_LIST(FFVPX_ASFLAGS)
|
||||
|
|
|
@ -419,6 +419,29 @@ set_config('MOZ_FMP4', fmp4)
|
|||
set_define('MOZ_FMP4', fmp4)
|
||||
add_old_configure_assignment('MOZ_FMP4', fmp4)
|
||||
|
||||
@depends(target)
|
||||
def sample_type_is_s16(target):
|
||||
# Use integers over floats for audio on Android regardless of the CPU
|
||||
# architecture, because audio backends for Android don't support floats.
|
||||
# We also use integers on ARM because it's more efficient.
|
||||
if target.os == 'Android' or target.cpu == 'arm':
|
||||
return True
|
||||
|
||||
@depends(sample_type_is_s16)
|
||||
def sample_type_is_float(t):
|
||||
if not t:
|
||||
return True
|
||||
|
||||
set_config('MOZ_SAMPLE_TYPE_S16', sample_type_is_s16)
|
||||
set_define('MOZ_SAMPLE_TYPE_S16', sample_type_is_s16)
|
||||
set_config('MOZ_SAMPLE_TYPE_FLOAT32', sample_type_is_float)
|
||||
set_define('MOZ_SAMPLE_TYPE_FLOAT32', sample_type_is_float)
|
||||
|
||||
set_define('MOZ_VORBIS', sample_type_is_float)
|
||||
set_config('MOZ_VORBIS', sample_type_is_float)
|
||||
set_define('MOZ_TREMOR', sample_type_is_s16)
|
||||
set_config('MOZ_TREMOR', sample_type_is_s16)
|
||||
|
||||
# OpenMAX IL Decoding Support
|
||||
# ==============================================================
|
||||
option('--enable-openmax',
|
||||
|
|
Загрузка…
Ссылка в новой задаче