From 37388ebb0ef9085c841d7f94e665a5a77cfe0e92 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 16 Jul 2013 13:28:28 +0200 Subject: configure: uniform the defines to #define HAVE_xxx (0|1) The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related --- audio/decode/dec_audio.c | 2 +- audio/filter/af.c | 8 +- audio/filter/af_lavrresample.c | 8 +- audio/out/ao.c | 26 +-- audio/out/ao_oss.c | 10 +- configure | 370 ++++++++++++++++++++++------------------- demux/demux.c | 6 +- demux/demux_mkv.c | 6 +- demux/mf.c | 2 +- mpvcore/av_log.c | 18 +- mpvcore/charset_conv.c | 16 +- mpvcore/input/input.c | 20 +-- mpvcore/options.c | 76 ++++----- mpvcore/path.c | 2 +- mpvcore/player/command.c | 58 +++---- mpvcore/player/configfiles.c | 4 +- mpvcore/player/loadfile.c | 24 +-- mpvcore/player/main.c | 30 ++-- mpvcore/player/mp_lua.c | 6 +- mpvcore/player/osd.c | 2 +- mpvcore/player/playloop.c | 4 +- mpvcore/player/sub.c | 2 +- mpvcore/player/video.c | 2 +- osdep/getch2.c | 27 +-- osdep/io.c | 4 +- osdep/timer-linux.c | 2 +- stream/ai_oss.c | 4 +- stream/audio_in.c | 50 +++--- stream/audio_in.h | 18 +- stream/stream.c | 20 +-- stream/stream_radio.c | 40 ++--- stream/tv.c | 4 +- stream/tvi_v4l2.c | 8 +- sub/ass_mp.h | 4 +- sub/dec_sub.c | 2 +- video/decode/vd_lavc.c | 11 +- video/filter/vf.c | 8 +- video/fmt-conversion.c | 2 +- video/image_writer.c | 6 +- video/out/gl_common.c | 12 +- video/out/gl_common.h | 2 +- video/out/gl_header_fixes.h | 4 +- video/out/gl_lcms.c | 4 +- video/out/gl_video.c | 2 +- video/out/vo.c | 26 +-- video/out/vo_corevideo.c | 8 +- video/out/vo_vaapi.c | 2 +- video/out/vo_vdpau.c | 2 +- video/out/vo_wayland.c | 2 +- video/out/vo_x11.c | 14 +- video/out/vo_xv.c | 12 +- video/out/x11_common.c | 26 +-- 52 files changed, 528 insertions(+), 500 deletions(-) diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index c368350f71..b9ca71692f 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -46,7 +46,7 @@ extern const struct ad_functions ad_lavc; extern const struct ad_functions ad_spdif; static const struct ad_functions * const ad_drivers[] = { -#ifdef CONFIG_MPG123 +#if HAVE_MPG123 &ad_mpg123, #endif &ad_lavc, diff --git a/audio/filter/af.c b/audio/filter/af.c index c981a41288..f425cb40e3 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -65,7 +65,7 @@ static struct af_info* filter_list[] = { &af_info_pan, &af_info_surround, &af_info_sub, -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H &af_info_export, #endif &af_info_drc, @@ -74,17 +74,17 @@ static struct af_info* filter_list[] = { &af_info_lavrresample, &af_info_sweep, &af_info_hrtf, -#ifdef CONFIG_LADSPA +#if HAVE_LADSPA &af_info_ladspa, #endif &af_info_center, &af_info_sinesuppress, &af_info_karaoke, &af_info_scaletempo, -#ifdef CONFIG_LIBBS2B +#if HAVE_LIBBS2B &af_info_bs2b, #endif -#ifdef CONFIG_AF_LAVFI +#if HAVE_AF_LAVFI &af_info_lavfi, #endif // Must come last, because they're fallback format conversion filter diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index 0c2d20b8aa..f1017d62c6 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -33,10 +33,10 @@ #include "talloc.h" #include "config.h" -#if defined(CONFIG_LIBAVRESAMPLE) +#if HAVE_LIBAVRESAMPLE #include #define USE_SET_CHANNEL_MAPPING HAVE_AVRESAMPLE_SET_CHANNEL_MAPPING -#elif defined(CONFIG_LIBSWRESAMPLE) +#elif HAVE_LIBSWRESAMPLE #include #define AVAudioResampleContext SwrContext #define avresample_alloc_context swr_alloc @@ -49,7 +49,7 @@ #define avresample_set_channel_mapping swr_set_channel_mapping #define USE_SET_CHANNEL_MAPPING 1 #else -#error "config.h broken" +#error "config.h broken or no resampler found" #endif #include "mpvcore/mp_msg.h" @@ -86,7 +86,7 @@ struct af_resample { uint8_t *reorder_buffer; }; -#ifdef CONFIG_LIBAVRESAMPLE +#if HAVE_LIBAVRESAMPLE static int get_delay(struct af_resample *s) { return avresample_get_delay(s->avrctx); diff --git a/audio/out/ao.c b/audio/out/ao.c index c21e58ccf6..3f0865af22 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -50,47 +50,47 @@ extern const struct ao_driver audio_out_sdl; static const struct ao_driver * const audio_out_drivers[] = { // native: -#ifdef CONFIG_COREAUDIO +#if HAVE_COREAUDIO &audio_out_coreaudio, #endif -#ifdef CONFIG_PULSE +#if HAVE_PULSE &audio_out_pulse, #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO &audio_out_sndio, #endif -#ifdef CONFIG_ALSA +#if HAVE_ALSA &audio_out_alsa, #endif -#ifdef CONFIG_WASAPI +#if HAVE_WASAPI &audio_out_wasapi, #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO &audio_out_oss, #endif -#ifdef CONFIG_DSOUND +#if HAVE_DSOUND &audio_out_dsound, #endif -#ifdef CONFIG_PORTAUDIO +#if HAVE_PORTAUDIO &audio_out_portaudio, #endif // wrappers: -#ifdef CONFIG_JACK +#if HAVE_JACK &audio_out_jack, #endif -#ifdef CONFIG_OPENAL +#if HAVE_OPENAL &audio_out_openal, #endif -#ifdef CONFIG_SDL +#if HAVE_SDL || HAVE_SDL2 &audio_out_sdl, #endif &audio_out_null, // should not be auto-selected: &audio_out_pcm, -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING &audio_out_lavc, #endif -#ifdef CONFIG_RSOUND +#if HAVE_RSOUND &audio_out_rsound, #endif NULL diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index ed1b9468ef..c22d15211f 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -38,10 +38,10 @@ #include "mpvcore/options.h" #include "mpvcore/mp_msg.h" -#ifdef HAVE_SYS_SOUNDCARD_H +#if HAVE_SYS_SOUNDCARD_H #include #else -#ifdef HAVE_SOUNDCARD_H +#if HAVE_SOUNDCARD_H #include #endif #endif @@ -349,7 +349,7 @@ ac3_retry: // Measuring buffer size: void *data; p->buffersize = 0; -#ifdef HAVE_AUDIO_SELECT +#if HAVE_AUDIO_SELECT data = malloc(p->outburst); memset(data, 0, p->outburst); while (p->buffersize < 0x40000) { @@ -367,7 +367,7 @@ ac3_retry: free(data); if (p->buffersize == 0) { MP_ERR(ao, "*** Your audio driver DOES NOT support select() ***\n"); - MP_ERR(ao, "Recompile mpv with #undef HAVE_AUDIO_SELECT in config.h!\n"); + MP_ERR(ao, "Recompile mpv with #define HAVE_AUDIO_SELECT 0 in config.h!\n"); return -1; } #endif @@ -456,7 +456,7 @@ static int get_space(struct ao *ao) #endif // check buffer -#ifdef HAVE_AUDIO_SELECT +#if HAVE_AUDIO_SELECT { fd_set rfds; struct timeval tv; diff --git a/configure b/configure index a15e08bca5..2b31424daa 100755 --- a/configure +++ b/configure @@ -494,7 +494,7 @@ libavdevice=auto _stream_cache=yes _priority=no def_dos_paths="#define HAVE_DOS_PATHS 0" -def_priority="#undef CONFIG_PRIORITY" +def_priority="#define HAVE_PRIORITY 0" _build_man=auto _build_pdf=auto _build_date=yes @@ -904,7 +904,7 @@ if win32 ; then _timer=timer-win2.c _priority=yes def_dos_paths="#define HAVE_DOS_PATHS 1" - def_priority="#define CONFIG_PRIORITY 1" + def_priority="#define HAVE_PRIORITY 1" fi if mingw32 ; then @@ -1255,7 +1255,7 @@ statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes if test "$_nanosleep" = yes ; then def_nanosleep='#define HAVE_NANOSLEEP 1' else - def_nanosleep='#undef HAVE_NANOSLEEP' + def_nanosleep='#define HAVE_NANOSLEEP 0' fi echores "$_nanosleep" @@ -1266,7 +1266,7 @@ statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes if test "$_mman" = yes ; then def_mman_h='#define HAVE_SYS_MMAN_H 1' else - def_mman_h='#undef HAVE_SYS_MMAN_H' + def_mman_h='#define HAVE_SYS_MMAN_H 0' fi echores "$_mman" @@ -1279,7 +1279,7 @@ done if test "$_dl" = yes ; then def_dl='#define HAVE_LIBDL 1' else - def_dl='#undef HAVE_LIBDL' + def_dl='#define HAVE_LIBDL 0' fi echores "$_dl" @@ -1319,7 +1319,7 @@ if test "$_pthreads" = yes ; then extra_cflags="$extra_cflags $THREAD_CFLAGS" else res_comment="v4l2 disabled" - def_pthreads='#undef HAVE_PTHREADS' + def_pthreads='#define HAVE_PTHREADS 0' _tv_v4l2=no fi echores "$_pthreads" @@ -1343,9 +1343,9 @@ fi echocheck "stream cache" _stream_cache="$_pthreads" if test "$_stream_cache" = yes ; then - def_stream_cache='#define CONFIG_STREAM_CACHE' + def_stream_cache='#define HAVE_STREAM_CACHE 1' else - def_stream_cache='#undef CONFIG_STREAM_CACHE' + def_stream_cache='#define HAVE_STREAM_CACHE 0' fi echores "$_stream_cache" @@ -1402,17 +1402,17 @@ EOF fi fi if test "$_iconv" = yes ; then - def_iconv='#define CONFIG_ICONV 1' + def_iconv='#define HAVE_ICONV 1' else - def_iconv='#undef CONFIG_ICONV' + def_iconv='#define HAVE_ICONV 0' fi echores "$_iconv" echocheck "soundcard.h" _soundcard_h=no -def_soundcard_h='#undef HAVE_SOUNDCARD_H' -def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H' +def_soundcard_h='#define HAVE_SOUNDCARD_H 0' +def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 0' for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do header_check $_soundcard_header && _soundcard_h=yes && res_comment="$_soundcard_header" && break @@ -1430,7 +1430,7 @@ echores "$_soundcard_h" echocheck "sys/videoio.h" sys_videoio_h=no -def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H' +def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 0' header_check sys/videoio.h && sys_videoio_h=yes && def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1' echores "$sys_videoio_h" @@ -1452,7 +1452,7 @@ if test "$_terminfo" = yes ; then _termcap=yes # terminfo provides termcap fi else - def_terminfo='#undef HAVE_TERMINFO' + def_terminfo='#define HAVE_TERMINFO 0' fi echores "$_terminfo" @@ -1469,15 +1469,15 @@ if test "$_termcap" = yes ; then def_termcap='#define HAVE_TERMCAP 1' test $_ld_tmp && res_comment="using $_ld_tmp" else - def_termcap='#undef HAVE_TERMCAP' + def_termcap='#define HAVE_TERMCAP 0' fi echores "$_termcap" echocheck "termios" -def_termios='#undef HAVE_TERMIOS' -def_termios_h='#undef HAVE_TERMIOS_H' -def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H' +def_termios='#define HAVE_TERMIOS 0' +def_termios_h='#define HAVE_TERMIOS_H 0' +def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 0' if test "$_termios" = auto ; then _termios=no for _termios_header in "termios.h" "sys/termios.h"; do @@ -1505,7 +1505,7 @@ fi if test "$_shm" = yes ; then def_shm='#define HAVE_SHM 1' else - def_shm='#undef HAVE_SHM' + def_shm='#define HAVE_SHM 0' fi echores "$_shm" @@ -1521,7 +1521,7 @@ cat > $TMPC << EOF int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; } EOF _posix_select=no -def_posix_select='#undef HAVE_POSIX_SELECT' +def_posix_select='#define HAVE_POSIX_SELECT 0' cc_check && _posix_select=yes && def_posix_select='#define HAVE_POSIX_SELECT 1' echores "$_posix_select" @@ -1529,7 +1529,7 @@ echores "$_posix_select" echocheck "audio select()" if test "$_select" = no ; then - def_select='#undef HAVE_AUDIO_SELECT' + def_select='#define HAVE_AUDIO_SELECT 0' elif test "$_select" = yes ; then def_select='#define HAVE_AUDIO_SELECT 1' fi @@ -1543,7 +1543,7 @@ need_glob=no if test "$_glob" = yes ; then def_glob='#define HAVE_GLOB 1' else - def_glob='#undef HAVE_GLOB' + def_glob='#define HAVE_GLOB 0' # HACK! need_glob currently enables compilation of a # win32-specific glob()-replacement. # Other OS neither need it nor can they use it (mf:// is disabled for them). @@ -1565,7 +1565,7 @@ statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo if test "$_sys_sysinfo" = yes ; then def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1' else - def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H' + def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 0' fi echores "$_sys_sysinfo" @@ -1590,9 +1590,9 @@ if test "$_libguess" = auto ; then fi fi if test "$_libguess" = yes; then - def_libguess="#define CONFIG_LIBGUESS 1" + def_libguess="#define HAVE_LIBGUESS 1" else - def_libguess="#undef CONFIG_LIBGUESS" + def_libguess="#define HAVE_LIBGUESS 0" fi echores "$_libguess" @@ -1605,10 +1605,10 @@ if test "$_smb" = auto ; then fi fi if test "$_smb" = yes; then - def_smb="#define CONFIG_LIBSMBCLIENT 1" + def_smb="#define HAVE_LIBSMBCLIENT 1" inputmodules="smb $inputmodules" else - def_smb="#undef CONFIG_LIBSMBCLIENT" + def_smb="#define HAVE_LIBSMBCLIENT 0" noinputmodules="smb $noinputmodules" fi echores "$_smb" @@ -1622,9 +1622,9 @@ if test "$_libquvi4" = auto ; then fi fi if test "$_libquvi4" = yes; then - def_libquvi4="#define CONFIG_LIBQUVI 1" + def_libquvi4="#define HAVE_LIBQUVI4 1" else - def_libquvi4="#undef CONFIG_LIBQUVI" + def_libquvi4="#define HAVE_LIBQUVI4 0" fi echores "$_libquvi4" @@ -1640,9 +1640,9 @@ if test "$_libquvi9" = auto ; then fi fi if test "$_libquvi9" = yes; then - def_libquvi9="#define CONFIG_LIBQUVI9 1" + def_libquvi9="#define HAVE_LIBQUVI9 1" else - def_libquvi9="#undef CONFIG_LIBQUVI9" + def_libquvi9="#define HAVE_LIBQUVI9 0" fi echores "$_libquvi9" @@ -1668,9 +1668,9 @@ fi if test "$_cocoa" = yes ; then libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa -framework OpenGL" extra_ldflags="$extra_ldflags -fobjc-arc" # needed for OS X 10.7 - def_cocoa='#define CONFIG_COCOA 1' + def_cocoa='#define HAVE_COCOA 1' else - def_cocoa='#undef CONFIG_COCOA' + def_cocoa='#define HAVE_COCOA 0' fi echores "$_cocoa" @@ -1686,10 +1686,10 @@ fi if test "$_corevideo" = yes ; then vomodules="corevideo $vomodules" libs_mplayer="$libs_mplayer -framework QuartzCore" - def_corevideo='#define CONFIG_COREVIDEO 1' + def_corevideo='#define HAVE_COREVIDEO 1' else novomodules="corevideo $novomodules" - def_corevideo='#undef CONFIG_COREVIDEO' + def_corevideo='#define HAVE_COREVIDEO 0' fi echores "$_corevideo" @@ -1697,6 +1697,9 @@ depends_on_application_services(){ test "$_corevideo" = yes } +else + def_cocoa='#define HAVE_COCOA 0' + def_corevideo='#define HAVE_COREVIDEO 0' fi #if darwin _wlver="1.2.0" @@ -1708,11 +1711,11 @@ if test "$_wayland" = yes || test "$_wayland" = auto; then fi if test "$_wayland" = yes; then res_comment="" - def_wayland='#define CONFIG_WAYLAND' + def_wayland='#define HAVE_WAYLAND' vomodules="wayland $vomodules" else res_comment="version >= $_wlver" - def_wayland='#undef CONFIG_WAYLAND' + def_wayland='#define HAVE_WAYLAND 0' novomodules="wayland $novomodules" fi echores "$_wayland" @@ -1770,11 +1773,11 @@ if test "$_x11" = auto && test "$_x11_headers" = yes ; then done fi if test "$_x11" = yes ; then - def_x11='#define CONFIG_X11 1' + def_x11='#define HAVE_X11 1' vomodules="x11 $vomodules" else _x11=no - def_x11='#undef CONFIG_X11' + def_x11='#define HAVE_X11 0' novomodules="x11 $novomodules" res_comment="check if the dev(el) packages are installed" fi @@ -1786,10 +1789,10 @@ if test "$_xss" = auto ; then statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes fi if test "$_xss" = yes ; then - def_xss='#define CONFIG_XSS 1' + def_xss='#define HAVE_XSS 1' libs_mplayer="$libs_mplayer -lXss" else - def_xss='#undef CONFIG_XSS' + def_xss='#define HAVE_XSS 0' fi echores "$_xss" @@ -1809,16 +1812,16 @@ EOF statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes fi if test "$_xdpms4" = yes ; then - def_xdpms='#define CONFIG_XDPMS 1' + def_xdpms='#define HAVE_XDPMS 1' res_comment="using Xdpms 4" echores "yes" elif test "$_xdpms3" = yes ; then - def_xdpms='#define CONFIG_XDPMS 1' + def_xdpms='#define HAVE_XDPMS 1' libs_mplayer="$libs_mplayer -lXdpms" res_comment="using Xdpms 3" echores "yes" else - def_xdpms='#undef CONFIG_XDPMS' + def_xdpms='#define HAVE_XDPMS 0' echores "no" fi @@ -1830,11 +1833,11 @@ if test "$_xv" = auto && test "$_x11" = yes ; then fi if test "$_xv" = yes ; then - def_xv='#define CONFIG_XV 1' + def_xv='#define HAVE_XV 1' libs_mplayer="$libs_mplayer -lXv" vomodules="xv $vomodules" else - def_xv='#undef CONFIG_XV' + def_xv='#define HAVE_XV 0' novomodules="xv $novomodules" fi echores "$_xv" @@ -1848,10 +1851,10 @@ if test "$_vdpau" = auto && test "$_x11" = yes ; then fi fi if test "$_vdpau" = yes ; then - def_vdpau='#define CONFIG_VDPAU 1' + def_vdpau='#define HAVE_VDPAU 1' vomodules="vdpau $vomodules" else - def_vdpau='#define CONFIG_VDPAU 0' + def_vdpau='#define HAVE_VDPAU 0' novomodules="vdpau $novomodules" fi echores "$_vdpau" @@ -1859,7 +1862,7 @@ echores "$_vdpau" echocheck "VAAPI" _vaapi_vpp=no -def_vaapi_vpp='#define CONFIG_VAAPI_VPP 0' +def_vaapi_vpp='#define HAVE_VAAPI_VPP 0' if test "$_vaapi" = auto && test "$_x11" = yes ; then _vaapi=no if test "$_dl" = yes ; then @@ -1867,10 +1870,12 @@ if test "$_vaapi" = auto && test "$_x11" = yes ; then fi fi if test "$_vaapi" = yes ; then - def_vaapi='#define CONFIG_VAAPI 1' + def_vaapi='#define HAVE_VAAPI 1' + def_vaapi_hwaccel='#define HAVE_VAAPI_HWACCEL 1' vomodules="vaapi $vomodules" else - def_vaapi='#define CONFIG_VAAPI 0' + def_vaapi='#define HAVE_VAAPI 0' + def_vaapi_hwaccel='#define HAVE_VAAPI_HWACCEL 0' novomodules="vaapi $novomodules" fi echores "$_vaapi" @@ -1879,7 +1884,7 @@ if test "$_vaapi" = yes ; then echocheck "VAAPI VPP" if pkg-config 'libva >= 0.34.0' ; then _vaapi_vpp=yes - def_vaapi_vpp='#define CONFIG_VAAPI_VPP 1' + def_vaapi_vpp='#define HAVE_VAAPI_VPP 1' fi echores "$_vaapi_vpp" fi @@ -1892,10 +1897,10 @@ if test "$_xinerama" = auto && test "$_x11" = yes ; then fi if test "$_xinerama" = yes ; then - def_xinerama='#define CONFIG_XINERAMA 1' + def_xinerama='#define HAVE_XINERAMA 1' libs_mplayer="$libs_mplayer -lXinerama" else - def_xinerama='#undef CONFIG_XINERAMA' + def_xinerama='#define HAVE_XINERAMA 0' fi echores "$_xinerama" @@ -1911,10 +1916,10 @@ if test "$_vm" = auto && test "$_x11" = yes ; then statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes fi if test "$_vm" = yes ; then - def_vm='#define CONFIG_XF86VM 1' + def_vm='#define HAVE_XF86VM 1' libs_mplayer="$libs_mplayer -lXxf86vm" else - def_vm='#undef CONFIG_XF86VM' + def_vm='#define HAVE_XF86VM 0' fi echores "$_vm" @@ -1928,9 +1933,9 @@ if test "$_xf86keysym" = auto && test "$_x11" = yes ; then return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes fi if test "$_xf86keysym" = yes ; then - def_xf86keysym='#define CONFIG_XF86XK 1' + def_xf86keysym='#define HAVE_XF86XK 1' else - def_xf86keysym='#undef CONFIG_XF86XK' + def_xf86keysym='#define HAVE_XF86XK 0' fi echores "$_xf86keysym" @@ -1941,10 +1946,10 @@ if test "$_caca" = auto ; then pkg_config_add 'caca >= 0.99.beta18' && _caca=yes fi if test "$_caca" = yes ; then - def_caca='#define CONFIG_CACA 1' + def_caca='#define HAVE_CACA 1' vomodules="caca $vomodules" else - def_caca='#undef CONFIG_CACA' + def_caca='#define HAVE_CACA 0' novomodules="caca $novomodules" fi echores "$_caca" @@ -1974,13 +1979,13 @@ echores "$_dvb" if test "$_dvb" = yes ; then _dvbin=yes inputmodules="dvb $inputmodules" - def_dvb='#define CONFIG_DVB 1' - def_dvbin='#define CONFIG_DVBIN 1' + def_dvb='#define HAVE_DVB 1' + def_dvbin='#define HAVE_DVBIN 1' else _dvbin=no noinputmodules="dvb $noinputmodules" - def_dvb='#undef CONFIG_DVB' - def_dvbin='#undef CONFIG_DVBIN ' + def_dvb='#define HAVE_DVB 0' + def_dvbin='#define HAVE_DVBIN 0 ' fi @@ -1991,10 +1996,10 @@ if test "$_mng" = auto ; then fi echores "$_mng" if test "$_mng" = yes ; then - def_mng='#define CONFIG_MNG 1' + def_mng='#define HAVE_MNG 1' libs_mplayer="$libs_mplayer -lmng -lz" else - def_mng='#undef CONFIG_MNG' + def_mng='#define HAVE_MNG 0' fi echocheck "JPEG support" @@ -2005,10 +2010,10 @@ fi echores "$_jpeg" if test "$_jpeg" = yes ; then - def_jpeg='#define CONFIG_JPEG 1' + def_jpeg='#define HAVE_JPEG 1' libs_mplayer="$libs_mplayer -ljpeg" else - def_jpeg='#undef CONFIG_JPEG' + def_jpeg='#define HAVE_JPEG 0' fi @@ -2095,37 +2100,40 @@ EOF else _gl=no fi + +def_gl_cocoa='#define HAVE_GL_COCOA 0' +def_gl_win32='#define HAVE_GL_WIN32 0' +def_gl_x11='#define HAVE_GL_X11 0' +def_gl_wayland='#define HAVE_GL_WAYLAND 0' + if test "$_gl" = yes ; then - def_gl='#define CONFIG_GL 1' + def_gl='#define HAVE_GL 1' res_comment="backends:" if test "$_gl_cocoa" = yes ; then - def_gl_cocoa='#define CONFIG_GL_COCOA 1' + def_gl_cocoa='#define HAVE_GL_COCOA 1' res_comment="$res_comment cocoa" fi if test "$_gl_win32" = yes ; then - def_gl_win32='#define CONFIG_GL_WIN32 1' + def_gl_win32='#define HAVE_GL_WIN32 1' res_comment="$res_comment win32" fi if test "$_gl_x11" = yes ; then - def_gl_x11='#define CONFIG_GL_X11 1' + def_gl_x11='#define HAVE_GL_X11 1' res_comment="$res_comment x11" fi if test "$_gl_wayland" = yes ; then - def_gl_wayland='#define CONFIG_GL_WAYLAND' + def_gl_wayland='#define HAVE_GL_WAYLAND' res_comment="$res_comment wayland" fi vomodules="opengl $vomodules" else - def_gl='#undef CONFIG_GL' - def_gl_cocoa='#undef CONFIG_GL_COCOA' - def_gl_win32='#undef CONFIG_GL_WIN32' - def_gl_x11='#undef CONFIG_GL_X11' - def_gl_wayland='#undef CONFIG_GL_WAYLAND' + def_gl='#define HAVE_GL 0' novomodules="opengl $novomodules" fi echores "$_gl" + if win32; then @@ -2135,10 +2143,10 @@ if test "$_direct3d" = auto ; then header_check d3d9.h && _direct3d=yes fi if test "$_direct3d" = yes ; then - def_direct3d='#define CONFIG_DIRECT3D 1' + def_direct3d='#define HAVE_DIRECT3D 1' vomodules="direct3d $vomodules" else - def_direct3d='#undef CONFIG_DIRECT3D' + def_direct3d='#define HAVE_DIRECT3D 0' novomodules="direct3d $novomodules" fi echores "$_direct3d" @@ -2150,10 +2158,10 @@ if test "$_dsound" = auto ; then header_check dsound.h && _dsound=yes fi if test "$_dsound" = yes ; then - def_dsound='#define CONFIG_DSOUND 1' + def_dsound='#define HAVE_DSOUND 1' aomodules="dsound $aomodules" else - def_dsound='#undef CONFIG_DSOUND' + def_dsound='#define HAVE_DSOUND 0' noaomodules="dsound $noaomodules" fi echores "$_dsound" @@ -2190,15 +2198,19 @@ fi fi if test "$_wasapi" = yes ; then - def_wasapi='#define CONFIG_WASAPI 1' + def_wasapi='#define HAVE_WASAPI 1' aomodules="wasapi $aomodules" libs_mplayer="$libs_mplayer -lole32" else - def_wasapi='#undef CONFIG_WASAPI' + def_wasapi='#define HAVE_WASAPI 0' noaomodules="wasapi $noaomodules" fi echores "$_wasapi" +else + def_direct3d='#define HAVE_DIRECT3D 0' + def_dsound='#define HAVE_DSOUND 0' + def_wasapi='#define HAVE_WASAPI 0' fi #if win32; then @@ -2208,24 +2220,24 @@ if test "$_sdl2" = yes ; then fi if test "$_sdl2" = yes ; then _sdl=yes # sdl2 implies sdl - def_sdl='#define CONFIG_SDL 1' - def_sdl2='#define CONFIG_SDL2 1' + def_sdl='#define HAVE_SDL 1' + def_sdl2='#define HAVE_SDL2 1' vomodules="sdl $vomodules" aomodules="sdl $aomodules" echores "$_sdl2" else - def_sdl2='#undef CONFIG_SDL2' + def_sdl2='#define HAVE_SDL2 0' echores "$_sdl2" echocheck "SDL" if test "$_sdl" = yes ; then pkg_config_add 'sdl' && _sdl=yes fi if test "$_sdl" = yes ; then - def_sdl='#define CONFIG_SDL 1' + def_sdl='#define HAVE_SDL 1' novomodules="sdl $novomodules" aomodules="sdl $aomodules" else - def_sdl='#undef CONFIG_SDL' + def_sdl='#define HAVE_SDL 0' novomodules="sdl $novomodules" noaomodules="sdl $noaomodules" fi @@ -2246,7 +2258,7 @@ if test "$_ossaudio" = auto ; then return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes fi if test "$_ossaudio" = yes ; then - def_ossaudio='#define CONFIG_OSS_AUDIO 1' + def_ossaudio='#define HAVE_OSS_AUDIO 1' aomodules="oss $aomodules" cat > $TMPC << EOF #include <$_soundcard_header> @@ -2277,7 +2289,7 @@ EOF fi def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"' else - def_ossaudio='#undef CONFIG_OSS_AUDIO' + def_ossaudio='#define HAVE_OSS_AUDIO 0' def_ossaudio_devdsp='#define PATH_DEV_DSP ""' def_ossaudio_devmixer='#define PATH_DEV_MIXER ""' noaomodules="oss $noaomodules" @@ -2293,11 +2305,11 @@ fi echores "$_rsound" if test "$_rsound" = yes ; then - def_rsound='#define CONFIG_RSOUND 1' + def_rsound='#define HAVE_RSOUND 1' aomodules="rsound $aomodules" libs_mplayer="$libs_mplayer -lrsound" else - def_rsound='#undef CONFIG_RSOUND' + def_rsound='#define HAVE_RSOUND 0' noaomodules="rsound $noaomodules" fi @@ -2310,11 +2322,11 @@ fi echores "$_sndio" if test "$_sndio" = yes ; then - def_sndio='#define CONFIG_SNDIO 1' + def_sndio='#define HAVE_SNDIO 1' aomodules="sndio $_aomodules" libs_mplayer="$libs_mplayer -lsndio" else - def_sndio='#undef CONFIG_SNDIO' + def_sndio='#define HAVE_SNDIO 0' noaomodules="sndio $_noaomodules" fi @@ -2329,10 +2341,10 @@ fi echores "$_pulse" if test "$_pulse" = yes ; then - def_pulse='#define CONFIG_PULSE 1' + def_pulse='#define HAVE_PULSE 1' aomodules="pulse $aomodules" else - def_pulse='#undef CONFIG_PULSE' + def_pulse='#define HAVE_PULSE 0' noaomodules="pulse $noaomodules" fi @@ -2351,10 +2363,10 @@ fi echores "$_portaudio" if test "$_portaudio" = yes ; then - def_portaudio='#define CONFIG_PORTAUDIO 1' + def_portaudio='#define HAVE_PORTAUDIO 1' aomodules="portaudio $aomodules" else - def_portaudio='#undef CONFIG_PORTAUDIO' + def_portaudio='#define HAVE_PORTAUDIO 0' noaomodules="portaudio $noaomodules" fi @@ -2368,7 +2380,7 @@ if test "$_jack" = auto ; then fi if test "$_jack" = yes ; then - def_jack='#define CONFIG_JACK 1' + def_jack='#define HAVE_JACK 1' aomodules="jack $aomodules" else noaomodules="jack $noaomodules" @@ -2386,10 +2398,10 @@ fi echores "$_openal" if test "$_openal" = yes ; then - def_openal='#define CONFIG_OPENAL 1' + def_openal='#define HAVE_OPENAL 1' aomodules="openal $aomodules" else - def_openal='#undef CONFIG_OPENAL' + def_openal='#define HAVE_OPENAL 0' noaomodules="openal $noaomodules" fi @@ -2401,10 +2413,10 @@ if test "$_alsa" = auto ; then _alsa=yes fi fi -def_alsa='#undef CONFIG_ALSA' +def_alsa='#define HAVE_ALSA 0' if test "$_alsa" = yes ; then aomodules="alsa $aomodules" - def_alsa='#define CONFIG_ALSA 1' + def_alsa='#define HAVE_ALSA 1' else noaomodules="alsa $noaomodules" fi @@ -2425,10 +2437,10 @@ EOF fi if test "$_coreaudio" = yes ; then libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox" - def_coreaudio='#define CONFIG_COREAUDIO 1' + def_coreaudio='#define HAVE_COREAUDIO 1' aomodules="coreaudio $aomodules" else - def_coreaudio='#undef CONFIG_COREAUDIO' + def_coreaudio='#define HAVE_COREAUDIO 0' noaomodules="coreaudio $noaomodules" fi echores $_coreaudio @@ -2470,9 +2482,9 @@ if test "$_vcd" = auto; then fi if test "$_vcd" = yes; then inputmodules="vcd $inputmodules" - def_vcd='#define CONFIG_VCD 1' + def_vcd='#define HAVE_VCD 1' else - def_vcd='#undef CONFIG_VCD' + def_vcd='#define HAVE_VCD 0' noinputmodules="vcd $noinputmodules" res_comment="not supported on this OS" fi @@ -2486,10 +2498,10 @@ if test "$_bluray" = auto ; then pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes fi if test "$_bluray" = yes ; then - def_bluray='#define CONFIG_LIBBLURAY 1' + def_bluray='#define HAVE_LIBBLURAY 1' inputmodules="bluray $inputmodules" else - def_bluray='#undef CONFIG_LIBBLURAY' + def_bluray='#define HAVE_LIBBLURAY 0' noinputmodules="bluray $noinputmodules" fi echores "$_bluray" @@ -2501,10 +2513,10 @@ if test "$_dvdread" = auto ; then pkg_config_add 'dvdread >= 4.1.0' && _dvdread=yes fi if test "$_dvdread" = yes ; then - def_dvdread='#define CONFIG_DVDREAD 1' + def_dvdread='#define HAVE_DVDREAD 1' inputmodules="dvdread $inputmodules" else - def_dvdread='#undef CONFIG_DVDREAD' + def_dvdread='#define HAVE_DVDREAD 0' noinputmodules="dvdread $noinputmodules" fi echores "$_dvdread" @@ -2519,12 +2531,12 @@ if test "$_libcdio" = auto ; then fi if test "$_libcdio" = yes ; then _cdda='yes' - def_cdda='#define CONFIG_CDDA 1' + def_cdda='#define HAVE_CDDA 1' inputmodules="cdda $inputmodules" else _libcdio=no _cdda='no' - def_cdda='#undef CONFIG_CDDA' + def_cdda='#define HAVE_CDDA 0' noinputmodules="cdda $noinputmodules" fi echores "$_libcdio" @@ -2534,12 +2546,12 @@ echocheck "SSA/ASS support" if test "$_ass" = auto ; then if pkg_config_add libass ; then _ass=yes - def_ass='#define CONFIG_ASS 1' + def_ass='#define HAVE_LIBASS 1' else die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass." fi else - def_ass='#undef CONFIG_ASS' + def_ass='#define HAVE_LIBASS 0' fi echores "$_ass" @@ -2562,10 +2574,10 @@ if test "$_enca" = auto ; then statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes fi if test "$_enca" = yes ; then - def_enca='#define CONFIG_ENCA 1' + def_enca='#define HAVE_ENCA 1' libs_mplayer="$libs_mplayer -lenca" else - def_enca='#undef CONFIG_ENCA' + def_enca='#define HAVE_ENCA 0' fi echores "$_enca" @@ -2574,7 +2586,7 @@ echocheck "zlib" _zlib=no statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes if test "$_zlib" = yes ; then - def_zlib='#define CONFIG_ZLIB 1' + def_zlib='#define HAVE_ZLIB 1' libs_mplayer="$libs_mplayer -lz" else die "Unable to find development files for zlib." @@ -2585,13 +2597,13 @@ echores "$_zlib" # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine. # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though. echocheck "mpg123 support" -def_mpg123='#undef CONFIG_MPG123' +def_mpg123='#define HAVE_MPG123 0' if test "$_mpg123" = auto; then _mpg123=no pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes fi if test "$_mpg123" = yes ; then - def_mpg123='#define CONFIG_MPG123 1' + def_mpg123='#define HAVE_MPG123 1' codecmodules="mpg123 $codecmodules" else nocodecmodules="mpg123 $nocodecmodules" @@ -2607,9 +2619,9 @@ if test "$_ladspa" = auto ; then fi fi if test "$_ladspa" = yes; then - def_ladspa="#define CONFIG_LADSPA 1" + def_ladspa="#define HAVE_LADSPA 1" else - def_ladspa="#undef CONFIG_LADSPA" + def_ladspa="#define HAVE_LADSPA 0" fi echores "$_ladspa" @@ -2621,8 +2633,8 @@ if test "$_libbs2b" = auto ; then _libbs2b=yes fi fi -def_libbs2b="#undef CONFIG_LIBBS2B" -test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1" +def_libbs2b="#define HAVE_LIBBS2B 0" +test "$_libbs2b" = yes && def_libbs2b="#define HAVE_LIBBS2B 1" echores "$_libbs2b" @@ -2634,9 +2646,9 @@ if test "$_lcms2" = auto ; then fi fi if test "$_lcms2" = yes; then - def_lcms2="#define CONFIG_LCMS2 1" + def_lcms2="#define HAVE_LCMS2 1" else - def_lcms2="#undef CONFIG_LCMS2" + def_lcms2="#define HAVE_LCMS2 0" fi echores "$_lcms2" @@ -2656,12 +2668,16 @@ _resampler=no _avresample=no _avresample_has_set_channel_mapping=no + +def_libswresample='#define HAVE_LIBSWRESAMPLE 0' +def_libavresample='#define HAVE_LIBAVRESAMPLE 0' + echocheck "libavresample >= 1.0.0" if test "$_disable_avresample" = no ; then if pkg_config_add "libavresample >= 1.0.0" ; then _resampler=yes _avresample=yes - def_resampler='#define CONFIG_LIBAVRESAMPLE' + def_libavresample='#define HAVE_LIBAVRESAMPLE 1' fi fi echores "$_resampler" @@ -2677,7 +2693,7 @@ if test "$_resampler" = no ; then echocheck "libswresample >= 0.17.102" if pkg_config_add "libswresample >= 0.17.102" ; then _resampler=yes - def_resampler='#define CONFIG_LIBSWRESAMPLE' + def_libswresample='#define HAVE_LIBSWRESAMPLE 1' fi echores "$_resampler" fi @@ -2698,9 +2714,9 @@ echocheck "libavcodec new vdpau API" _avcodec_new_vdpau_api=no statement_check libavutil/pixfmt.h 'int x = AV_PIX_FMT_VDPAU' && _avcodec_new_vdpau_api=yes if test "$_avcodec_new_vdpau_api" = yes ; then - def_avcodec_new_vdpau_api='#define HAVE_AV_CODEC_NEW_VDPAU_API 1' + def_avcodec_new_vdpau_api='#define HAVE_AVCODEC_NEW_VDPAU_API 1' else - def_avcodec_new_vdpau_api='#define HAVE_AV_CODEC_NEW_VDPAU_API 0' + def_avcodec_new_vdpau_api='#define HAVE_AVCODEC_NEW_VDPAU_API 0' fi echores "$_avcodec_new_vdpau_api" @@ -2709,9 +2725,16 @@ _vdpau_dec_old=no if test "$_vdpau" = yes ; then if test "$_avcodec_new_vdpau_api" = yes ; then _vdpau_dec=yes + def_vdpau_dec='#define HAVE_VDPAU_HWACCEL 1' + def_vdpau_dec_old='#define HAVE_VDPAU_DECODER 0' else _vdpau_dec_old=yes + def_vdpau_dec='#define HAVE_VDPAU_HWACCEL 0' + def_vdpau_dec_old='#define HAVE_VDPAU_DECODER 1' fi +else + def_vdpau_dec='#define HAVE_VDPAU_HWACCEL 0' + def_vdpau_dec_old='#define HAVE_VDPAU_DECODER 0' fi @@ -2770,9 +2793,9 @@ EOF fi fi if test "$libavfilter" = yes ; then - def_libavfilter='#define CONFIG_LIBAVFILTER 1' + def_libavfilter='#define HAVE_LIBAVFILTER 1' else - def_libavfilter='#undef CONFIG_LIBAVFILTER' + def_libavfilter='#define HAVE_LIBAVFILTER 0' fi echores "$libavfilter" @@ -2789,9 +2812,9 @@ if test "$vf_lavfi" = auto ; then fi fi if test "$vf_lavfi" = yes ; then - def_vf_lavfi='#define CONFIG_VF_LAVFI 1' + def_vf_lavfi='#define HAVE_VF_LAVFI 1' else - def_vf_lavfi='#undef CONFIG_VF_LAVFI' + def_vf_lavfi='#define HAVE_VF_LAVFI 0' fi echores "$vf_lavfi" @@ -2814,9 +2837,9 @@ if test "$af_lavfi" = auto ; then fi fi if test "$af_lavfi" = yes ; then - def_af_lavfi='#define CONFIG_AF_LAVFI 1' + def_af_lavfi='#define HAVE_AF_LAVFI 1' else - def_af_lavfi='#undef CONFIG_AF_LAVFI' + def_af_lavfi='#define HAVE_AF_LAVFI 0' fi echores "$af_lavfi" @@ -2830,9 +2853,9 @@ if test "$libavdevice" = auto ; then fi fi if test "$libavdevice" = yes ; then - def_libavdevice='#define CONFIG_LIBAVDEVICE 1' + def_libavdevice='#define HAVE_LIBAVDEVICE 1' else - def_libavdevice='#undef CONFIG_LIBAVDEVICE' + def_libavdevice='#define HAVE_LIBAVDEVICE 0' fi echores "$libavdevice" @@ -2845,14 +2868,12 @@ if test "$libpostproc" = auto ; then fi fi if test "$libpostproc" = yes ; then - def_libpostproc='#define CONFIG_LIBPOSTPROC 1' + def_libpostproc='#define HAVE_LIBPOSTPROC 1' else - def_libpostproc='#undef CONFIG_LIBPOSTPROC' + def_libpostproc='#define HAVE_LIBPOSTPROC 0' fi echores "$libpostproc" -def_vda='#define CONFIG_VDA 0' - if darwin ; then echocheck "VDA" @@ -2867,10 +2888,10 @@ if test "$_vda" = auto ; then fi fi if test "$_vda" = yes ; then - def_vda='#define CONFIG_VDA 1' + def_vda='#define HAVE_VDA_HWACCEL 1' libs_mplayer="$libs_mplayer -framework VideoDecodeAcceleration -framework QuartzCore -framework IOSurface" else - def_vda='#define CONFIG_VDA 0' + def_vda='#define HAVE_VDA_HWACCEL 0' fi echores "$_vda" @@ -2887,16 +2908,19 @@ else fi echores "$_vda_refcounting" +else + def_vda='#define HAVE_VDA_HWACCEL 0' + def_vda_refcounting='#define HAVE_VDA_LIBAVCODEC_REFCOUNTING 0' fi echocheck "TV interface" if test "$_tv" = yes ; then - def_tv='#define CONFIG_TV 1' + def_tv='#define HAVE_TV 1' inputmodules="tv $inputmodules" else noinputmodules="tv $noinputmodules" - def_tv='#undef CONFIG_TV' + def_tv='#define HAVE_TV 0' fi echores "$_tv" @@ -2912,32 +2936,32 @@ if test "$_tv_v4l2" = auto ; then fi if test "$_tv_v4l2" = yes ; then _audio_input=yes - def_tv_v4l2='#define CONFIG_TV_V4L2 1' + def_tv_v4l2='#define HAVE_TV_V4L2 1' inputmodules="tv-v4l2 $inputmodules" else noinputmodules="tv-v4l2 $noinputmodules" - def_tv_v4l2='#undef CONFIG_TV_V4L2' + def_tv_v4l2='#define HAVE_TV_V4L2 0' fi echores "$_tv_v4l2" echocheck "Radio interface" if test "$_radio" = yes ; then - def_radio='#define CONFIG_RADIO 1' + def_radio='#define HAVE_RADIO 1' inputmodules="radio $inputmodules" if test "$_alsa" != yes -a "$_ossaudio" != yes ; then _radio_capture=no fi if test "$_radio_capture" = yes ; then _audio_input=yes - def_radio_capture="#define CONFIG_RADIO_CAPTURE 1" + def_radio_capture="#define HAVE_RADIO_CAPTURE 1" else - def_radio_capture="#undef CONFIG_RADIO_CAPTURE" + def_radio_capture="#define HAVE_RADIO_CAPTURE 0" fi else noinputmodules="radio $noinputmodules" - def_radio='#undef CONFIG_RADIO' - def_radio_capture="#undef CONFIG_RADIO_CAPTURE" + def_radio='#define HAVE_RADIO 0' + def_radio_capture="#define HAVE_RADIO_CAPTURE 0" _radio_capture=no fi echores "$_radio" @@ -2952,9 +2976,9 @@ if test "$_radio_v4l2" = auto ; then fi fi if test "$_radio_v4l2" = yes ; then - def_radio_v4l2='#define CONFIG_RADIO_V4L2 1' + def_radio_v4l2='#define HAVE_RADIO_V4L2 1' else - def_radio_v4l2='#undef CONFIG_RADIO_V4L2' + def_radio_v4l2='#define HAVE_RADIO_V4L2 0' fi echores "$_radio_v4l2" @@ -2976,11 +3000,11 @@ EOF fi fi if test "$_pvr" = yes ; then - def_pvr='#define CONFIG_PVR 1' + def_pvr='#define HAVE_PVR 1' inputmodules="pvr $inputmodules" else noinputmodules="pvr $noinputmodules" - def_pvr='#undef CONFIG_PVR' + def_pvr='#define HAVE_PVR 0' fi echores "$_pvr" @@ -3085,16 +3109,16 @@ test_lua 52deb "lua5.2 >= 5.2.0" # debian fi if test "$lua" = yes ; then - def_lua='#define CONFIG_LUA 1' + def_lua='#define HAVE_LUA 1' else - def_lua='#undef CONFIG_LUA' + def_lua='#define HAVE_LUA 0' fi echocheck "encoding" if test "$_encoding" = yes ; then - def_encoding="#define CONFIG_ENCODING 1" + def_encoding="#define HAVE_ENCODING 1" else - def_encoding="#undef CONFIG_ENCODING" + def_encoding="#define HAVE_ENCODING 0" fi echores "$_encoding" @@ -3106,9 +3130,9 @@ if win32 ; then fi if test "$_dlopen" = yes ; then - def_dlopen='#define CONFIG_DLOPEN 1' + def_dlopen='#define HAVE_DLOPEN 1' else - def_dlopen='#undef CONFIG_DLOPEN' + def_dlopen='#define HAVE_DLOPEN 0' fi ############################################################################# @@ -3136,11 +3160,11 @@ libs_mplayer="$libs_mplayer $_ld_dl" echocheck "joystick" -def_joystick='#undef CONFIG_JOYSTICK' +def_joystick='#define HAVE_JOYSTICK 0' if test "$_joystick" = yes ; then if linux || freebsd ; then # TODO add some check - def_joystick='#define CONFIG_JOYSTICK 1' + def_joystick='#define HAVE_JOYSTICK 1' else _joystick="no" res_comment="unsupported under $system_name" @@ -3154,10 +3178,10 @@ if test "$_lirc" = auto ; then header_check lirc/lirc_client.h -llirc_client && _lirc=yes fi if test "$_lirc" = yes ; then - def_lirc='#define CONFIG_LIRC 1' + def_lirc='#define HAVE_LIRC 1' libs_mplayer="$libs_mplayer -llirc_client" else - def_lirc='#undef CONFIG_LIRC' + def_lirc='#define HAVE_LIRC 0' fi echores "$_lirc" @@ -3167,10 +3191,10 @@ if test "$_lircc" = auto ; then header_check lirc/lircc.h -llircc && _lircc=yes fi if test "$_lircc" = yes ; then - def_lircc='#define CONFIG_LIRCC 1' + def_lircc='#define HAVE_LIRCC 1' libs_mplayer="$libs_mplayer -llircc" else - def_lircc='#undef CONFIG_LIRCC' + def_lircc='#define HAVE_LIRCC 0' fi echores "$_lircc" @@ -3471,10 +3495,13 @@ $def_jpeg $def_mng $def_v4l2 $def_vdpau +$def_vdpau_dec +$def_vdpau_dec_old $def_vda $def_vda_refcounting $def_vaapi $def_vaapi_vpp +$def_vaapi_hwaccel $def_vm $def_x11 $def_wayland @@ -3487,7 +3514,8 @@ $def_xv /* FFmpeg */ $def_encoding -$def_resampler +$def_libavresample +$def_libswresample $def_avresample_has_set_channel_mapping $def_fast_64bit diff --git a/demux/demux.c b/demux/demux.c index ba632218ec..eeb979be9d 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -70,16 +70,16 @@ const demuxer_desc_t *const demuxer_list[] = { &demuxer_desc_cue, &demuxer_desc_rawaudio, &demuxer_desc_rawvideo, -#ifdef CONFIG_TV +#if HAVE_TV &demuxer_desc_tv, #endif -#ifdef CONFIG_ASS +#if HAVE_LIBASS &demuxer_desc_libass, #endif &demuxer_desc_matroska, &demuxer_desc_lavf, &demuxer_desc_mf, -#ifdef CONFIG_MNG +#if HAVE_MNG &demuxer_desc_mng, #endif &demuxer_desc_playlist, diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index b26cba5a29..eb352e0f64 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -37,7 +37,7 @@ #include "config.h" -#if CONFIG_ZLIB +#if HAVE_ZLIB #include #endif @@ -267,7 +267,7 @@ static bstr demux_mkv_decode(mkv_track_t *track, bstr data, uint32_t type) src = dest; // output from last iteration is new source if (enc->comp_algo == 0) { -#if CONFIG_ZLIB +#if HAVE_ZLIB /* zlib encoded track */ if (size == 0) @@ -457,7 +457,7 @@ static void parse_trackencodings(struct demuxer *demuxer, "[mkv] algorithm (%" PRIu64 "). Skipping track.\n", track->tnum, e.comp_algo); } -#if !CONFIG_ZLIB +#if !HAVE_ZLIB else if (e.comp_algo == 0) { mp_tmsg(MSGT_DEMUX, MSGL_WARN, "[mkv] Track %u was compressed with zlib " diff --git a/demux/mf.c b/demux/mf.c index 8682e846bf..d1060efc3c 100644 --- a/demux/mf.c +++ b/demux/mf.c @@ -30,7 +30,7 @@ #include "config.h" -#ifdef HAVE_GLOB +#if HAVE_GLOB #include #else #include "osdep/glob.h" diff --git a/mpvcore/av_log.c b/mpvcore/av_log.c index 9fa6fc93ae..ca3ef70747 100644 --- a/mpvcore/av_log.c +++ b/mpvcore/av_log.c @@ -33,18 +33,18 @@ #include #include -#ifdef CONFIG_LIBAVDEVICE +#if HAVE_LIBAVDEVICE #include #endif -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER #include #endif -#ifdef CONFIG_LIBAVRESAMPLE +#if HAVE_LIBAVRESAMPLE #include #endif -#ifdef CONFIG_LIBSWRESAMPLE +#if HAVE_LIBSWRESAMPLE #include #endif @@ -138,10 +138,10 @@ void init_libav(void) av_register_all(); avformat_network_init(); -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER avfilter_register_all(); #endif -#ifdef CONFIG_LIBAVDEVICE +#if HAVE_LIBAVDEVICE avdevice_register_all(); #endif } @@ -164,13 +164,13 @@ void print_libav_versions(int v) print_version(v, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version()); print_version(v, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()); print_version(v, "libswscale", LIBSWSCALE_VERSION_INT, swscale_version()); -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER print_version(v, "libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()); #endif -#ifdef CONFIG_LIBAVRESAMPLE +#if HAVE_LIBAVRESAMPLE print_version(v, "libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()); #endif -#ifdef CONFIG_LIBSWRESAMPLE +#if HAVE_LIBSWRESAMPLE print_version(v, "libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version()); #endif } diff --git a/mpvcore/charset_conv.c b/mpvcore/charset_conv.c index a5c7f559ad..3a6ff67330 100644 --- a/mpvcore/charset_conv.c +++ b/mpvcore/charset_conv.c @@ -27,15 +27,15 @@ #include "mpvcore/mp_msg.h" -#ifdef CONFIG_ENCA +#if HAVE_ENCA #include #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS #include #endif -#ifdef CONFIG_ICONV +#if HAVE_ICONV #include #endif @@ -85,7 +85,7 @@ bool mp_charset_requires_guess(const char *user_cp) (r > 1 && bstrcasecmp0(res[0], "utf8") == 0); } -#ifdef CONFIG_ENCA +#if HAVE_ENCA static const char *enca_guess(bstr buf, const char *language) { if (!language || !language[0]) @@ -117,7 +117,7 @@ static const char *enca_guess(bstr buf, const char *language) } #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS static const char *libguess_guess(bstr buf, const char *language) { if (!language || !language[0] || strcmp(language, "help") == 0) { @@ -157,11 +157,11 @@ const char *mp_charset_guess(bstr buf, const char *user_cp, int flags) const char *res = NULL; -#ifdef CONFIG_ENCA +#if HAVE_ENCA if (bstrcasecmp0(type, "enca") == 0) res = enca_guess(buf, lang); #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS if (bstrcasecmp0(type, "guess") == 0) res = libguess_guess(buf, lang); #endif @@ -212,7 +212,7 @@ bstr mp_charset_guess_and_conv_to_utf8(bstr buf, const char *user_cp, int flags) // returns: buf (no conversion), .start==NULL (error), or allocated buffer bstr mp_iconv_to_utf8(bstr buf, const char *cp, int flags) { -#ifdef CONFIG_ICONV +#if HAVE_ICONV if (!cp || !cp[0] || mp_charset_is_utf8(cp)) return buf; diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index e9c628dedb..12a30dd848 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -53,15 +53,15 @@ #include "joystick.h" -#ifdef CONFIG_LIRC +#if HAVE_LIRC #include "lirc.h" #endif -#ifdef CONFIG_LIRCC +#if HAVE_LIRCC #include #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA #include "osdep/macosx_events.h" #endif @@ -616,7 +616,7 @@ const m_option_t mp_input_opts[] = { OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL), OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL), OPT_FLAG("lircc", input.use_lircc, CONF_GLOBAL), -#ifdef CONFIG_COCOA +#if HAVE_COCOA OPT_FLAG("ar", input.use_ar, CONF_GLOBAL), OPT_FLAG("media-keys", input.use_media_keys, CONF_GLOBAL), #endif @@ -1734,7 +1734,7 @@ static void remove_dead_fds(struct input_ctx *ictx) } } -#ifdef HAVE_POSIX_SELECT +#if HAVE_POSIX_SELECT static void input_wait_read(struct input_ctx *ictx, int time) { @@ -2310,7 +2310,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) "input config\n"); } -#ifdef CONFIG_JOYSTICK +#if HAVE_JOYSTICK if (input_conf->use_joystick) { int fd = mp_input_joystick_init(input_conf->js_dev); if (fd < 0) @@ -2321,7 +2321,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_LIRC +#if HAVE_LIRC if (input_conf->use_lirc) { int fd = mp_input_lirc_init(); if (fd > 0) @@ -2330,7 +2330,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_LIRCC +#if HAVE_LIRCC if (input_conf->use_lircc) { int fd = lircc_init("mpv", NULL); if (fd >= 0) @@ -2338,7 +2338,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA if (input_conf->use_ar) { cocoa_init_apple_remote(); ictx->using_ar = true; @@ -2386,7 +2386,7 @@ void mp_input_uninit(struct input_ctx *ictx) if (!ictx) return; -#ifdef CONFIG_COCOA +#if HAVE_COCOA if (ictx->using_ar) { cocoa_uninit_apple_remote(); } diff --git a/mpvcore/options.c b/mpvcore/options.c index 44f821db75..3d65ec337e 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -72,7 +72,7 @@ static int print_version_opt(const m_option_t *opt, const char *name, exit(0); } -#ifdef CONFIG_RADIO +#if HAVE_RADIO static const m_option_t radioopts_conf[]={ {"device", &stream_radio_defaults.device, CONF_TYPE_STRING, 0, 0 ,0, NULL}, {"driver", &stream_radio_defaults.driver, CONF_TYPE_STRING, 0, 0 ,0, NULL}, @@ -83,9 +83,9 @@ static const m_option_t radioopts_conf[]={ {"achannels", &stream_radio_defaults.achannels, CONF_TYPE_INT, CONF_MIN, 0 ,0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_RADIO */ +#endif /* HAVE_RADIO */ -#ifdef CONFIG_TV +#if HAVE_TV static const m_option_t tvopts_conf[]={ {"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, {"audio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 1, 0, NULL}, @@ -97,7 +97,7 @@ static const m_option_t tvopts_conf[]={ {"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, -#if defined(CONFIG_TV_V4L2) +#if HAVE_TV_V4L2 {"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL}, #endif {"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL}, @@ -111,7 +111,7 @@ static const m_option_t tvopts_conf[]={ {"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, {"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, {"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL}, -#if defined(CONFIG_TV_V4L2) +#if HAVE_TV_V4L2 {"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, {"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, {"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, @@ -123,15 +123,15 @@ static const m_option_t tvopts_conf[]={ {"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, {"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, -#ifdef CONFIG_ALSA +#if HAVE_ALSA {"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -#endif /* CONFIG_ALSA */ -#endif /* defined(CONFIG_TV_V4L2) */ +#endif /* HAVE_ALSA */ +#endif /* HAVE_TV_V4L2 */ {"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ extern int pvr_param_aspect_ratio; extern int pvr_param_sample_rate; @@ -143,7 +143,7 @@ extern char *pvr_param_bitrate_mode; extern int pvr_param_bitrate_peak; extern char *pvr_param_stream_type; -#ifdef CONFIG_PVR +#if HAVE_PVR static const m_option_t pvropts_conf[]={ {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL}, {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL}, @@ -156,7 +156,7 @@ static const m_option_t pvropts_conf[]={ {"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ extern const m_option_t dvbin_opts_conf[]; extern const m_option_t lavfdopts_conf[]; @@ -290,7 +290,7 @@ static const m_option_t msgl_config[]={ }; -#ifdef CONFIG_TV +#if HAVE_TV static const m_option_t tvscan_conf[]={ {"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL}, @@ -340,20 +340,20 @@ const m_option_t mp_opts[] = { {"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL | CONF_PRE_PARSE, 0, 1, NULL}, {"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, -#ifdef CONFIG_PRIORITY +#if HAVE_PRIORITY {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE), OPT_STRINGLIST("reset-on-next-file", reset_options, CONF_GLOBAL), -#ifdef CONFIG_LUA +#if HAVE_LUA OPT_STRINGLIST("lua", lua_files, CONF_GLOBAL), OPT_FLAG("osc", lua_load_osc, CONF_GLOBAL), #endif // ------------------------- stream options -------------------- -#ifdef CONFIG_STREAM_CACHE +#if HAVE_STREAM_CACHE OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff, ({"no", 0}, {"auto", -1}), @@ -365,20 +365,20 @@ const m_option_t mp_opts[] = { OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0, 0, 99), OPT_CHOICE_OR_INT("cache-pause", stream_cache_pause, 0, 0, 40, ({"no", -1})), -#endif /* CONFIG_STREAM_CACHE */ +#endif /* HAVE_STREAM_CACHE */ {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD {"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL}, {"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL}, -#endif /* CONFIG_DVDREAD */ +#endif /* HAVE_DVDREAD */ OPT_INTPAIR("chapter", chapterrange, 0), OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190, ({"auto", -1})), -#ifdef CONFIG_LIBBLURAY +#if HAVE_LIBBLURAY {"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, -#endif /* CONFIG_LIBBLURAY */ +#endif /* HAVE_LIBBLURAY */ {"http-header-fields", &network_http_header_fields, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL}, @@ -426,7 +426,7 @@ const m_option_t mp_opts[] = { OPT_STRING("quvi-format", quvi_format, 0), -#ifdef CONFIG_CDDA +#if HAVE_CDDA { "cdda", (void *)&cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif @@ -438,16 +438,16 @@ const m_option_t mp_opts[] = { OPT_STRING("sub-demuxer", sub_demuxer_name, 0), {"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL}, -#ifdef CONFIG_RADIO +#if HAVE_RADIO {"radio", (void *) radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_RADIO */ -#ifdef CONFIG_TV +#endif /* HAVE_RADIO */ +#if HAVE_TV {"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_TV */ -#ifdef CONFIG_PVR +#endif /* HAVE_TV */ +#if HAVE_PVR {"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_PVR */ -#ifdef CONFIG_DVBIN +#endif /* HAVE_PVR */ +#if HAVE_DVBIN {"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif @@ -494,7 +494,7 @@ const m_option_t mp_opts[] = { // postprocessing: OPT_INT("pp", divx_quality, 0), -#ifdef CONFIG_LIBPOSTPROC +#if HAVE_LIBPOSTPROC {"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL}, #endif @@ -633,7 +633,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("stop-screensaver", stop_screensaver, 0), OPT_INT64("wid", vo.WinID, CONF_GLOBAL), -#ifdef CONFIG_X11 +#if HAVE_X11 OPT_STRINGLIST("fstype", vo.fstype_list, 0), #endif OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0), @@ -645,7 +645,7 @@ const m_option_t mp_opts[] = { OPT_CHOICE_OR_INT("fs-screen", vo.fsscreen_id, 0, 0, 32, ({"all", -2}, {"current", -1})), -#ifdef CONFIG_COCOA +#if HAVE_COCOA OPT_FLAG("native-fs", vo.native_fs, 0), #endif @@ -677,7 +677,7 @@ const m_option_t mp_opts[] = { OPT_STRING("stream-capture", stream_capture, 0), OPT_STRING("stream-dump", stream_dump, 0), -#ifdef CONFIG_LIRC +#if HAVE_LIRC {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif @@ -724,9 +724,9 @@ const m_option_t mp_opts[] = { OPT_INTRANGE("key-fifo-size", input.key_fifo_size, CONF_GLOBAL, 2, 65000), OPT_FLAG("consolecontrols", consolecontrols, CONF_GLOBAL), OPT_FLAG("mouse-movements", vo.enable_mouse_movements, CONF_GLOBAL), -#ifdef CONFIG_TV +#if HAVE_TV {"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ {"screenshot", (void *) screenshot_conf, CONF_TYPE_SUBCONFIG}, @@ -739,7 +739,7 @@ const m_option_t mp_opts[] = { {"version", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE}, {"V", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE}, -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING OPT_STRING("o", encode_output.file, CONF_GLOBAL), OPT_STRING("of", encode_output.format, CONF_GLOBAL), OPT_STRINGLIST("ofopts*", encode_output.fopts, CONF_GLOBAL), @@ -836,7 +836,7 @@ const struct MPOpts mp_default_opts = { .field_dominance = -1, .sub_auto = 1, .osd_bar_visible = 1, -#ifdef CONFIG_ASS +#if HAVE_LIBASS .ass_enabled = 1, #endif .sub_scale = 1, @@ -847,7 +847,7 @@ const struct MPOpts mp_default_opts = { .ass_shaper = 1, .use_embedded_fonts = 1, .suboverlap_enabled = 0, -#ifdef CONFIG_ENCA +#if HAVE_ENCA .sub_cp = "enca", #else .sub_cp = "UTF-8:UTF-8-BROKEN", @@ -875,7 +875,7 @@ const struct MPOpts mp_default_opts = { .use_joystick = 1, .use_lirc = 1, .use_lircc = 1, -#ifdef CONFIG_COCOA +#if HAVE_COCOA .use_ar = 1, .use_media_keys = 1, #endif diff --git a/mpvcore/path.c b/mpvcore/path.c index 93e2d09b04..df138489d6 100644 --- a/mpvcore/path.c +++ b/mpvcore/path.c @@ -42,7 +42,7 @@ typedef char *(*lookup_fun)(const char *); static const lookup_fun config_lookup_functions[] = { mp_find_user_config_file, -#ifdef CONFIG_COCOA +#if HAVE_COCOA mp_get_macosx_bundled_path, #endif mp_find_global_config_file, diff --git a/mpvcore/player/command.c b/mpvcore/player/command.c index bacc37aa27..05369470ff 100644 --- a/mpvcore/player/command.c +++ b/mpvcore/player/command.c @@ -56,11 +56,11 @@ #include "stream/tv.h" #include "stream/stream_radio.h" #include "stream/pvr.h" -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN #include "stream/dvbin.h" #endif #include "screenshot.h" -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H #include #endif @@ -1137,11 +1137,11 @@ static int mp_property_fullscreen(m_option_t *prop, #define VF_DEINTERLACE_LABEL "deinterlace" static const char *deint_filters[] = { -#ifdef CONFIG_VF_LAVFI +#if HAVE_VF_LAVFI "lavfi=yadif", #endif "yadif", -#if CONFIG_VAAPI_VPP +#if HAVE_VAAPI_VPP "vavpp", #endif NULL @@ -1608,7 +1608,7 @@ static int mp_property_sub_pos(m_option_t *prop, int action, void *arg, return property_osd_helper(prop, action, arg, mpctx); } -#ifdef CONFIG_TV +#if HAVE_TV static tvi_handle_t *get_tvh(struct MPContext *mpctx) { @@ -1955,7 +1955,7 @@ static const m_option_t mp_properties[] = { M_OPTION_PROPERTY_CUSTOM("sub-visibility", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-forced-only", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-scale", property_osd_helper), -#ifdef CONFIG_ASS +#if HAVE_LIBASS M_OPTION_PROPERTY_CUSTOM("ass-use-margins", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("ass-vsfilter-aspect-compat", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("ass-style-override", property_osd_helper), @@ -1964,7 +1964,7 @@ static const m_option_t mp_properties[] = { M_OPTION_PROPERTY_CUSTOM("vf*", mp_property_vf), M_OPTION_PROPERTY_CUSTOM("af*", mp_property_af), -#ifdef CONFIG_TV +#if HAVE_TV { "tv-brightness", mp_property_tv_color, CONF_TYPE_INT, M_OPT_RANGE, -100, 100, .offset = TV_COLOR_BRIGHTNESS }, { "tv-contrast", mp_property_tv_color, CONF_TYPE_INT, @@ -2071,7 +2071,7 @@ static struct property_osd_display { { "ass-style-override", _("ASS subtitle style override")}, { "vf*", _("Video filters"), .msg = "Video filters:\n${vf}"}, { "af*", _("Audio filters"), .msg = "Audio filters:\n${af}"}, -#ifdef CONFIG_TV +#if HAVE_TV { "tv-brightness", _("Brightness"), .osd_progbar = OSD_BRIGHTNESS }, { "tv-hue", _("Hue"), .osd_progbar = OSD_HUE}, { "tv-saturation", _("Saturation"), .osd_progbar = OSD_SATURATION }, @@ -2272,7 +2272,7 @@ static int edit_filters_osd(struct MPContext *mpctx, enum stream_type mediatype, return r; } -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H static int ext2_sub_find(struct MPContext *mpctx, int id) { @@ -2723,7 +2723,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) (bar_osd ? OSD_SEEK_INFO_BAR : 0); break; -#ifdef CONFIG_RADIO +#if HAVE_RADIO case MP_CMD_RADIO_STEP_CHANNEL: if (mpctx->stream && mpctx->stream->type == STREAMTYPE_RADIO) { int v = cmd->args[0].v.i; @@ -2761,7 +2761,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) break; #endif -#ifdef CONFIG_TV +#if HAVE_TV case MP_CMD_TV_START_SCAN: if (get_tvh(mpctx)) tv_start_scan(get_tvh(mpctx), 1); @@ -2769,27 +2769,27 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_TV_SET_FREQ: if (get_tvh(mpctx)) tv_set_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0); -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_freq(mpctx->stream, ROUND(cmd->args[0].v.f)); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s", pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; case MP_CMD_TV_STEP_FREQ: if (get_tvh(mpctx)) tv_step_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0); -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_force_freq_step(mpctx->stream, ROUND(cmd->args[0].v.f)); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: f %d", pvr_get_current_channelname(mpctx->stream), pvr_get_current_frequency(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; case MP_CMD_TV_SET_NORM: @@ -2810,7 +2810,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) "Channel: %s", tv_channel_current->name); } } -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel_step(mpctx->stream, cmd->args[0].v.i); @@ -2818,8 +2818,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ -#ifdef CONFIG_DVBIN +#endif /* HAVE_PVR */ +#if HAVE_DVBIN if (mpctx->stream->type == STREAMTYPE_DVB) { int dir; int v = cmd->args[0].v.i; @@ -2836,7 +2836,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) mpctx->dvbin_reopen = 1; } } -#endif /* CONFIG_DVBIN */ +#endif /* HAVE_DVBIN */ break; case MP_CMD_TV_SET_CHANNEL: @@ -2847,17 +2847,17 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) "Channel: %s", tv_channel_current->name); } } -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel(mpctx->stream, cmd->args[0].v.s); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL,