Factor out a bunch of duplicated code in the configure script for pkg-config based optional dependencies and use the pkg-config name for all WITH_* defines
Originally committed to SVN as r6104.
This commit is contained in:
parent
975bb7b26f
commit
f2c62dad3d
24 changed files with 86 additions and 145 deletions
|
@ -7,8 +7,8 @@ HAVE_HUNSPELL = @with_hunspell@
|
|||
HAVE_OPENAL = @with_openal@
|
||||
HAVE_OSS = @with_oss@
|
||||
HAVE_PORTAUDIO = @with_portaudio@
|
||||
HAVE_FFMS = @with_ffms@
|
||||
HAVE_PULSEAUDIO = @with_pulseaudio@
|
||||
HAVE_FFMS2 = @with_ffms2@
|
||||
HAVE_LIBPULSE = @with_libpulse@
|
||||
HAVE_LIBASS = @with_libass@
|
||||
|
||||
|
||||
|
@ -84,38 +84,38 @@ CXXFLAGS_WX = @WX_CXXFLAGS@
|
|||
CPPFLAGS_WX = @WX_CPPFLAGS@
|
||||
LIBS_WX = @WX_LIBS@
|
||||
|
||||
CFLAGS_FFMS2 = @FFMS2_CFLAGS@
|
||||
CFLAGS_FFTW3 = @FFTW3_CFLAGS@
|
||||
CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@
|
||||
CFLAGS_FREETYPE = @FREETYPE_CFLAGS@
|
||||
CFLAGS_GL = @GL_CFLAGS@
|
||||
CFLAGS_FFMS = @FFMS_CFLAGS@
|
||||
CFLAGS_FFTW3 = @FFTW3_CFLAGS@
|
||||
CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@
|
||||
CFLAGS_ICONV = @ICONV_CFLAGS@
|
||||
CFLAGS_LIBASS = @LIBASS_CFLAGS@
|
||||
CFLAGS_LIBCURL = @LIBCURL_CFLAGS@
|
||||
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
|
||||
CFLAGS_LUA = @LUA_CFLAGS@
|
||||
CFLAGS_OPENAL = @OPENAL_CFLAGS@
|
||||
CFLAGS_OSS = @OSS_CFLAGS@
|
||||
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
|
||||
CFLAGS_PTHREAD = @PTHREAD_CFLAGS@
|
||||
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
|
||||
CFLAGS_UCHARDET = -I../universalchardet
|
||||
|
||||
LDFLAGS_LUA = @LUA_LDFLAGS@
|
||||
LIBS_ALSA = @ALSA_LIBS@
|
||||
LIBS_FFMS2 = @FFMS2_LIBS@
|
||||
LIBS_FFTW3 = @FFTW3_LIBS@
|
||||
LIBS_FONTCONFIG = @FONTCONFIG_LIBS@
|
||||
LIBS_FREETYPE = @FREETYPE_LIBS@
|
||||
LIBS_GL = @GL_LIBS@
|
||||
LIBS_FFMS = @FFMS_LIBS@
|
||||
LIBS_FFTW3 = @FFTW3_LIBS@
|
||||
LIBS_HUNSPELL = @HUNSPELL_LIBS@
|
||||
LIBS_ICONV = @ICONV_LIBS@
|
||||
LIBS_LIBASS = @LIBASS_LIBS@
|
||||
LIBS_LIBCURL = @LIBCURL_LIBS@
|
||||
LIBS_LIBPULSE = @LIBPULSE_LIBS@
|
||||
LDFLAGS_LUA = @LUA_LDFLAGS@
|
||||
LIBS_OPENAL = @OPENAL_LIBS@
|
||||
LIBS_PTHREAD = @PTHREAD_LIBS@
|
||||
LIBS_PORTAUDIO = @PORTAUDIO_LIBS@
|
||||
LIBS_PTHREAD = @PTHREAD_LIBS@
|
||||
LIBS_LIBPULSE = @LIBPULSE_LIBS@
|
||||
LIBS_UCHARDET ?= ../universalchardet/libuniversalchardet.a
|
||||
|
||||
#####################
|
||||
|
|
|
@ -201,7 +201,7 @@
|
|||
<!-- FFmpegSource support -->
|
||||
<ItemDefinitionGroup Condition="'$(AegisubUseFfms)'=='true'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_FFMPEGSOURCE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_FFMS2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(FFmpegSourceIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@ -220,7 +220,7 @@
|
|||
<!-- FFTW support -->
|
||||
<ItemDefinitionGroup Condition="'$(AegisubUseFftw)'=='true'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_FFTW;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(AegisubUseConfigWindowsH)'=='false'">WITH_FFTW3;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(FftwIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
|
|
@ -17,15 +17,16 @@ m4_define([aegisub_version_data], [aegisub_version_major.aegisub_version_minor])
|
|||
# Required packages
|
||||
###################
|
||||
m4_define([curl_required_version], [7.18.2])
|
||||
m4_define([ffms_required_version], [2.15])
|
||||
m4_define([fftw_required_version], [3.3])
|
||||
m4_define([ffms2_required_version], [2.15])
|
||||
m4_define([fftw3_required_version], [3.3])
|
||||
m4_define([fontconfig_required_version], [2.4])
|
||||
m4_define([freetype_required_version], [9.7.0])
|
||||
m4_define([hunspell_required_version], [1.2.0])
|
||||
m4_define([libass_required_version], [0.9.7])
|
||||
m4_define([libpulse_required_version], [0.5])
|
||||
m4_define([lua_auto4_required_version], [5.1])
|
||||
m4_define([pkgconfig_required_version], [0.20])
|
||||
m4_define([portaudio_required_version], [19])
|
||||
m4_define([pulseaudio_required_version], [0.5])
|
||||
m4_define([wx_required_version], [2.9.2])
|
||||
|
||||
#######
|
||||
|
@ -328,7 +329,7 @@ AS_IF([test x$agi_cv_with_iconv_const = xyes],
|
|||
#######
|
||||
AC_ARG_WITH(alsa,
|
||||
AS_HELP_STRING([--without-alsa],
|
||||
[build without ALSA audio provider [auto]]))
|
||||
[build without ALSA audio player [auto]]))
|
||||
|
||||
AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA []])
|
||||
AC_ARG_VAR([ALSA_LIBS], [LIBS to use for ALSA [-lasound -lrt]])
|
||||
|
@ -345,42 +346,12 @@ AC_SUBST(ALSA_CFLAGS)
|
|||
AC_SUBST(ALSA_LIBS)
|
||||
AC_SUBST(with_alsa)
|
||||
|
||||
############
|
||||
## PortAudio
|
||||
############
|
||||
AC_ARG_WITH(portaudio,
|
||||
AS_HELP_STRING([--without-portaudio],
|
||||
[build without PortAudio v19 audio provider [auto]]))
|
||||
|
||||
AS_IF([test x$with_portaudio = xno],
|
||||
[portaudio_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= portaudio_required_version, [with_portaudio="yes"], [with_portaudio="no"])])
|
||||
|
||||
AS_IF([test x$with_portaudio = xyes], AC_DEFINE(WITH_PORTAUDIO, 1, [Enable PortAudio v19 support]))
|
||||
|
||||
AC_SUBST(with_portaudio)
|
||||
|
||||
#############
|
||||
## PulseAudio
|
||||
#############
|
||||
AC_ARG_WITH(pulseaudio,
|
||||
AS_HELP_STRING([--without-pulseaudio],
|
||||
[build without PulseAudio audio provider [auto]]))
|
||||
|
||||
AS_IF([test x$with_pulseaudio = xno],
|
||||
[pulseaudio_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(LIBPULSE, libpulse >= pulseaudio_required_version, [with_pulseaudio="yes"], [with_pulseaudio="no"])])
|
||||
|
||||
AS_IF([test x$with_pulseaudio = xyes], AC_DEFINE(WITH_PULSEAUDIO, 1, [Enable PulseAudio support]))
|
||||
|
||||
AC_SUBST(with_pulseaudio)
|
||||
|
||||
#########
|
||||
## OpenAL
|
||||
#########
|
||||
AC_ARG_WITH(openal,
|
||||
AS_HELP_STRING([--without-openal],
|
||||
[build without OpenAL audio provider [auto]]))
|
||||
[build without OpenAL audio player [auto]]))
|
||||
|
||||
AS_IF([test x$build_darwin = xyes], [
|
||||
OPENAL_LIBS="-framework OpenAL"
|
||||
|
@ -426,7 +397,7 @@ AC_SUBST(with_openal)
|
|||
AC_ARG_VAR([OSS_CFLAGS], [CFLAGS to use for OSS [auto]])
|
||||
AC_ARG_WITH(oss,
|
||||
AS_HELP_STRING([--without-oss],
|
||||
[build without OSS audio provider [auto]]))
|
||||
[build without OSS audio player [auto]]))
|
||||
|
||||
AS_IF([test x$with_oss = xno], [oss_disabled="(disabled)"], [
|
||||
AS_IF([test -z "$OSS_CFLAGS" && test -f "/etc/oss.conf"], [
|
||||
|
@ -441,60 +412,17 @@ AS_IF([test x$with_oss = xyes], AC_DEFINE(WITH_OSS, 1, [Enable OSS support]))
|
|||
AC_SUBST(with_oss)
|
||||
|
||||
###################
|
||||
# FFTW
|
||||
# Simple pkg-config stuff
|
||||
###################
|
||||
AC_ARG_WITH(fftw,
|
||||
AS_HELP_STRING([--without-fftw],
|
||||
[build without fftw support [auto]]))
|
||||
AGI_OPT_PKG(libpulse, [build without PulseAudio audio player [auto]], [Enable PulseAudio support])
|
||||
AGI_OPT_PKG(portaudio-2.0, [build without PortAudio v19 audio player [auto]], [Enable PortAudio v19 support])
|
||||
|
||||
AS_IF([test x$with_fftw = xno],
|
||||
[fftw_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(FFTW3, fftw3 >= fftw_required_version, [with_fftw="yes"], [with_fftw="no"])])
|
||||
AGI_OPT_PKG(ffms2, [build without ffms2 A/V provider [auto]], [Enable FFMS2 support])
|
||||
|
||||
AS_IF([test x$with_fftw = xyes], [AC_DEFINE(WITH_FFTW, 1, [Enable fftw support])])
|
||||
AC_SUBST(with_fftw)
|
||||
AGI_OPT_PKG(libass, [build without libass subtitle provider [auto]], [Enable libass support])
|
||||
|
||||
#########################
|
||||
# Video / Audio Providers
|
||||
#########################
|
||||
AC_ARG_WITH(ffms,
|
||||
AS_HELP_STRING([--without-ffms],
|
||||
[build without ffms2 A/V provider [auto]]))
|
||||
|
||||
AS_IF([test x$with_ffms = xno],
|
||||
[ffms_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(FFMS, ffms2 >= ffms_required_version, [with_ffms="yes"], [with_ffms="no"])])
|
||||
|
||||
AS_IF([test x$with_ffms = xyes], AC_DEFINE(WITH_FFMPEGSOURCE, 1, [Enable FFMS2 support]))
|
||||
AC_SUBST(with_ffms)
|
||||
|
||||
###################
|
||||
# Subtitle Provider
|
||||
###################
|
||||
AC_ARG_WITH(libass,
|
||||
AS_HELP_STRING([--without-libass],
|
||||
[build without libass support [auto]]))
|
||||
|
||||
AS_IF([test x$with_libass = xno],
|
||||
[libass_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version, [with_libass="yes"], [with_libass="no"])])
|
||||
|
||||
AS_IF([test x$with_libass = xyes], AC_DEFINE(WITH_LIBASS, 1, [Enable libass support]))
|
||||
AC_SUBST(with_libass)
|
||||
|
||||
###########
|
||||
## Hunspell
|
||||
###########
|
||||
AC_ARG_WITH(hunspell,
|
||||
AS_HELP_STRING([--without-hunspell],
|
||||
[build without hunspell support [auto]]))
|
||||
|
||||
AS_IF([test x$with_hunspell = xno],
|
||||
[hunspell_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(HUNSPELL, hunspell >= 1.2.0, [with_hunspell="yes"], [with_hunspell="no"])])
|
||||
|
||||
AS_IF([test x$with_hunspell = xyes], AC_DEFINE(WITH_HUNSPELL, 1, [Enable Hunspell support.]))
|
||||
AC_SUBST(with_hunspell)
|
||||
AGI_OPT_PKG(fftw3, [build without fftw support [auto]], [Enable fftw support])
|
||||
AGI_OPT_PKG(hunspell, [build without hunspell spell-checking [auto]], [Enable Hunspell support])
|
||||
|
||||
############
|
||||
# Automation
|
||||
|
@ -731,7 +659,7 @@ AS_IF([test -z "$with_player_audio"], [
|
|||
[test x$with_oss = xyes], [default_player_audio="oss"],
|
||||
[test x$with_alsa = xyes], [default_player_audio="alsa"],
|
||||
[test x$with_openal = xyes], [default_player_audio="openal"],
|
||||
[test x$with_pulseaudio = xyes], [default_player_audio="pulseaudio"])],
|
||||
[test x$with_libpulse = xyes], [default_player_audio="pulseaudio"])],
|
||||
[default_player_audio="$with_player_audio"])
|
||||
AC_DEFINE_UNQUOTED([DEFAULT_PLAYER_AUDIO], ["$default_player_audio"], [Default audio player.])
|
||||
|
||||
|
@ -765,7 +693,7 @@ AS_IF([test x"$default_player_audio" = xNONE], AC_MSG_NOTICE([
|
|||
***********************************************************************
|
||||
]))
|
||||
|
||||
AS_IF([test x$with_ffms != xyes], [AC_MSG_NOTICE([
|
||||
AS_IF([test x$with_ffms2 != xyes], [AC_MSG_NOTICE([
|
||||
|
||||
***********************************************************************
|
||||
* No supported video/audio reader interface was found on your system.
|
||||
|
@ -802,15 +730,15 @@ Audio Players
|
|||
OpenAL: $with_openal $openal_disabled
|
||||
OSS: $with_oss $oss_disabled
|
||||
PortAudio: $with_portaudio $portaudio_disabled
|
||||
PulseAudio: $with_pulseaudio $pulseaudio_disabled
|
||||
PulseAudio: $with_libpulse $libpulse_disabled
|
||||
|
||||
A/V Providers
|
||||
FFMS2: $with_ffms $ffms_disabled
|
||||
FFMS2: $with_ffms2 $ffms2_disabled
|
||||
|
||||
Subtitle Providers:
|
||||
libass $with_libass $libass_disabled
|
||||
|
||||
Misc Packages
|
||||
Hunspell: $with_hunspell $hunspell_disabled
|
||||
FFTW3: $with_fftw $fftw_disabled
|
||||
FFTW3: $with_fftw3 $fftw3_disabled
|
||||
])
|
||||
|
|
|
@ -16,7 +16,7 @@ PREDEFINED += \
|
|||
WITH_AVISYNTH \
|
||||
WITH_CSRI \
|
||||
WITH_DIRECTSOUND \
|
||||
WITH_FFMPEGSOURCE \
|
||||
WITH_FFMS2 \
|
||||
WITH_FONTCONFIG \
|
||||
WITH_FREETYPE2 \
|
||||
WITH_HUNSPELL \
|
||||
|
|
|
@ -27,3 +27,16 @@ AC_DEFUN([AC_AGI_LINK],[
|
|||
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
||||
LIBS="$aegisub_save_LIBS"
|
||||
])
|
||||
|
||||
# An optional dependency which requires pkg-config
|
||||
# Args: Name, AC_ARG_WITH help string, AC_DEFINE help string
|
||||
AC_DEFUN([AGI_OPT_PKG], [
|
||||
m4_define([varname], m4_bpatsubst([$1], [-.*], []))dnl
|
||||
m4_define([upper], m4_translit(varname, [a-z], [A-Z]))dnl
|
||||
AC_ARG_WITH(varname, AS_HELP_STRING([--without-][varname], [$2]))
|
||||
AS_IF([test x$with_]varname[ = xno],
|
||||
varname[_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(upper, $1 >= varname[]_required_version, [with_]varname[="yes"], [with_]varname[="no"])])
|
||||
AS_IF([test x$with_]varname[ = xyes], AC_DEFINE([WITH_]upper, 1, $3))
|
||||
AC_SUBST([with_]varname)
|
||||
])
|
||||
|
|
|
@ -37,7 +37,7 @@ audio_player_portaudio.o: CXXFLAGS += $(CFLAGS_PORTAUDIO)
|
|||
LIBS += $(LIBS_PORTAUDIO)
|
||||
endif
|
||||
|
||||
ifeq (yes, $(HAVE_PULSEAUDIO))
|
||||
ifeq (yes, $(HAVE_LIBPULSE))
|
||||
SRC_OPT += audio_player_pulse.cpp
|
||||
audio_player_pulse.o: CXXFLAGS += $(CFLAGS_LIBPULSE)
|
||||
LIBS += $(LIBS_LIBPULSE)
|
||||
|
@ -57,11 +57,11 @@ endif
|
|||
#######################
|
||||
# AUDIO / VIDEO SUPPORT
|
||||
#######################
|
||||
ifeq (yes, $(HAVE_FFMS))
|
||||
ifeq (yes, $(HAVE_FFMS2))
|
||||
SRC_OPT += audio_provider_ffmpegsource.cpp video_provider_ffmpegsource.cpp ffmpegsource_common.cpp
|
||||
audio_provider_ffmpegsource.o video_provider_ffmpegsource.o ffmpegsource_common.o: \
|
||||
CXXFLAGS += $(CFLAGS_FFMS)
|
||||
LIBS += $(LIBS_FFMS)
|
||||
CXXFLAGS += $(CFLAGS_FFMS2)
|
||||
LIBS += $(LIBS_FFMS2)
|
||||
endif
|
||||
|
||||
###########
|
||||
|
@ -95,13 +95,13 @@ endif
|
|||
# SOURCE-LEVEL CFLAGS
|
||||
#####################
|
||||
audio_player.o: CXXFLAGS += $(CFLAGS_ALSA) $(CFLAGS_PORTAUDIO) $(CFLAGS_LIBPULSE) $(CFLAGS_OPENAL)
|
||||
audio_provider.o: CXXFLAGS += $(CFLAGS_FFMPEGSOURCE)
|
||||
audio_provider.o: CXXFLAGS += $(CFLAGS_FFMS2)
|
||||
auto4_base.o: CXXFLAGS += $(CFLAGS_FREETYPE)
|
||||
charset_detect.o: CXXFLAGS += -D_X86_
|
||||
font_file_lister_fontconfig.o: CXXFLAGS += $(CFLAGS_FONTCONFIG) $(CFLAGS_FREETYPE)
|
||||
font_file_lister.o: CXXFLAGS += $(CFLAGS_FREETYPE)
|
||||
text_file_reader.o: CXXFLAGS += -D_X86_
|
||||
video_provider_manager.o: CXXFLAGS += $(CFLAGS_FFMS)
|
||||
video_provider_manager.o: CXXFLAGS += $(CFLAGS_FFMS2)
|
||||
|
||||
|
||||
# Ensure any optional source files above are added for compilation.
|
||||
|
|
|
@ -819,7 +819,7 @@ void AudioDisplay::ReloadRenderingSettings()
|
|||
AudioSpectrumRenderer *audio_spectrum_renderer = new AudioSpectrumRenderer(colour_scheme_name);
|
||||
|
||||
int64_t spectrum_quality = OPT_GET("Audio/Renderer/Spectrum/Quality")->GetInt();
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
// FFTW is so fast we can afford to upgrade quality by two levels
|
||||
spectrum_quality += 2;
|
||||
#endif
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#ifdef WITH_PORTAUDIO
|
||||
#include "audio_player_portaudio.h"
|
||||
#endif
|
||||
#ifdef WITH_PULSEAUDIO
|
||||
#ifdef WITH_LIBPULSE
|
||||
#include "audio_player_pulse.h"
|
||||
#endif
|
||||
#include "compat.h"
|
||||
|
@ -118,7 +118,7 @@ void AudioPlayerFactory::RegisterProviders() {
|
|||
#ifdef WITH_PORTAUDIO
|
||||
Register<PortAudioPlayer>("PortAudio");
|
||||
#endif
|
||||
#ifdef WITH_PULSEAUDIO
|
||||
#ifdef WITH_LIBPULSE
|
||||
Register<PulseAudioPlayer>("PulseAudio");
|
||||
#endif
|
||||
#ifdef WITH_OSS
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef WITH_PULSEAUDIO
|
||||
#ifdef WITH_LIBPULSE
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#include <stdio.h>
|
||||
|
@ -446,4 +446,4 @@ void PulseAudioPlayer::pa_stream_notify(pa_stream *p, PulseAudioPlayer *thread)
|
|||
thread->stream_notify.Post();
|
||||
}
|
||||
|
||||
#endif // WITH_PULSEAUDIO
|
||||
#endif // WITH_LIBPULSE
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/// @ingroup audio_output
|
||||
///
|
||||
|
||||
#ifdef WITH_PULSEAUDIO
|
||||
#ifdef WITH_LIBPULSE
|
||||
#include <pulse/pulseaudio.h>
|
||||
|
||||
#include "include/aegisub/audio_player.h"
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include "audio_provider_avs.h"
|
||||
#endif
|
||||
#include "audio_provider_convert.h"
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
#include "audio_provider_ffmpegsource.h"
|
||||
#endif
|
||||
#include "audio_provider_hd.h"
|
||||
|
@ -180,7 +180,7 @@ void AudioProviderFactory::RegisterProviders() {
|
|||
#ifdef WITH_AVISYNTH
|
||||
Register<AvisynthAudioProvider>("Avisynth");
|
||||
#endif
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
Register<FFmpegSourceAudioProvider>("FFmpegSource");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#ifdef WIN32
|
||||
|
@ -236,4 +236,4 @@ void FFmpegSourceAudioProvider::GetAudio(void *Buf, int64_t Start, int64_t Count
|
|||
throw AudioDecodeError(std::string("Failed to get audio samples: ") + ErrInfo.Buffer);
|
||||
}
|
||||
}
|
||||
#endif /* WITH_FFMPEGSOURCE */
|
||||
#endif /* WITH_FFMS2 */
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/// @ingroup audio_input ffms
|
||||
///
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
#include "include/aegisub/audio_provider.h"
|
||||
#include "ffmpegsource_common.h"
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "audio_renderer_spectrum.h"
|
||||
|
||||
#include "audio_colorscheme.h"
|
||||
#ifndef WITH_FFTW
|
||||
#ifndef WITH_FFTW3
|
||||
#include "fft.h"
|
||||
#endif
|
||||
#include "include/aegisub/audio_provider.h"
|
||||
|
@ -110,7 +110,7 @@ AudioSpectrumRenderer::AudioSpectrumRenderer(std::string const& color_scheme_nam
|
|||
, colors_inactive(new AudioColorScheme(12, color_scheme_name, AudioStyle_Inactive))
|
||||
, derivation_size(8)
|
||||
, derivation_dist(8)
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
, dft_plan(0)
|
||||
, dft_input(0)
|
||||
, dft_output(0)
|
||||
|
@ -127,7 +127,7 @@ AudioSpectrumRenderer::~AudioSpectrumRenderer()
|
|||
|
||||
void AudioSpectrumRenderer::RecreateCache()
|
||||
{
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
if (dft_plan)
|
||||
{
|
||||
fftw_destroy_plan(dft_plan);
|
||||
|
@ -144,7 +144,7 @@ void AudioSpectrumRenderer::RecreateCache()
|
|||
size_t block_count = (size_t)((provider->GetNumSamples() + (size_t)(1<<derivation_dist) - 1) >> derivation_dist);
|
||||
cache.reset(new AudioSpectrumCache(block_count, this));
|
||||
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
dft_input = fftw_alloc_real(2<<derivation_size);
|
||||
dft_output = fftw_alloc_complex(2<<derivation_size);
|
||||
dft_plan = fftw_plan_dft_r2c_1d(
|
||||
|
@ -200,7 +200,7 @@ void AudioSpectrumRenderer::FillBlock(size_t block_index, float *block)
|
|||
int64_t first_sample = ((int64_t)block_index) << derivation_dist;
|
||||
provider->GetAudio(&audio_scratch[0], first_sample, 2 << derivation_size);
|
||||
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
ConvertToFloat(2 << derivation_size, dft_input);
|
||||
|
||||
fftw_execute(dft_plan);
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <libaegisub/scoped_ptr.h>
|
||||
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
#include <fftw3.h>
|
||||
#endif
|
||||
|
||||
|
@ -101,7 +101,7 @@ class AudioSpectrumRenderer : public AudioRendererBitmapProvider {
|
|||
template<class T>
|
||||
void ConvertToFloat(size_t count, T *dest);
|
||||
|
||||
#ifdef WITH_FFTW
|
||||
#ifdef WITH_FFTW3
|
||||
/// FFTW plan data
|
||||
fftw_plan dft_plan;
|
||||
/// Pre-allocated input array for FFTW
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
// Enable ffmpegsource video and audio providers
|
||||
// Requires: FFmpegSource2 headers (in repository), loader library and DLL
|
||||
//#define WITH_FFMPEGSOURCE
|
||||
//#define WITH_FFMS2
|
||||
|
||||
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
|||
// FFTW <http://fftw.org/> is a very fast library for computing the discrete fourier transform, but is a bit
|
||||
// tricky to get working on Windows, and has the additional problem of being GPL licensed.
|
||||
// Enable this option to use FFTW to get faster rendering of the audio spectrogram
|
||||
//#define WITH_FFTW
|
||||
//#define WITH_FFTW3
|
||||
//#pragma comment(lib,libfftw.lib)
|
||||
// Specify tags the update checker accepts
|
||||
// See <http://devel.aegisub.org/wiki/Technical/UpdateChecker> for details on tags.
|
||||
|
@ -147,7 +147,7 @@
|
|||
|
||||
// Enable Pulse Audio audio player
|
||||
// Requires libpulse (and a *NIX compatible system and a running sound server to actually use)
|
||||
//#define WITH_PULSEAUDIO
|
||||
//#define WITH_LIBPULSE
|
||||
|
||||
|
||||
// Display trace-level diagnostic messages during startup
|
||||
|
|
|
@ -75,7 +75,7 @@ AboutScreen::AboutScreen(wxWindow *parent)
|
|||
#ifdef WITH_PORTAUDIO
|
||||
libString += " PortAudio - Copyright (c) Ross Bencina, Phil Burk;\n";
|
||||
#endif
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
libString += " FFmpeg - Copyright (c) Fabrice Bellard;\n";
|
||||
libString += " FFmpegSource - Copyright (c) Fredrik Mellbin;\n";
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#include <inttypes.h>
|
||||
|
@ -365,6 +365,6 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() {
|
|||
}
|
||||
|
||||
|
||||
#endif // WITH_FFMPEGSOURCE
|
||||
#endif // WITH_FFMS2
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/// @ingroup video_input audio_input ffms
|
||||
///
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#include <map>
|
||||
|
@ -95,5 +95,5 @@ public:
|
|||
wxThread::ExitCode Entry();
|
||||
};
|
||||
|
||||
#endif /* WITH_FFMPEGSOURCE */
|
||||
#endif /* WITH_FFMS2 */
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#ifdef __WINDOWS__
|
||||
|
@ -292,4 +292,4 @@ const AegiVideoFrame FFmpegSourceVideoProvider::GetFrame(int n) {
|
|||
CurFrame.SetTo(SrcFrame->Data[0], Width, Height, SrcFrame->Linesize[0]);
|
||||
return CurFrame;
|
||||
}
|
||||
#endif /* WITH_FFMPEGSOURCE */
|
||||
#endif /* WITH_FFMS2 */
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/// @ingroup video_input ffms
|
||||
///
|
||||
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
#ifndef AGI_PRE
|
||||
#include <vector>
|
||||
#endif
|
||||
|
@ -85,4 +85,4 @@ public:
|
|||
/// @return Returns true.
|
||||
bool WantsCaching() const { return true; }
|
||||
};
|
||||
#endif /* WITH_FFMPEGSOURCE */
|
||||
#endif /* WITH_FFMS2 */
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#endif
|
||||
#include "video_provider_cache.h"
|
||||
#include "video_provider_dummy.h"
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
#include "video_provider_ffmpegsource.h"
|
||||
#endif
|
||||
#include "video_provider_manager.h"
|
||||
|
@ -113,7 +113,7 @@ void VideoProviderFactory::RegisterProviders() {
|
|||
#ifdef WITH_AVISYNTH
|
||||
Register<AvisynthVideoProvider>("Avisynth");
|
||||
#endif
|
||||
#ifdef WITH_FFMPEGSOURCE
|
||||
#ifdef WITH_FFMS2
|
||||
Register<FFmpegSourceVideoProvider>("FFmpegSource");
|
||||
#endif
|
||||
Register<DummyVideoProvider>("Dummy", true);
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
#if !defined(_M_X64) && !defined(_M_IA64)
|
||||
# define WITH_AVISYNTH
|
||||
# define WITH_FFMPEGSOURCE
|
||||
# define WITH_FFMS2
|
||||
#endif
|
||||
//#define WITH_DIRECTSHOW
|
||||
//#define WITH_FFMPEG
|
||||
|
|
|
@ -93,11 +93,11 @@ def configure(conf):
|
|||
|
||||
wants_ffmpeg = False
|
||||
if Options.options.with_provider_video == 'ffmpegsource':
|
||||
conf.define('WITH_FFMPEGSOURCE', 1)
|
||||
conf.define('WITH_FFMS2', 1)
|
||||
wants_ffmpeg = True
|
||||
|
||||
if Options.options.with_provider_audio == 'ffmpegsource':
|
||||
conf.define('WITH_FFMPEGSOURCE', 1)
|
||||
conf.define('WITH_FFMS2', 1)
|
||||
wants_ffmpeg = True
|
||||
|
||||
if Options.options.with_provider_subtitle == 'libass':
|
||||
|
|
Loading…
Reference in a new issue