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, osdl, osd_duration, "%s: %s", pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN case MP_CMD_DVB_SET_CHANNEL: if (mpctx->stream->type == STREAMTYPE_DVB) { mpctx->last_dvb_step = 1; @@ -2869,7 +2869,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) } } break; -#endif /* CONFIG_DVBIN */ +#endif /* HAVE_DVBIN */ case MP_CMD_TV_LAST_CHANNEL: if (get_tvh(mpctx)) { @@ -2879,14 +2879,14 @@ 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_lastchannel(mpctx->stream); 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_NORM: @@ -2898,7 +2898,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (get_tvh(mpctx)) tv_step_chanlist(get_tvh(mpctx)); break; -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ case MP_CMD_SUB_ADD: mp_add_subtitles(mpctx, cmd->args[0].v.s); @@ -2978,14 +2978,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_SCRIPT_DISPATCH: if (mpctx->lua_ctx) { -#ifdef CONFIG_LUA +#if HAVE_LUA mp_lua_script_dispatch(mpctx, cmd->args[0].v.s, cmd->args[1].v.i, cmd->key_up_follows ? "keyup_follows" : "press"); #endif } break; -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H case MP_CMD_OVERLAY_ADD: overlay_add(mpctx, cmd->args[0].v.i, cmd->args[1].v.i, cmd->args[2].v.i, @@ -3052,7 +3052,7 @@ void mp_notify(struct MPContext *mpctx, enum mp_event event, void *arg) static void handle_script_event(struct MPContext *mpctx, const char *name, const char *arg) { -#ifdef CONFIG_LUA +#if HAVE_LUA mp_lua_event(mpctx, name, arg); #endif } diff --git a/mpvcore/player/configfiles.c b/mpvcore/player/configfiles.c index 1c75231365..29350c0aed 100644 --- a/mpvcore/player/configfiles.c +++ b/mpvcore/player/configfiles.c @@ -202,11 +202,11 @@ char *mp_get_playback_resume_config_filename(const char *fname, goto exit; realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname)); } -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD if (bstr_startswith0(bfname, "dvd://")) realpath = talloc_asprintf(tmp, "%s - %s", realpath, dvd_device); #endif -#ifdef CONFIG_LIBBLURAY +#if HAVE_LIBBLURAY if (bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") || bstr_startswith0(bfname, "bluray://")) realpath = talloc_asprintf(tmp, "%s - %s", realpath, bluray_device); diff --git a/mpvcore/player/loadfile.c b/mpvcore/player/loadfile.c index 876994ac93..24b81934ad 100644 --- a/mpvcore/player/loadfile.c +++ b/mpvcore/player/loadfile.c @@ -56,7 +56,7 @@ #include "mp_core.h" #include "command.h" -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN #include "stream/dvbin.h" #endif @@ -85,7 +85,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) if (mask & INITIALIZED_LIBASS) { mpctx->initialized_flags &= ~INITIALIZED_LIBASS; -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (mpctx->osd->ass_renderer) ass_renderer_done(mpctx->osd->ass_renderer); mpctx->osd->ass_renderer = NULL; @@ -472,7 +472,7 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer) static void add_dvd_tracks(struct MPContext *mpctx) { -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD struct demuxer *demuxer = mpctx->demuxer; struct stream *stream = demuxer->stream; struct stream_dvd_info_req info; @@ -818,7 +818,7 @@ static bool attachment_is_font(struct demux_attachment *att) static void add_subtitle_fonts_from_sources(struct MPContext *mpctx) { -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (mpctx->opts->ass_enabled) { for (int j = 0; j < mpctx->num_sources; j++) { struct demuxer *d = mpctx->sources[j]; @@ -835,7 +835,7 @@ static void add_subtitle_fonts_from_sources(struct MPContext *mpctx) static void init_sub_renderer(struct MPContext *mpctx) { -#ifdef CONFIG_ASS +#if HAVE_LIBASS assert(!(mpctx->initialized_flags & INITIALIZED_LIBASS)); assert(!mpctx->osd->ass_renderer); @@ -853,7 +853,7 @@ static struct mp_resolve_result *resolve_url(const char *filename, { if (!mp_is_url(bstr0(filename))) return NULL; -#if defined(CONFIG_LIBQUVI) || defined(CONFIG_LIBQUVI9) +#if HAVE_LIBQUVI4 || HAVE_LIBQUVI9 return mp_resolve_quvi(filename, opts); #else return NULL; @@ -979,7 +979,7 @@ static void play_current_file(struct MPContext *mpctx) if (!mpctx->filename) goto terminate_playback; -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING encode_lavc_discontinuity(mpctx->encode_lavc_ctx); #endif @@ -1026,7 +1026,7 @@ static void play_current_file(struct MPContext *mpctx) MP_DBG(mpctx, "\n[[[init getch2]]]\n"); } -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (opts->ass_style_override) ass_set_style_overrides(mpctx->ass_library, opts->ass_force_style_list); #endif @@ -1077,7 +1077,7 @@ static void play_current_file(struct MPContext *mpctx) stream_set_capture_file(mpctx->stream, opts->stream_capture); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN goto_reopen_demuxer: ; #endif @@ -1164,7 +1164,7 @@ goto_reopen_demuxer: ; preselect_demux_streams(mpctx); -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_VIDEO]) encode_lavc_expect_stream(mpctx->encode_lavc_ctx, AVMEDIA_TYPE_VIDEO); if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_AUDIO]) @@ -1186,7 +1186,7 @@ goto_reopen_demuxer: ; if (!mpctx->sh_video && !mpctx->sh_audio) { MP_FATAL(mpctx, "No video or audio streams selected.\n"); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN if (mpctx->stream->type == STREAMTYPE_DVB) { int dir; int v = mpctx->last_dvb_step; @@ -1262,7 +1262,7 @@ goto_reopen_demuxer: ; MP_VERBOSE(mpctx, "EOF code: %d \n", mpctx->stop_play); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN if (mpctx->dvbin_reopen) { mpctx->stop_play = 0; uninit_player(mpctx, INITIALIZED_ALL - (INITIALIZED_STREAM | INITIALIZED_GETCH2 | (opts->fixed_vo ? INITIALIZED_VO : 0))); diff --git a/mpvcore/player/main.c b/mpvcore/player/main.c index e425b7c051..34383f4264 100644 --- a/mpvcore/player/main.c +++ b/mpvcore/player/main.c @@ -64,11 +64,11 @@ #include "command.h" #include "screenshot.h" -#ifdef CONFIG_X11 +#if HAVE_X11 #include "video/out/x11_common.h" #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA #include "osdep/macosx_application.h" #endif @@ -109,14 +109,14 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, int rc; uninit_player(mpctx, INITIALIZED_ALL); -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING encode_lavc_finish(mpctx->encode_lavc_ctx); encode_lavc_free(mpctx->encode_lavc_ctx); #endif mpctx->encode_lavc_ctx = NULL; -#ifdef CONFIG_LUA +#if HAVE_LUA mp_lua_uninit(mpctx); #endif @@ -124,7 +124,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, timeEndPeriod(1); #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA cocoa_set_input_context(NULL); #endif @@ -134,7 +134,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, osd_free(mpctx->osd); -#ifdef CONFIG_ASS +#if HAVE_LIBASS ass_library_done(mpctx->ass_library); mpctx->ass_library = NULL; #endif @@ -179,7 +179,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, mp_msg_uninit(mpctx->global); talloc_free(mpctx); -#ifdef CONFIG_COCOA +#if HAVE_COCOA terminate_cocoa_application(); // never reach here: // terminate calls exit itself, just silence compiler warning @@ -205,7 +205,7 @@ static bool handle_help_options(struct MPContext *mpctx) talloc_free(list); opt_exit = 1; } -#ifdef CONFIG_X11 +#if HAVE_X11 if (opts->vo.fstype_list && strcmp(opts->vo.fstype_list[0], "help") == 0) { fstype_help(); mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); @@ -223,7 +223,7 @@ static bool handle_help_options(struct MPContext *mpctx) property_print_help(); opt_exit = 1; } -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING if (encode_lavc_showhelp(mpctx->opts)) opt_exit = 1; #endif @@ -284,7 +284,7 @@ static void init_input(struct MPContext *mpctx) // Set the libstream interrupt callback stream_set_interrupt_callback(mp_input_check_interrupt, mpctx->input); -#ifdef CONFIG_COCOA +#if HAVE_COCOA cocoa_set_input_context(mpctx->input); #endif } @@ -366,13 +366,13 @@ static int mpv_main(int argc, char *argv[]) exit_player(mpctx, EXIT_NONE); } -#ifdef CONFIG_PRIORITY +#if HAVE_PRIORITY set_priority(); #endif init_input(mpctx); -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING if (opts->encode_output.file && *opts->encode_output.file) { mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output); if(!mpctx->encode_lavc_ctx) { @@ -388,7 +388,7 @@ static int mpv_main(int argc, char *argv[]) } #endif -#ifdef CONFIG_ASS +#if HAVE_LIBASS mpctx->ass_library = mp_ass_init(opts); #else MP_WARN(mpctx, "Compiled without libass.\n"); @@ -410,7 +410,7 @@ static int mpv_main(int argc, char *argv[]) mpctx->initialized_flags |= INITIALIZED_VO; } -#ifdef CONFIG_LUA +#if HAVE_LUA // Lua user scripts can call arbitrary functions. Load them at a point // where this is safe. mp_lua_init(mpctx); @@ -432,7 +432,7 @@ static int mpv_main(int argc, char *argv[]) int main(int argc, char *argv[]) { -#ifdef CONFIG_COCOA +#if HAVE_COCOA return cocoa_main(mpv_main, argc, argv); #else return mpv_main(argc, argv); diff --git a/mpvcore/player/mp_lua.c b/mpvcore/player/mp_lua.c index 9339329f17..4b5512c926 100644 --- a/mpvcore/player/mp_lua.c +++ b/mpvcore/player/mp_lua.c @@ -24,13 +24,13 @@ // All these are generated from mpvcore/lua/*.lua static const char *builtin_lua_scripts[][2] = { {"mp.defaults", -# include "lua/defaults.inc" +# include "mpvcore/player/lua/defaults.inc" }, {"mp.assdraw", -# include "lua/assdraw.inc" +# include "mpvcore/player/lua/assdraw.inc" }, {"@osc", -# include "lua/osc.inc" +# include "mpvcore/player/lua/osc.inc" }, {0} }; diff --git a/mpvcore/player/osd.c b/mpvcore/player/osd.c index c7964c03f9..a6cfbcb5bc 100644 --- a/mpvcore/player/osd.c +++ b/mpvcore/player/osd.c @@ -140,7 +140,7 @@ void print_status(struct MPContext *mpctx) saddf(&line, " ct:%7.3f", mpctx->total_avsync_change); } -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING double position = get_current_pos_ratio(mpctx, true); char lavcbuf[80]; if (encode_lavc_getstatus(mpctx->encode_lavc_ctx, lavcbuf, sizeof(lavcbuf), diff --git a/mpvcore/player/playloop.c b/mpvcore/player/playloop.c index 8efb6d6693..1162572946 100644 --- a/mpvcore/player/playloop.c +++ b/mpvcore/player/playloop.c @@ -200,7 +200,7 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao, bool reset_ac) mpctx->dropped_frames = 0; mpctx->playback_pts = MP_NOPTS_VALUE; -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING encode_lavc_discontinuity(mpctx->encode_lavc_ctx); #endif } @@ -942,7 +942,7 @@ void run_playloop(struct MPContext *mpctx) bool was_restart = mpctx->restart_playback; bool new_frame_shown = false; -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING if (encode_lavc_didfail(mpctx->encode_lavc_ctx)) { mpctx->stop_play = PT_QUIT; return; diff --git a/mpvcore/player/sub.c b/mpvcore/player/sub.c index d85abcc2c4..94368435d1 100644 --- a/mpvcore/player/sub.c +++ b/mpvcore/player/sub.c @@ -129,7 +129,7 @@ void update_subtitles(struct MPContext *mpctx) static void set_dvdsub_fake_extradata(struct dec_sub *dec_sub, struct stream *st, int width, int height) { -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD if (!st) return; diff --git a/mpvcore/player/video.c b/mpvcore/player/video.c index a6e9f8aecb..8f57bd97ad 100644 --- a/mpvcore/player/video.c +++ b/mpvcore/player/video.c @@ -44,7 +44,7 @@ void update_fps(struct MPContext *mpctx) { -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING struct sh_video *sh_video = mpctx->sh_video; if (mpctx->encode_lavc_ctx && sh_video) encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, sh_video->fps); diff --git a/osdep/getch2.c b/osdep/getch2.c index 8b87e79c76..e3b1179fdf 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -30,11 +30,11 @@ #include #include -#ifdef HAVE_TERMIOS -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS +#if HAVE_TERMIOS_H #include #endif -#ifdef HAVE_SYS_TERMIOS_H +#if HAVE_SYS_TERMIOS_H #include #endif #endif @@ -47,7 +47,7 @@ #include "mpvcore/input/keycodes.h" #include "getch2.h" -#ifdef HAVE_TERMIOS +#if HAVE_TERMIOS static volatile struct termios tio_orig; static volatile int tio_orig_set; #endif @@ -71,12 +71,13 @@ typedef struct { static keycode_map getch2_keys; -#ifdef HAVE_TERMCAP +#if HAVE_TERMINFO || HAVE_TERMCAP + static char *term_rmkx = NULL; static char *term_smkx = NULL; -#ifdef HAVE_TERMINFO +#if HAVE_TERMINFO #include #endif #include @@ -138,7 +139,7 @@ static keycode_st* keys_push_once(char *p, int code) { return st; } -#ifdef HAVE_TERMCAP +#if HAVE_TERMINFO || HAVE_TERMCAP typedef struct { char *buf; @@ -228,9 +229,9 @@ static void termcap_add_extra_f_keys(void) { #endif int load_termcap(char *termtype){ -#ifdef HAVE_TERMCAP +#if HAVE_TERMINFO || HAVE_TERMCAP -#ifdef HAVE_TERMINFO +#if HAVE_TERMINFO use_env(TRUE); int ret; if (setupterm(termtype, 1, &ret) != OK) { @@ -445,12 +446,12 @@ static void do_activate_getch2(void) if (getch2_active) return; -#ifdef HAVE_TERMCAP +#if HAVE_TERMINFO || HAVE_TERMCAP if (term_smkx) tputs(term_smkx, 1, putchar); #endif -#ifdef HAVE_TERMIOS +#if HAVE_TERMIOS struct termios tio_new; tcgetattr(0,&tio_new); @@ -473,12 +474,12 @@ static void do_deactivate_getch2(void) if (!getch2_active) return; -#ifdef HAVE_TERMCAP +#if HAVE_TERMINFO || HAVE_TERMCAP if (term_rmkx) tputs(term_rmkx, 1, putchar); #endif -#ifdef HAVE_TERMIOS +#if HAVE_TERMIOS if (tio_orig_set) { // once set, it will never be set again // so we can cast away volatile here diff --git a/osdep/io.c b/osdep/io.c index b618c76747..b949746e6e 100644 --- a/osdep/io.c +++ b/osdep/io.c @@ -58,7 +58,7 @@ char *mp_to_utf8(void *talloc_ctx, const wchar_t *s) #include #include -#ifdef HAVE_PTHREADS +#if HAVE_PTHREADS #include #endif @@ -298,7 +298,7 @@ static void init_getenv(void) char *mp_getenv(const char *name) { -#ifdef HAVE_PTHREADS +#if HAVE_PTHREADS static pthread_once_t once_init_getenv = PTHREAD_ONCE_INIT; pthread_once(&once_init_getenv, init_getenv); #else diff --git a/osdep/timer-linux.c b/osdep/timer-linux.c index 314aa47b27..1378e6ea7e 100644 --- a/osdep/timer-linux.c +++ b/osdep/timer-linux.c @@ -30,7 +30,7 @@ void mp_sleep_us(int64_t us) { if (us < 0) return; -#ifdef HAVE_NANOSLEEP +#if HAVE_NANOSLEEP struct timespec ts; ts.tv_sec = us / 1000000; ts.tv_nsec = (us % 1000000) * 1000; diff --git a/stream/ai_oss.c b/stream/ai_oss.c index 52cdb71b8d..46e232b264 100644 --- a/stream/ai_oss.c +++ b/stream/ai_oss.c @@ -26,10 +26,10 @@ #include #include -#ifdef HAVE_SYS_SOUNDCARD_H +#if HAVE_SYS_SOUNDCARD_H #include #else -#ifdef HAVE_SOUNDCARD_H +#if HAVE_SOUNDCARD_H #include #else #include diff --git a/stream/audio_in.c b/stream/audio_in.c index 420311e848..6cfbcda129 100644 --- a/stream/audio_in.c +++ b/stream/audio_in.c @@ -40,20 +40,20 @@ int audio_in_init(audio_in_t *ai, int type) ai->samplesize = -1; switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: ai->alsa.handle = NULL; ai->alsa.log = NULL; ai->alsa.device = strdup("default"); return 0; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: ai->oss.audio_fd = -1; ai->oss.device = strdup("/dev/dsp"); return 0; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: ai->sndio.hdl = NULL; ai->sndio.device = strdup("default"); @@ -68,19 +68,19 @@ int audio_in_setup(audio_in_t *ai) { switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: if (ai_alsa_init(ai) < 0) return -1; ai->setup = 1; return 0; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: if (ai_oss_init(ai) < 0) return -1; ai->setup = 1; return 0; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: if (ai_sndio_init(ai) < 0) return -1; ai->setup = 1; @@ -94,21 +94,21 @@ int audio_in_setup(audio_in_t *ai) int audio_in_set_samplerate(audio_in_t *ai, int rate) { switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: ai->req_samplerate = rate; if (!ai->setup) return 0; if (ai_alsa_setup(ai) < 0) return -1; return ai->samplerate; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: ai->req_samplerate = rate; if (!ai->setup) return 0; if (ai_oss_set_samplerate(ai) < 0) return -1; return ai->samplerate; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: ai->req_samplerate = rate; if (!ai->setup) return 0; @@ -123,21 +123,21 @@ int audio_in_set_samplerate(audio_in_t *ai, int rate) int audio_in_set_channels(audio_in_t *ai, int channels) { switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: ai->req_channels = channels; if (!ai->setup) return 0; if (ai_alsa_setup(ai) < 0) return -1; return ai->channels; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: ai->req_channels = channels; if (!ai->setup) return 0; if (ai_oss_set_channels(ai) < 0) return -1; return ai->channels; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: ai->req_channels = channels; if (!ai->setup) return 0; @@ -151,12 +151,12 @@ int audio_in_set_channels(audio_in_t *ai, int channels) int audio_in_set_device(audio_in_t *ai, char *device) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA int i; #endif if (ai->setup) return -1; switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: free(ai->alsa.device); ai->alsa.device = strdup(device); @@ -166,13 +166,13 @@ int audio_in_set_device(audio_in_t *ai, char *device) } return 0; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: free(ai->oss.device); ai->oss.device = strdup(device); return 0; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: if (ai->sndio.device) free(ai->sndio.device); ai->sndio.device = strdup(device); @@ -187,7 +187,7 @@ int audio_in_uninit(audio_in_t *ai) { if (ai->setup) { switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: if (ai->alsa.log) snd_output_close(ai->alsa.log); @@ -197,13 +197,13 @@ int audio_in_uninit(audio_in_t *ai) ai->setup = 0; return 0; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: close(ai->oss.audio_fd); ai->setup = 0; return 0; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: if (ai->sndio.hdl) sio_close(ai->sndio.hdl); @@ -218,15 +218,15 @@ int audio_in_uninit(audio_in_t *ai) int audio_in_start_capture(audio_in_t *ai) { switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: return snd_pcm_start(ai->alsa.handle); #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: return 0; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: if (!sio_start(ai->sndio.hdl)) return -1; @@ -242,7 +242,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer) int ret; switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size); if (ret != ai->alsa.chunk_size) { @@ -262,7 +262,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer) } return ret; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: ret = read(ai->oss.audio_fd, buffer, ai->blocksize); if (ret != ai->blocksize) { @@ -276,7 +276,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer) } return ret; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO case AUDIO_IN_SNDIO: ret = sio_read(ai->sndio.hdl, buffer, ai->blocksize); if (ret != ai->blocksize) { diff --git a/stream/audio_in.h b/stream/audio_in.h index 2f42685c7c..af2cecd28d 100644 --- a/stream/audio_in.h +++ b/stream/audio_in.h @@ -25,7 +25,7 @@ #include "config.h" -#ifdef CONFIG_ALSA +#if HAVE_ALSA #include typedef struct { @@ -38,7 +38,7 @@ typedef struct { } ai_alsa_t; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO typedef struct { char *device; @@ -46,7 +46,7 @@ typedef struct { } ai_oss_t; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO #include typedef struct { @@ -72,13 +72,13 @@ typedef struct int bytes_per_sample; int samplesize; -#ifdef CONFIG_ALSA +#if HAVE_ALSA ai_alsa_t alsa; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO ai_oss_t oss; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO ai_sndio_t sndio; #endif } audio_in_t; @@ -92,19 +92,19 @@ int audio_in_uninit(audio_in_t *ai); int audio_in_start_capture(audio_in_t *ai); int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer); -#ifdef CONFIG_ALSA +#if HAVE_ALSA int ai_alsa_setup(audio_in_t *ai); int ai_alsa_init(audio_in_t *ai); int ai_alsa_xrun(audio_in_t *ai); #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO int ai_oss_set_samplerate(audio_in_t *ai); int ai_oss_set_channels(audio_in_t *ai); int ai_oss_init(audio_in_t *ai); #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO int ai_sndio_setup(audio_in_t *ai); int ai_sndio_init(audio_in_t *ai); #endif diff --git a/stream/stream.c b/stream/stream.c index 186fc7c79d..fbc324563a 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -80,34 +80,34 @@ extern const stream_info_t stream_info_rar_filter; extern const stream_info_t stream_info_rar_entry; static const stream_info_t *const stream_list[] = { -#ifdef CONFIG_VCD +#if HAVE_VCD &stream_info_vcd, #endif -#ifdef CONFIG_CDDA +#if HAVE_CDDA &stream_info_cdda, #endif &stream_info_ffmpeg, &stream_info_avdevice, -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN &stream_info_dvb, #endif -#ifdef CONFIG_TV +#if HAVE_TV &stream_info_tv, #endif -#ifdef CONFIG_RADIO +#if HAVE_RADIO &stream_info_radio, #endif -#ifdef CONFIG_PVR +#if HAVE_PVR &stream_info_pvr, #endif -#ifdef CONFIG_LIBSMBCLIENT +#if HAVE_LIBSMBCLIENT &stream_info_smb, #endif -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD &stream_info_ifo, &stream_info_dvd, #endif -#ifdef CONFIG_LIBBLURAY +#if HAVE_LIBBLURAY &stream_info_bluray, #endif @@ -804,7 +804,7 @@ static int stream_enable_cache(stream_t **stream, int64_t size, int64_t min, int res = -1; -#ifdef CONFIG_STREAM_CACHE +#if HAVE_STREAM_CACHE res = stream_cache_init(cache, orig, size, min, seek_limit); #endif diff --git a/stream/stream_radio.c b/stream/stream_radio.c index de2f474bc9..9bbfcbecb1 100644 --- a/stream/stream_radio.c +++ b/stream/stream_radio.c @@ -37,7 +37,7 @@ #include -#ifdef CONFIG_RADIO_V4L2 +#if HAVE_RADIO_V4L2 #include #endif @@ -48,13 +48,13 @@ #include "stream_radio.h" #include "libavutil/avstring.h" -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE #include "audio_in.h" -#ifdef HAVE_SYS_SOUNDCARD_H +#if HAVE_SYS_SOUNDCARD_H #include #else -#ifdef HAVE_SOUNDCARD_H +#if HAVE_SOUNDCARD_H #include #else #include @@ -93,7 +93,7 @@ typedef struct radio_priv_s { float rangehigh; ///< highest tunable frequency in MHz const struct radio_driver_s* driver; int old_snd_volume; -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE volatile int do_capture; ///< is capture enabled audio_in_t audio_in; unsigned char* audio_ringbuffer; @@ -125,7 +125,7 @@ static const m_option_t stream_opts_fields[] = { }; static void close_s(struct stream *stream); -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE static int clear_buffer(radio_priv_t* priv); #endif @@ -221,7 +221,7 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){ return STREAM_OK; } -#ifdef CONFIG_RADIO_V4L2 +#if HAVE_RADIO_V4L2 /***************************************************************** * \brief get fraction value for using in set_frequency and get_frequency * \return STREAM_OK if success, STREAM_ERROR otherwise @@ -378,7 +378,7 @@ static const radio_driver_t radio_driver_v4l2={ set_frequency_v4l2, get_frequency_v4l2 }; -#endif /* CONFIG_RADIO_V4L2 */ +#endif /* HAVE_RADIO_V4L2 */ static inline int init_frac(radio_priv_t* priv){ return priv->driver->init_frac(priv); @@ -391,7 +391,7 @@ static inline int set_frequency(radio_priv_t* priv,float frequency){ if(priv->driver->set_frequency(priv,frequency)!=STREAM_OK) return STREAM_ERROR; -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE if(clear_buffer(priv)!=STREAM_OK){ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Clearing buffer failed: %s\n",strerror(errno)); return STREAM_ERROR; @@ -410,7 +410,7 @@ static inline int get_volume(radio_priv_t* priv,int* volume){ } -#ifndef CONFIG_RADIO_CAPTURE +#if !HAVE_RADIO_CAPTURE /***************************************************************** * \brief stub, if capture disabled at compile-time * \return STREAM_OK @@ -441,7 +441,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer) int ret; switch (ai->type) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA case AUDIO_IN_ALSA: //device opened in non-blocking mode ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size); @@ -463,7 +463,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer) } return ret; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO case AUDIO_IN_OSS: { int bt=0; @@ -562,7 +562,7 @@ static int init_audio(radio_priv_t *priv) priv->do_capture=1; mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Starting capture stuff.\n"); -#ifdef CONFIG_ALSA +#if HAVE_ALSA while ((tmp = strrchr(priv->radio_param->adevice, '='))){ tmp[0] = ':'; //adevice option looks like ALSA device name. Switching to ALSA @@ -584,11 +584,11 @@ static int init_audio(radio_priv_t *priv) mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] audio_in_setup call failed: %s\n", strerror(errno)); return STREAM_ERROR; } -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO if(is_oss) ioctl(priv->audio_in.oss.audio_fd, SNDCTL_DSP_NONBLOCK, 0); #endif -#ifdef CONFIG_ALSA +#if HAVE_ALSA if(!is_oss) snd_pcm_nonblock(priv->audio_in.alsa.handle,1); #endif @@ -616,7 +616,7 @@ static int init_audio(radio_priv_t *priv) return STREAM_OK; } -#endif /* CONFIG_RADIO_CAPTURE */ +#endif /* HAVE_RADIO_CAPTURE */ /*------------------------------------------------------------------------- for call from mplayer.c @@ -788,7 +788,7 @@ char* radio_get_channel_name(struct stream *stream){ static int fill_buffer_s(struct stream *s, char *buffer, int max_len){ int len=max_len; -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE radio_priv_t* priv=(radio_priv_t*)s->priv; if (priv->do_capture){ @@ -806,7 +806,7 @@ static int fill_buffer_s(struct stream *s, char *buffer, int max_len){ when no driver explicitly specified first available will be used */ static const radio_driver_t* radio_drivers[]={ -#ifdef CONFIG_RADIO_V4L2 +#if HAVE_RADIO_V4L2 &radio_driver_v4l2, #endif 0 @@ -837,7 +837,7 @@ static int open_s(stream_t *stream,int mode) priv->radio_param=stream->priv; stream->priv=NULL; -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE if (priv->radio_param->capture && strncmp("capture",priv->radio_param->capture,7)==0) priv->do_capture=1; else @@ -934,7 +934,7 @@ static void close_s(struct stream *stream){ radio_channels_t * tmp; if (!priv) return; -#ifdef CONFIG_RADIO_CAPTURE +#if HAVE_RADIO_CAPTURE free(priv->audio_ringbuffer); priv->audio_ringbuffer = NULL; diff --git a/stream/tv.c b/stream/tv.c index 43a516e202..dd76230a2e 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -60,7 +60,7 @@ extern const tvi_info_t tvi_info_v4l2; /** List of drivers in autodetection order */ static const tvi_info_t* tvi_driver_list[]={ -#ifdef CONFIG_TV_V4L2 +#if HAVE_TV_V4L2 &tvi_info_v4l2, #endif &tvi_info_dummy, @@ -474,7 +474,7 @@ static int open_tv(tvi_handle_t *tvh) funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tvh->tv_param->input); if ((!strcmp(tvh->tv_param->driver, "v4l2") && tvh->tv_param->normid >= 0)) - tv_set_norm_i(tvh, tvh->tv_param->normid); + tv_set_norm_i(tvh, tvh->tv_param->normid); else tv_set_norm(tvh,tvh->tv_param->norm); diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index 135fcbf8ff..5891ac4556 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -46,10 +46,10 @@ known issues: #include #include #include -#ifdef HAVE_SYS_SYSINFO_H +#if HAVE_SYS_SYSINFO_H #include #endif -#ifdef HAVE_SYS_VIDEOIO_H +#if HAVE_SYS_VIDEOIO_H #include #else #include @@ -400,7 +400,7 @@ static void init_audio(priv_t *priv) if (priv->audio_initialized) return; if (!priv->tv_param->noaudio) { -#ifdef CONFIG_ALSA +#if HAVE_ALSA if (priv->tv_param->alsa) audio_in_init(&priv->audio_in, AUDIO_IN_ALSA); else @@ -1321,7 +1321,7 @@ static int get_capture_buffer_size(priv_t *priv) if (priv->tv_param->buffer_size >= 0) { bufsize = priv->tv_param->buffer_size*1024*1024; } else { -#ifdef HAVE_SYS_SYSINFO_H +#if HAVE_SYS_SYSINFO_H struct sysinfo si; sysinfo(&si); diff --git a/sub/ass_mp.h b/sub/ass_mp.h index 52c793c9b7..27d09d8acd 100644 --- a/sub/ass_mp.h +++ b/sub/ass_mp.h @@ -36,7 +36,7 @@ // m_color argument #define MP_ASS_COLOR(c) MP_ASS_RGBA((c).r, (c).g, (c).b, (c).a) -#ifdef CONFIG_ASS +#if HAVE_LIBASS #include #include @@ -62,5 +62,5 @@ struct sub_bitmaps; void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time, struct sub_bitmap **parts, struct sub_bitmaps *res); -#endif /* CONFIG_ASS */ +#endif /* HAVE_LIBASS */ #endif /* MPLAYER_ASS_MP_H */ diff --git a/sub/dec_sub.c b/sub/dec_sub.c index 4bc39e51c8..1a6cc6b0aa 100644 --- a/sub/dec_sub.c +++ b/sub/dec_sub.c @@ -41,7 +41,7 @@ extern const struct sd_functions sd_lavf_srt; extern const struct sd_functions sd_lavc_conv; static const struct sd_functions *sd_list[] = { -#ifdef CONFIG_ASS +#if HAVE_LIBASS &sd_ass, #endif &sd_lavc, diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index ebfd986a95..64542be69d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -103,18 +103,17 @@ static const struct vd_lavc_hwdec mp_vd_lavc_crystalhd = { }; static const struct vd_lavc_hwdec *hwdec_list[] = { -#if CONFIG_VDPAU -#if HAVE_AV_CODEC_NEW_VDPAU_API +#if HAVE_VDPAU_HWACCEL &mp_vd_lavc_vdpau, -#else +#endif +#if HAVE_VDPAU_DECODER &mp_vd_lavc_vdpau_old, #endif -#endif // CONFIG_VDPAU -#if CONFIG_VDA +#if HAVE_VDA_HWACCEL &mp_vd_lavc_vda, #endif &mp_vd_lavc_crystalhd, -#if CONFIG_VAAPI +#if HAVE_VAAPI_HWACCEL &mp_vd_lavc_vaapi, &mp_vd_lavc_vaapi_copy, #endif diff --git a/video/filter/vf.c b/video/filter/vf.c index c2e15090b8..9a8c1bba04 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -84,10 +84,10 @@ static const vf_info_t *const filter_list[] = { &vf_info_rotate, &vf_info_mirror, -#ifdef CONFIG_LIBPOSTPROC +#if HAVE_LIBPOSTPROC &vf_info_pp, #endif -#ifdef CONFIG_VF_LAVFI +#if HAVE_VF_LAVFI &vf_info_lavfi, #endif @@ -110,10 +110,10 @@ static const vf_info_t *const filter_list[] = { &vf_info_sub, &vf_info_yadif, &vf_info_stereo3d, -#ifdef CONFIG_DLOPEN +#if HAVE_DLOPEN &vf_info_dlopen, #endif -#if CONFIG_VAAPI_VPP +#if HAVE_VAAPI_VPP &vf_info_vaapi, #endif NULL diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c index 8bb119553f..7d37e8ca87 100644 --- a/video/fmt-conversion.c +++ b/video/fmt-conversion.c @@ -171,7 +171,7 @@ static const struct { {IMGFMT_BGRA64_LE, PIX_FMT_BGRA64LE}, #endif -#if HAVE_AV_CODEC_NEW_VDPAU_API +#if HAVE_AVCODEC_NEW_VDPAU_API {IMGFMT_VDPAU, AV_PIX_FMT_VDPAU}, #else {IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1}, diff --git a/video/image_writer.c b/video/image_writer.c index 22192ade45..d2ef348d87 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -27,7 +27,7 @@ #include "config.h" -#ifdef CONFIG_JPEG +#if HAVE_JPEG #include #endif @@ -142,7 +142,7 @@ error_exit: return success; } -#ifdef CONFIG_JPEG +#if HAVE_JPEG static void write_jpeg_error_exit(j_common_ptr cinfo) { @@ -226,7 +226,7 @@ static const struct img_writer img_writers[] = { .pixfmts = (int[]) { IMGFMT_BGR24, IMGFMT_BGRA, IMGFMT_BGR15_LE, IMGFMT_Y8, 0}, }, -#ifdef CONFIG_JPEG +#if HAVE_JPEG { "jpg", write_jpeg }, { "jpeg", write_jpeg }, #endif diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 10e806dc8d..d39a09df16 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -142,14 +142,14 @@ static bool is_software_gl(GL *gl) strcmp(renderer, "Mesa X11") == 0; } -#ifdef HAVE_LIBDL +#if HAVE_LIBDL #include #endif void *mp_getdladdr(const char *s) { void *ret = NULL; -#ifdef HAVE_LIBDL +#if HAVE_LIBDL void *handle = dlopen(NULL, RTLD_LAZY); if (!handle) return NULL; @@ -852,18 +852,18 @@ struct backend { }; static struct backend backends[] = { -#ifdef CONFIG_GL_COCOA +#if HAVE_GL_COCOA {"cocoa", mpgl_set_backend_cocoa}, #endif -#ifdef CONFIG_GL_WIN32 +#if HAVE_GL_WIN32 {"win", mpgl_set_backend_w32}, #endif //Add the wayland backend before x11, in order to probe for a wayland-server before a x11-server and avoid using xwayland -#ifdef CONFIG_GL_WAYLAND +#if HAVE_GL_WAYLAND {"wayland", mpgl_set_backend_wayland}, #endif -#ifdef CONFIG_GL_X11 +#if HAVE_GL_X11 {"x11", mpgl_set_backend_x11}, #endif {0} diff --git a/video/out/gl_common.h b/video/out/gl_common.h index ecff698ac8..41d30bb001 100644 --- a/video/out/gl_common.h +++ b/video/out/gl_common.h @@ -37,7 +37,7 @@ #include "video/mp_image.h" -#if defined(CONFIG_GL_COCOA) +#if HAVE_GL_COCOA #ifdef GL_VERSION_3_0 #include #else diff --git a/video/out/gl_header_fixes.h b/video/out/gl_header_fixes.h index da40e7a485..9fe1e88036 100644 --- a/video/out/gl_header_fixes.h +++ b/video/out/gl_header_fixes.h @@ -27,7 +27,7 @@ #ifndef GLAPIENTRY #ifdef APIENTRY #define GLAPIENTRY APIENTRY -#elif defined(CONFIG_GL_WIN32) +#elif HAVE_GL_WIN32 #define GLAPIENTRY __stdcall #else #define GLAPIENTRY @@ -222,7 +222,7 @@ /** \} */ // end of glextdefines group -#if defined(CONFIG_GL_WIN32) && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB) +#if HAVE_GL_WIN32 && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB) /* these are supposed to be defined in wingdi.h but mingw's is too old */ /* only the bits actually used by mplayer are defined */ /* reference: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt */ diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c index d903ec4055..9999eca233 100644 --- a/video/out/gl_lcms.c +++ b/video/out/gl_lcms.c @@ -35,7 +35,7 @@ #include "gl_video.h" #include "gl_lcms.h" -#ifdef CONFIG_LCMS2 +#if HAVE_LCMS2 #include @@ -212,7 +212,7 @@ error_exit: return NULL; } -#else /* CONFIG_LCMS2 */ +#else /* HAVE_LCMS2 */ const struct m_sub_options mp_icc_conf = { .opts = (m_option_t[]) { {0} }, diff --git a/video/out/gl_video.c b/video/out/gl_video.c index d4b4b507c3..3151927be6 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -41,7 +41,7 @@ static const char vo_opengl_shaders[] = // Generated from gl_video_shaders.glsl -#include "gl_video_shaders.h" +#include "video/out/gl_video_shaders.h" ; // Pixel width of 1D lookup textures. diff --git a/video/out/vo.c b/video/out/vo.c index 061fc9caf3..737c9c34f9 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -66,47 +66,47 @@ extern struct vo_driver video_out_wayland; const struct vo_driver *video_out_drivers[] = { -#if CONFIG_VDPAU +#if HAVE_VDPAU &video_out_vdpau, #endif -#ifdef CONFIG_GL +#if HAVE_GL &video_out_opengl, #endif -#ifdef CONFIG_DIRECT3D +#if HAVE_DIRECT3D &video_out_direct3d_shaders, &video_out_direct3d, #endif -#ifdef CONFIG_COREVIDEO +#if HAVE_COREVIDEO &video_out_corevideo, #endif -#ifdef CONFIG_XV +#if HAVE_XV &video_out_xv, #endif -#ifdef CONFIG_SDL2 +#if HAVE_SDL2 &video_out_sdl, #endif -#ifdef CONFIG_GL +#if HAVE_GL &video_out_opengl_old, #endif -#if CONFIG_VAAPI +#if HAVE_VAAPI &video_out_vaapi, #endif -#ifdef CONFIG_X11 +#if HAVE_X11 &video_out_x11, #endif &video_out_null, // should not be auto-selected &video_out_image, -#ifdef CONFIG_CACA +#if HAVE_CACA &video_out_caca, #endif -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING &video_out_lavc, #endif -#ifdef CONFIG_GL +#if HAVE_GL &video_out_opengl_hq, #endif -#ifdef CONFIG_WAYLAND +#if HAVE_WAYLAND &video_out_wayland, #endif NULL diff --git a/video/out/vo_corevideo.c b/video/out/vo_corevideo.c index 58eb711cec..7b34a91924 100644 --- a/video/out/vo_corevideo.c +++ b/video/out/vo_corevideo.c @@ -23,7 +23,7 @@ #include "config.h" #include -#if CONFIG_VDA +#if HAVE_VDA_HWACCEL #include #endif @@ -446,7 +446,7 @@ static struct cv_functions cv_functions = { .set_yuv_colorspace = cv_set_yuv_colorspace, }; -#if CONFIG_VDA +#if HAVE_VDA_HWACCEL static void iosurface_init(struct vo *vo) { struct priv *p = vo->priv; @@ -546,7 +546,7 @@ static struct cv_functions iosurface_functions = { .get_yuv_colorspace = get_yuv_colorspace, .set_yuv_colorspace = iosurface_set_yuv_csp, }; -#endif /* CONFIG_VDA */ +#endif /* HAVE_VDA_HWACCEL */ static int query_format(struct vo *vo, uint32_t format) { @@ -554,7 +554,7 @@ static int query_format(struct vo *vo, uint32_t format) const int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; switch (format) { -#if CONFIG_VDA +#if HAVE_VDA_HWACCEL case IMGFMT_VDA: p->fns = iosurface_functions; return flags; diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c index a810b1bc60..637c4442fa 100644 --- a/video/out/vo_vaapi.c +++ b/video/out/vo_vaapi.c @@ -658,7 +658,7 @@ const struct vo_driver video_out_vaapi = { .priv_defaults = &(const struct priv) { .scaling = VA_FILTER_SCALING_DEFAULT, .deint = 0, -#if !CONFIG_VAAPI_VPP +#if !HAVE_VAAPI_VPP .deint_type = 2, #endif }, diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index fd6f87edb9..033f06cb19 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -570,7 +570,7 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo) MP_INFO(vo, "Assuming user-specified display refresh rate of %.3f Hz.\n", vc->user_fps); } else if (vc->user_fps == 0) { -#ifdef CONFIG_XF86VM +#if HAVE_XF86VM double fps = vo_x11_vm_get_fps(vo); if (!fps) MP_WARN(vo, "Failed to get display FPS\n"); diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index b1f99bd26f..ff6d677e15 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -177,7 +177,7 @@ static int create_tmpfile_cloexec(char *tmpname) { int fd; -#ifdef HAVE_MKOSTEMP +#if HAVE_MKOSTEMP fd = mkostemp(tmpname, O_CLOEXEC); if (fd >= 0) unlink(tmpname); diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index a2c8ecb2e8..be385ac621 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -40,7 +40,7 @@ #include "x11_common.h" -#ifdef HAVE_SHM +#if HAVE_SHM #include #include #include @@ -94,7 +94,7 @@ struct priv { int num_buffers; int Shmem_Flag; -#ifdef HAVE_SHM +#if HAVE_SHM int Shm_Warned_Slow; XShmSegmentInfo Shminfo[2]; @@ -157,7 +157,7 @@ static int find_depth_from_visuals(struct vo *vo, Visual ** visual_return) static void getMyXImage(struct priv *p, int foo) { struct vo *vo = p->vo; -#ifdef HAVE_SHM +#if HAVE_SHM if (vo->x11->display_is_local && XShmQueryExtension(vo->x11->display)) { p->Shmem_Flag = 1; vo->x11->ShmCompletionEvent = XShmGetEventBase(vo->x11->display) @@ -221,7 +221,7 @@ shmemerror: memset(p->myximage[foo]->data, 0, p->myximage[foo]->bytes_per_line * p->image_height); p->ImageData[foo] = p->myximage[foo]->data; -#ifdef HAVE_SHM +#if HAVE_SHM } #endif } @@ -229,7 +229,7 @@ shmemerror: static void freeMyXImage(struct priv *p, int foo) { struct vo *vo = p->vo; -#ifdef HAVE_SHM +#if HAVE_SHM if (p->Shmem_Flag) { XShmDetach(vo->x11->display, &p->Shminfo[foo]); XDestroyImage(p->myximage[foo]); @@ -397,7 +397,7 @@ static void Display_Image(struct priv *p, XImage *myximage) XImage *x_image = p->myximage[p->current_buf]; -#ifdef HAVE_SHM +#if HAVE_SHM if (p->Shmem_Flag) { XShmPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image, 0, 0, p->dst.x0, p->dst.y0, p->dst_w, p->dst_h, @@ -443,7 +443,7 @@ static mp_image_t *get_screenshot(struct vo *vo) static void wait_for_completion(struct vo *vo, int max_outstanding) { -#ifdef HAVE_SHM +#if HAVE_SHM struct priv *ctx = vo->priv; struct vo_x11_state *x11 = vo->x11; if (ctx->Shmem_Flag) { diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 28e3fdfcbe..02daaf86f8 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -33,7 +33,7 @@ #include "config.h" -#ifdef HAVE_SHM +#if HAVE_SHM #include #include #include @@ -91,7 +91,7 @@ struct xvctx { struct mp_rect dst_rect; uint32_t max_width, max_height; // zero means: not set int Shmem_Flag; -#ifdef HAVE_SHM +#if HAVE_SHM XShmSegmentInfo Shminfo[2]; int Shm_Warned_Slow; #endif @@ -490,7 +490,7 @@ static bool allocate_xvimage(struct vo *vo, int foo) struct vo_x11_state *x11 = vo->x11; // align it for faster OSD rendering (draw_bmp.c swscale usage) int aligned_w = FFALIGN(ctx->image_width, 32); -#ifdef HAVE_SHM +#if HAVE_SHM if (x11->display_is_local && XShmQueryExtension(x11->display)) { ctx->Shmem_Flag = 1; x11->ShmCompletionEvent = XShmGetEventBase(x11->display) @@ -544,7 +544,7 @@ static bool allocate_xvimage(struct vo *vo, int foo) static void deallocate_xvimage(struct vo *vo, int foo) { struct xvctx *ctx = vo->priv; -#ifdef HAVE_SHM +#if HAVE_SHM if (ctx->Shmem_Flag) { XShmDetach(vo->x11->display, &ctx->Shminfo[foo]); shmdt(ctx->Shminfo[foo].shmaddr); @@ -573,7 +573,7 @@ static inline void put_xvimage(struct vo *vo, XvImage *xvi) struct mp_rect *dst = &ctx->dst_rect; int dw = dst->x1 - dst->x0, dh = dst->y1 - dst->y0; int sw = src->x1 - src->x0, sh = src->y1 - src->y0; -#ifdef HAVE_SHM +#if HAVE_SHM if (ctx->Shmem_Flag) { XvShmPutImage(x11->display, ctx->xv_port, x11->window, x11->vo_gc, xvi, src->x0, src->y0, sw, sh, @@ -628,7 +628,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) static void wait_for_completion(struct vo *vo, int max_outstanding) { -#ifdef HAVE_SHM +#if HAVE_SHM struct xvctx *ctx = vo->priv; struct vo_x11_state *x11 = vo->x11; if (ctx->Shmem_Flag) { diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 538235a439..54cd063505 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -46,27 +46,27 @@ #include #include -#ifdef CONFIG_XSS +#if HAVE_XSS #include #endif -#ifdef CONFIG_XDPMS +#if HAVE_XEXT #include #endif -#ifdef CONFIG_XINERAMA +#if HAVE_XINERAMA #include #endif -#ifdef CONFIG_XF86VM +#if HAVE_XF86VM #include #endif -#ifdef CONFIG_XF86XK +#if HAVE_XF86XK #include #endif -#if CONFIG_ZLIB +#if HAVE_ZLIB #include #endif @@ -424,7 +424,7 @@ static void vo_x11_update_screeninfo(struct vo *vo) opts->screenwidth = x11->ws_width; opts->screenheight = x11->ws_height; } -#ifdef CONFIG_XINERAMA +#if HAVE_XINERAMA if (opts->screen_id >= -1 && XineramaIsActive(x11->display) && !all_screens) { int screen = opts->fullscreen ? opts->fsscreen_id : opts->screen_id; @@ -974,7 +974,7 @@ static void vo_x11_update_window_title(struct vo *vo) vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title); } -#if CONFIG_ZLIB +#if HAVE_ZLIB static bstr decompress_gz(bstr in) { bstr res = {0}; @@ -1530,7 +1530,7 @@ static void xscreensaver_heartbeat(struct vo_x11_state *x11) static int xss_suspend(Display *mDisplay, Bool suspend) { -#ifndef CONFIG_XSS +#if !HAVE_XSS return 0; #else int event, error, major, minor; @@ -1552,7 +1552,7 @@ static void saver_on(struct vo_x11_state *x11) x11->screensaver_off = 0; if (xss_suspend(mDisplay, False)) return; -#ifdef CONFIG_XDPMS +#if HAVE_XEXT if (x11->dpms_disabled) { int nothing; if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) { @@ -1587,7 +1587,7 @@ static void saver_off(struct vo_x11_state *x11) x11->screensaver_off = 1; if (xss_suspend(mDisplay, True)) return; -#ifdef CONFIG_XDPMS +#if HAVE_XEXT if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) { BOOL onoff; CARD16 state; @@ -1636,7 +1636,7 @@ static void vo_x11_selectinput_witherr(struct vo *vo, } } -#ifdef CONFIG_XF86VM +#if HAVE_XF86VM double vo_x11_vm_get_fps(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; @@ -1648,7 +1648,7 @@ double vo_x11_vm_get_fps(struct vo *vo) XFree(modeline.private); return 1e3 * clock / modeline.htotal / modeline.vtotal; } -#else /* CONFIG_XF86VM */ +#else /* HAVE_XF86VM */ double vo_x11_vm_get_fps(struct vo *vo) { return 0;