...
 
Commits (4289)

Too many changes to show.

To preserve performance only 474 of 474+ files are displayed.

*.c ident
*.h ident
*.m ident
*.cpp ident
*.hpp ident
README ident
......@@ -8,8 +8,9 @@ Jean-Baptiste Kempf <jb@videolan.org>
<jb@videolan.org> <jb@sasmira.(none)>
Jean-Baptiste Kempf <jb@videolan.org> U-AMBRE\Jean-Baptiste <Jean-Baptiste@ambre.(none)>
Jean-Baptiste Kempf <jb@videolan.org> U-SASMIRA\jb <jb@sasmira.(none)>
<rem@videolan.org> <remi.denis-courmont@nokia.com>
<rem@videolan.org> <rdenis@simphalempin.com>
<remi@remlab.net> <remi.denis-courmont@nokia.com>
<remi@remlab.net> <rdenis@simphalempin.com>
<remi@remlab.net> <rem@videolan.org>
<pdherbemont@videolan.org> <steg@nibudy.local>
<dionoea@videolan.org> <antoine@macbook.(none)>
Felix Paul Kühne <fkuehne@videolan.org>
......
......@@ -10,6 +10,8 @@ SUBDIRS = compat doc po share src modules lib bin test
DIST_SUBDIRS = m4 $(SUBDIRS)
EXTRA_DIST = \
extras/include/x86/x86inc.asm \
extras/include/x86/x86util.asm \
extras/package/macosx/package.mak \
extras/package/win32/package.mak \
extras/package/npapi.am
......@@ -187,7 +189,7 @@ lcov-raw.out:
lcov.out: lcov-raw.out
lcov -r lcov-raw.out -o lcov.out \
'*test*' 'contrib/*' '/usr/include/*'
'*test*' 'contrib/*' '/usr/include/*' '*mock*'
lcov: lcov.out
rm -Rf lcov lcov.tmp
......
......@@ -4,33 +4,432 @@ Changes between 3.0.x and 4.0.0-dev:
Platform support changes:
* 4.0.x requires:
- Windows 7/2008 R2 or later (with KB2533623 installed)
- macOS 10.10 or later
- macOS 10.11 or later
- iOS 9 or later
- Android 4.1.x or later (API-16)
- GCC 5.0 or Clang 3.4 (or equivalent)
* Windows on ARM is now supported
Core:
* new medialibrary
Audio output:
* ALSA: HDMI passthrough support.
Use --alsa-passthrough to configure S/PDIF or HDMI passthrough.
Demuxer:
* Support for HEIF format
* Support for HEIF image and grid image formats
* Support for DASH WebM
* Support for DVBSUB in mkv
* Improved Bluray menus, clips and stream selection
* Support chapters in mp3 files
Codecs:
* Support for experimental AV1 video encoding
* WebVTT encoder
* Remove iomx support for Android
* WebP image decoding
* Support for SMPTE-TT image profile
* Support for 16-bit greyscale
* Support IMM4 decoder
* Improve 708 decoder
Access:
* Enable SMB2 / SMB3 support on mobile ports with libsmb2
* Added support for the RIST (Reliable Internet Stream Transport) Protocol
* Added avaudiocapture module as a replacement for qtsound, which is removed now
Access output:
* Added support for the RIST (Reliable Internet Stream Transport) Protocol
Video output:
* Added X11 RENDER video output plugin
* Remove aa plugin
* Remove evas plugin
* Remove omxil_vout plugin
* Remove RealRTSP plugin
* Remove Real demuxer plugin
Video filter:
* Update yadif
Stream output:
* New SDI output with improved audio and ancillary support.
Candidate for deprecation of decklink vout/aout modules.
* Support for DLNA/UPNP renderers
Service discovery:
* Support Renderer discovery with avahi
macOS:
* Remove Growl notification support
appleOS:
* Improved proxy configuration handling
Changes between 3.0.6 and 3.0.7:
--------------------------------
Access:
* Improve Blu-ray support
Audio output:
* Fix pass-through on Android-23
Video Output:
* Fix 12 bits sources playback with Direct3D11
* Fix crash on iOS
Stream Output:
* Improve Chromecast support with new ChromeCast apps
Misc:
* Update Youtube, Dailymotion, Vimeo scripts
Changes between 3.0.5 and 3.0.6:
--------------------------------
Core:
* Fix potential subtitle picture allocation failures
Codec:
* Add support for 12 bits decoding of AV1
* Fix HDR support in AV1 when the container provides the metadata
Changes between 3.0.4 and 3.0.5:
--------------------------------
Access:
* Improve RTSP playback
* BluRay fixes and improvements, notably for menus and seeking
* Improve the UDP/RTP truncated issue
Codec:
* Add a new AV1 decoder based on dav1d library
* Enable libaom decoder by default
* Fix decoding of some HEVC streams with macOS hardware decoding
Demux:
* MP4: Fix reading of some HDR metadata
* Miscellaneous AV1 demuxing improvements
* Fix CAF integer-underflow
* Fix an MKV crash on iOS 12.0, on iPhone XS phones
Packetizer:
* Add an AV1 packetizer
macOS:
* Starting with VLC 3.0.5, VLC will be distributed with runtime hardening
enabled on macOS Mojave.
All external VLC plugins need to be signed by a DeveloperID certificate in order
to continue working with the official VLC package.
* Update the VLC dark UI to better match the dark mode of macOS Mojave
* Fix convert & save panel stream option
Audio output:
* Fix corking when the playback state is paused
* Improve corking on Android
Video Output:
* Fix Direct3D11 tone-mapping when HDR is displayed on an SDR screen
* More accurate colors for SD sources in Direct3D11
* Disable hardware decoding on some old Intel GPUs
* Fix zero-copy GPU acceleration on AMD RX Vega
* Misc Direct3D11 fixes
Miscellaneaous:
* Improve ChromeCast
* Update numerous 3rd party libraries, including for minor security issues
* Update Youtube support
* Fix subtitles rendering with specific fonts with negative horizontal advance
Changes between 3.0.3 and 3.0.4:
--------------------------------
Decoder:
* Blacklist some intel GPU when decoding HEVC
* Decode AV1 streams
* Fix playback of low-fps files
* Fix hardware decoding of low-latency sliced H.264 streams on macOS
* Fix seeking with streams containing WebVTT subtitles
* Fix decoding some CC-608 streams with roll-up
* Fix crashes with LPCM streams
* Fix colorspace of JPEG, PNG and screen inputs
* Fix MediaCodec rotation handling
Demux:
* Improve FLV fps detection
* Fix some ogg/flac
* Improve support for broken HEVC inside MKV
* Fix some AVI regression for broken files and for DVAudio
* Support files splitted in the .mts%d pattern
* Fixes for MKV seeking
* Fix for MP4 disabled track selection
* Fix playback of incomplete RAR files (downloading)
Audio Output:
* Improve iOS session management and resume-from-pause
* Improve macOS audio performance
* Support 44.1kHz DTS passthrough
* Fix crashes on DirectSound output
Video Output:
* Fix some crash in Direct3D11/Direct3D9 because of sensors
* Fix some broken DVD subtitles rendering (OpenGL, notably)
* Fix crashes on old mac machines, after some time
* Fix memleaks on the EGL output (Android notably)
* Fix misc display in Direct3D11 due to broken drivers
* Fix potential green screen on Windows XP
Text renderer:
* Fix rendering of arabic fonts fallback on macOS
* Fix head buffer overflow on macOS with some fonts
* Fix rendering of fonts with specific fonts
* Fix some RTL rendering
Misc:
* Fix live555, macOS-UI, screen capture crashes
* Change the extension registration names on Windows
* Fix VLM 'now' date
* Fixes on the HTTPD server
* Fix on the NTservice registration
* Fix --stop-time option
* Fix ChromeCast compatibility with web interface
* Fix subtitles alignment
* Fix infinite recursion on directory playback
* Fix detection SAT>IP servers
Qt:
* Fix tooltip display when using Wayland
macOS:
* macOS 10.7.5 is required now, VLC will no longer launch on earlier releases
* Fix delay and fps setting in subtitle dialog
* Modernized and improved support for media keys
* Fix issues with drag and drop of playlist items
* Fix support for audio capturing with qtsound module
* Fix layout issues in the Convert and Save panel
Translations:
* Update of most translations
Changes between 3.0.2 and 3.0.3:
--------------------------------
Core:
* Update subtitles display while paused
Access:
* Enable srt support on binary builds
Decoders:
* Allow videotoolbox hardware decoding to be disabled
* Disable VideoToolbox for 10bits H.264
* Fix VideoToolbox with some invalid HEVC streams
* Fix subsdec wide character support
* Fix 1st order Ambisonics in AAC
Demux:
* Miscellaneous ogg improvements & bugfixes, including oggds
* Fix forced tracks selection
* Fix Topfield files
* Probe AAC/ADTS inside TS
* Fix tracks detection issues with DolbyVision and Bluray streams
macOS:
* Fix "Open Network Stream" URL box focus
* Add option to disable hardware acceleration for video decoding
* Remove option to force dolby mode from simple preferences
Video Output:
* Fix crashes on Direct3D11
Qt:
* Fix tooltip display on some desktop environments
* Fix spurious movement of the main Window
* Fix playlist being displayed in fullscreen
Misc:
* Fix amem output
* Fix numerous issues on fonts fallback and font shaping
* Fix subtitles toggle through hotkeys
* Fix audioscrobbling
* Fix buffer over-read in avcodec audio encoding with non-default layouts
* Numerous 3rd party libraries updated, fixing security issues
Translations:
* Update of most languages
Changes between 3.0.1 and 3.0.2:
--------------------------------
Core:
* Fix snapshotting with subtitles when using hardware acceleration
* Fix green/missing line/column when the picture dimensions are odd
Decoders:
* Important improvements in hardware decoding for macOS, notably faster,
supporting more samples and removing crashes/deadlocks
* Improve compatibility for DxVA2 and D3D11 decoding, fix crashes when seeking
and fix blacklisting of broken drivers
* Fix SSA subtitles forced alignment
* Fix E-AC-3 stuttering
* Fix MIDI playback on macOS
* Add playback support for ProRes 4444 XQ
Demux:
* Fix wrong colors in some AVI files
* Fix IFO files playback to start DVDs
* Fix a crash with missing/invalid MPEG SDT
* Update VP8/9/10 ISOBMFF bindings and improve HDR for those cases
* Fix TTML inside MP4
* Improve MP4 read of color information
* Fix flac seeking and improve flac parsing
* Improve mkv opening & seeking speed
* Fix display of chapters with no name defined
* Miscellaneous MKV crash fixes
* Fix crash with multi-region DVDs
* Fix audio being muted on DVD chapter change
* Fix audio being muted when seeking in a BluRay disc
Access:
* Avoid a crash/assert in FTP after seeking
Audio output:
* Fix mmdevice default audio device handling
* Fix "reset audio volume" being forcefully deactivated
* Allow a default device to be used by VLC
* Only warn once about misconfiguration for AUhal devices on macOS
* Improve resampling and latency computation for CoreAudio
* Passthrough is now disabled by default
Audio filters:
* Fix audio stutter after unpausing with headphones
* Fix silence when dolby-surround was mis-selected in preferences
Video output:
* Fix OpenGL crashes or bad display with semi-planar chromas
* Fix OpenGL interop (zero-copy) disabled for tvOS
* Major rewrite of the iOS video output to fix numerous crashes
* Important improvements of the D3D11 video output to use less memory
and less GPU for HDR tone-mapping
* Fix crop on vertical videos with Direct3D11
* Fix Direct3D9 filters settings not being applied properly
* Fix transform filters with hardware decoding
* Fix snapshot and filters with HEVC hardware decoding
* Fix a buffer overrun during GPU/CPU image copy
* Fix glitches on DVD menus with Direct3D11
* Fix non-HDR content playback on HDR screens with Direct3D11
* Fix YUV full range displayed incorrectly in Direct3D11
* Fix miscellaneous crashes in Direct3D11
* Fix potential black screen with 10bits videos on Direct3D11
macOS:
* Fix Growl notifications on recent macOS versions
* Fix conversion output file name encoding
* Fix crash reporting on macOS 10.7 and 10.8
* Fix crash on exit
* Fix remember playback position
* Fix Blu-ray disc Java menu
* Fix swiping on time slider to change position
* Fix problems with restoring user name from keychain
* Fix localization issues
Qt:
* Fix last folder used in open dialogs
* Allow to customize the seek jump when using the mousewheel
* Fix fullscreen controller positionment on multiscreen setups
* Fix pasted URLs not being trimmed
* Fix jump size not being configurable
* Fix missing time labels updates
* Fix playback speed slider not accepting 1.0x value
* Fix raw input dump
* Fix window size after a fullscreen playback
Misc:
* Fix lua rc & oldrc interfaces host specification
* Fix crashes when searching for renderers
* Relocate localedir for Linux (improves snap i18n support)
* Fix VDPAU GLX usage on Linux
* Improve support for NetBSD
* Fix MSI script for Windows
* Fix libvlc_media_list not going to next media
* Fix character encoding on win32 consoles
* Miscellaneous chromecast improvements
* Fix missing OSD navigation feedback
* Various VLSub improvements
* lua: Fix scripts not being loaded on some filesystems
* lua: Add vlc.io APIs to handle UTF-8 paths
Changes between 3.0.0 and 3.0.1:
--------------------------------
Core:
* Fix use-after-free when cleaning playlists
* Fix crash on exit on Windows
Video output:
* Fix HLG tone mapping on some systems like macOS.
* Fix screensaver inhibition on Windows XP
* Fix various Direct3D11 crashes
* Fix HDR tone mapping in Direct3d11
* Fix pink screen on Windows
Decoder:
* Fix potential stack buffer overflow with faad
* Enable Cineform HD in avcodec
Hardware Decoder:
* macOS: Improve HEVC 10bit performance with Videotoolbox
* android: Add MPEG2 support via MediaCodec
* Fix HEVC decoding with some files on Android/macOS/iOS
* Improve Direct3D11 memory usage
Demux:
* Improve MKV seeking speed
* Fix xspf base URL handling
* Fix reading mp4 trun with moof based offsets
* Fix adaptive http redirections
* Replace old API, fixing adaptive TLS leak
* Use mime type as fallback for HLS segment type
* Fix subtitle (srt,ssa..) seek when having a single entry
* Flag non default HDMV subset video streams
* Increase TS probing amount for 4K streams
* Miscellaneous MKV, MP4 & AVI crash fixes
Packetizer:
* Fix out of bounds read in mpeg4video
Stream Output:
* Improve chromecast loading speed
* Improve local/chromecast transition during playback
* Fix chromecast loading with some versions of Windows
* Fix chromecast loading with some chromecast devices (TVs and Android boxes)
* Fix wrong first cover art when casting
* Fix casting to VP9
macOS Interface:
* Re-add option to disable the fullscreen controller panel
* Auto-layout improvements
* Remove misleading playback warning indicator
* Fix crash with the interface for lua extensions (like VLSub)
* Fix show sidebar setting being ignored on restart
* Fix MKV files association
* Fix chromecast audio detection
Qt Interface:
* Improve scaling on HiDPI displays
Snap:
* Improve interface look and feel.
Changes between 2.2.8 and 3.0.0:
--------------------------------
......
- Remove input/control.c (move remaining implementation to player.c)
- Remove bookmark handling from input
- Remove INPUT_GET_VOUTS/INPUT_GET_AOUT
- Remove INPUT_GET_FULL_TITLE_INFO and priv->*title
- http cookies jar
- Seek callback
......@@ -23,7 +23,7 @@ endif
#
# Main VLC executable
#
vlc_LDADD = ../lib/libvlc.la $(LIBPTHREAD)
vlc_LDADD = ../lib/libvlc.la
vlc_CPPFLAGS = $(AM_CPPFLAGS)
if !HAVE_WIN32
vlc_SOURCES = vlc.c override.c
......@@ -31,7 +31,7 @@ vlc_LDADD += $(LIBDL)
else
vlc_SOURCES = winvlc.c
vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
vlc_LDFLAGS = -mwindows
vlc_LDFLAGS = -mwindows -Wc,-static
vlc_LDADD += vlc_win32_rc.$(OBJEXT)
libbreakpad_wrapper_la_SOURCES = breakpad.cpp
libbreakpad_wrapper_la_LIBADD = $(BREAKPAD_LIBS)
......@@ -118,6 +118,7 @@ vlc_cache_gen_LDADD = \
../lib/libvlc.la
if HAVE_WIN32
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
vlc_cache_gen_LDFLAGS = -Wc,-static
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
endif
......
......@@ -88,12 +88,9 @@ int main (int argc, char *argv[])
vlc_argv[vlc_argc] = NULL;
libvlc_instance_t *vlc = libvlc_new (vlc_argc, vlc_argv);
if (vlc != NULL)
libvlc_release (vlc);
if (vlc == NULL)
fprintf (stderr, "No plugins in %s\n", path);
if (vlc == NULL)
return 1;
libvlc_release(vlc);
}
return 0;
......
......@@ -2,7 +2,6 @@
* darwinvlc.m: OS X specific main executable for VLC media player
*****************************************************************************
* Copyright (C) 2013-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
* David Fuhrmann <dfuhrmann at videolan dot org>
......@@ -27,6 +26,9 @@
#endif
#include <vlc/vlc.h>
#include <vlc_common.h>
#include <vlc_charset.h>
#include <stdlib.h>
#include <locale.h>
#include <signal.h>
......@@ -244,21 +246,13 @@ int main(int i_argc, const char *ppsz_argv[])
language = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("language"),
kCFPreferencesCurrentApplication);
if (language) {
CFIndex length = CFStringGetLength(language) + 1;
if (length > 0) {
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
lang = (char *)malloc(maxSize);
if(lang) {
CFStringGetCString(language, lang, maxSize - 1, kCFStringEncodingUTF8);
if (strncmp( lang, "auto", 4 )) {
char tmp[11];
snprintf(tmp, 11, "LANG=%s", lang);
putenv(tmp);
}
}
free(lang);
lang = FromCFString(language, kCFStringEncodingUTF8);
if (strncmp( lang, "auto", 4 )) {
char tmp[11];
snprintf(tmp, 11, "LANG=%s", lang);
putenv(tmp);
}
free(lang);
CFRelease(language);
}
}
......@@ -292,7 +286,7 @@ int main(int i_argc, const char *ppsz_argv[])
fprintf(stderr, "VLC cannot start any interface. Exiting.\n");
goto out;
}
libvlc_playlist_play(vlc, -1, 0, NULL);
libvlc_playlist_play(vlc);
/*
* Run the main loop. If the mac interface is not initialized, only the CoreFoundation
......
......@@ -173,7 +173,7 @@ static struct
void srand (unsigned int seed)
{
pthread_mutex_lock (&prng.lock);
LOG("Warning", "%d", seed);
LOG("Warning", "%u", seed);
prng.seed = seed;
pthread_mutex_unlock (&prng.lock);
}
......
......@@ -2,7 +2,6 @@
* vlc.c: the VLC player
*****************************************************************************
* Copyright (C) 1998-2013 the VideoLAN team
* $Id$
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -246,7 +245,7 @@ int main(int argc, const char *argv[])
goto out;
}
libvlc_playlist_play (vlc, -1, 0, NULL);
libvlc_playlist_play (vlc);
/* Qt insists on catching SIGCHLD via signal handler. To work around that,
* unblock it after all our child threads are created. */
......
......@@ -111,6 +111,13 @@ static void PrioritizeSystem32(void)
SetProcessMitigationPolicy( 10 /* ProcessImageLoadPolicy */, &m, sizeof( m ) );
}
static void vlc_kill(void *data)
{
HANDLE *semp = data;
ReleaseSemaphore(*semp, 1, NULL);
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
......@@ -240,14 +247,20 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
vlc = libvlc_new (argc, (const char **)argv);
if (vlc != NULL)
{
HANDLE sem = CreateSemaphore(NULL, 0, 1, NULL);
libvlc_set_exit_handler(vlc, vlc_kill, &sem);
libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION,
PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
libvlc_add_intf (vlc, "hotkeys,none");
libvlc_add_intf (vlc, "globalhotkeys,none");
libvlc_add_intf (vlc, NULL);
libvlc_playlist_play (vlc, -1, 0, NULL);
libvlc_wait (vlc);
libvlc_playlist_play (vlc);
WaitForSingleObject(sem, INFINITE);
CloseHandle(sem);
libvlc_release (vlc);
}
else
......
/*****************************************************************************
* lfind.c : implement lfind
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
void *lfind(const void *key, const void *base, size_t *nmemb,
size_t size, int(*cmp)(const void *, const void *))
{
for (int i = 0; i < *nmemb; ++i)
{
const void *elem = base + i * size;
if (!cmp(key, elem))
return elem;
}
return NULL;
}
......@@ -22,7 +22,7 @@
# include <config.h>
#endif
#include <stddef.h>
#include <string.h>
/**
* Copy a string to a sized buffer. The result is always nul-terminated
......@@ -37,16 +37,13 @@
*/
size_t strlcpy (char *tgt, const char *src, size_t bufsize)
{
size_t length;
size_t length = strlen(src);
for (length = 1; (length < bufsize) && *src; length++)
*tgt++ = *src++;
if (bufsize > length)
memcpy(tgt, src, length + 1);
else
if (bufsize > 0)
memcpy(tgt, src, bufsize - 1), tgt[bufsize - 1] = '\0';
if (bufsize)
*tgt = '\0';
while (*src++)
length++;
return length - 1;
return length;
}
......@@ -22,6 +22,28 @@
# include <config.h>
#endif
#ifdef _WIN32
#include <windows.h>
int timespec_get(struct timespec *ts, int base)
{
FILETIME ft;
ULARGE_INTEGER s;
ULONGLONG t;
if (base != TIME_UTC)
return 0;
GetSystemTimeAsFileTime(&ft);
s.LowPart = ft.dwLowDateTime;
s.HighPart = ft.dwHighDateTime;
t = s.QuadPart - 116444736000000000ULL;
ts->tv_sec = t / 10000000;
ts->tv_nsec = ((int) (t % 10000000)) * 100;
return base;
}
#else /* !_WIN32 */
#include <time.h>
#include <unistd.h> /* _POSIX_TIMERS */
#ifndef _POSIX_TIMERS
......@@ -58,3 +80,4 @@ int timespec_get(struct timespec *ts, int base)
}
return base;
}
#endif /* !_WIN32 */
dnl Autoconf settings for vlc
AC_COPYRIGHT([Copyright 1999-2018 VLC authors and VideoLAN])
AC_COPYRIGHT([Copyright 1999-2019 VLC authors and VideoLAN])
AC_INIT(vlc, 4.0.0-dev)
AC_INIT([vlc], [4.0.0-dev])
VERSION_MAJOR=4
VERSION_MINOR=0
VERSION_REVISION=0
......@@ -10,21 +10,21 @@ VERSION_EXTRA=0
VERSION_DEV=dev
PKGDIR="vlc"
AC_SUBST(PKGDIR)
AC_SUBST([PKGDIR])
CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
CODENAME="Otto Chriek"
COPYRIGHT_YEARS="1996-2018"
COPYRIGHT_YEARS="1996-2019"
AC_CONFIG_SRCDIR(src/libvlc.c)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_LIBOBJ_DIR(compat)
AC_CONFIG_SRCDIR([src/libvlc.c])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_LIBOBJ_DIR([compat])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_PRESERVE_HELP_ORDER
AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
AM_INIT_AUTOMAKE([tar-ustar color-tests foreign])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
......@@ -36,14 +36,13 @@ dnl
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
VLC_PROG_CC_C11
AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+ or toolchains predefining _FORTIFY_SOURCE */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif])
AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
AH_TOP([
#ifndef _REENTRANT
# define _REENTRANT
#endif
])
AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
......@@ -58,9 +57,9 @@ AC_PROG_LEX
AC_PROG_YACC
AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
AC_CHECK_PROGS([DESKTOP_FILE_VALIDATE], [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
AC_CHECK_PROGS([BUILDCC], [c11-gcc c11 c99-gcc c99], [false])
AS_IF([test "$BUILDCC" = "false"], [
AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
])
......@@ -69,14 +68,14 @@ dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
dnl Allow binary package maintainer to pass a custom string to avoid
dnl cache problem
AC_ARG_WITH(binary-version,
AC_ARG_WITH([binary-version],
AS_HELP_STRING([--with-binary-version=STRING],
[To avoid plugins cache problem between binary version]),[],[])
AS_IF([test -n "${with_binary_version}"],[
......@@ -96,12 +95,26 @@ HAVE_IOS="0"
HAVE_OSX="0"
HAVE_TVOS="0"
dnl Set x86 asm flags and defines
X86ASMFLAGS=""
case "${host_cpu}" in
i?86)
X86ASMFLAGS="-f elf32"
X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
;;
x86_64)
X86ASMFLAGS="-f elf64"
X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
;;
esac
case "${host_os}" in
"")
SYS=unknown
;;
linux*)
SYS=linux
CFLAGS="${CFLAGS} -pthread"
;;
bsdi*)
SYS=bsdi
......@@ -129,9 +142,11 @@ case "${host_os}" in
dnl Force gcc "-arch" flag
ARCH_flag=""
case "${host}" in
i?86*)
case "${host_cpu}" in
i?86)
ARCH_flag="-arch i386"
X86ASMFLAGS="-f macho32"
X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
;;
ppc64*)
ARCH_flag="-arch ppc64"
......@@ -139,8 +154,10 @@ case "${host_os}" in
ppc*)
ARCH_flag="-arch ppc"
;;
x86_64*)
x86_64)
ARCH_flag="-arch x86_64"
X86ASMFLAGS="-f macho64"
X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
;;
arm*)
ac_cv_c_bigendian="no"
......@@ -180,8 +197,8 @@ case "${host_os}" in
dnl Handle Mac OS X SDK flags
dnl
AC_ARG_WITH(macosx-sdk,
[AS_HELP_STRING([--with-macosx-sdk=DIR],
[compile using the SDK in DIR])])
AS_HELP_STRING([--with-macosx-sdk=DIR],
[compile using the SDK in DIR]))
if test "${with_macosx_sdk}" != "" ; then
test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
CPP="${CPP} -isysroot ${with_macosx_sdk}"
......@@ -191,8 +208,8 @@ case "${host_os}" in
LD="${LD} -syslibroot ${with_macosx_sdk}"
fi
AC_ARG_WITH(macosx-version-min,
[AS_HELP_STRING([--with-macosx-version-min=VERSION],
[compile for Mac OS X VERSION and above])])
AS_HELP_STRING([--with-macosx-version-min=VERSION],
[compile for Mac OS X VERSION and above]))
if test "${with_macosx_version_min}" != "" ; then
CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
......@@ -207,10 +224,14 @@ case "${host_os}" in
CXXFLAGS="${CXXFLAGS} -static-libgcc"
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
AH_TOP([#endif])
AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifdef _WIN32_WINNT
# error _WIN32_WINNT already defined
#endif
]],[[;]])
],[
AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
])
AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
......@@ -249,20 +270,33 @@ case "${host_os}" in
dnl
dnl NSIS/MSI Installer prefix and WIN64
dnl
case "${host}" in
amd64*|x86_64*)
case "${host_cpu}" in
aarch64)
HAVE_WIN64="1"
WINDOWS_ARCH="arm64"
PROGRAMFILES="PROGRAMFILES64"
LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
;;
amd64|x86_64)
HAVE_WIN64="1"
WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64"
LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
X86ASMFLAGS="-f win64"
;;
armv7)
WINDOWS_ARCH="arm"
PROGRAMFILES="PROGRAMFILES"
;;
*)
WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES"
X86ASMFLAGS="-f win32"
X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
;;
esac
AC_SUBST(WINDOWS_ARCH)
AC_SUBST(PROGRAMFILES)
AC_SUBST([WINDOWS_ARCH])
AC_SUBST([PROGRAMFILES])
fi
;;
......@@ -295,7 +329,7 @@ case "${host_os}" in
esac
dnl WinRT
AC_ARG_ENABLE(winstore_app,
AC_ARG_ENABLE([winstore_app],
AS_HELP_STRING([--enable-winstore-app],
[Build targetted for Windows Store apps (default disabled)]))
......@@ -308,26 +342,35 @@ AS_IF([test "${SYS}" = "mingw32"],[
VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
AC_LIBOBJ([gai_strerror])
],[])
AC_SUBST(LIBCOM)
AC_SUBST([LIBCOM])
])
AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
AM_CONDITIONAL([HAVE_NACL], [test "${SYS}" = "nacl"])
AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
dnl Use nasm/yasm only on x86
AC_CHECK_PROGS(X86ASM, [nasm yasm])
AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
AM_COND_IF([HAVE_X86ASM], [
AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
])
AC_SUBST([X86ASMFLAGS])
AC_SUBST([X86ASMDEFS])
dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32
......@@ -342,7 +385,7 @@ case "${build_os}" in
*)
;;
esac
AC_SUBST(BUILDEXEEXT)
AC_SUBST([BUILDEXEEXT])
dnl Android is linux, but a bit different
AS_IF([test "$SYS" = linux],[
......@@ -359,7 +402,7 @@ AS_IF([test "$SYS" = linux],[
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
AM_CONDITIONAL([HAVE_ANDROID], [test "${HAVE_ANDROID}" = "1"])
dnl Tizen (minimum SDK version: 2.3)
AS_IF([test "$SYS" = linux],[
......@@ -375,15 +418,15 @@ AS_IF([test "$SYS" = linux],[
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
AM_CONDITIONAL([HAVE_TIZEN], [test "${HAVE_TIZEN}" = "1"])
dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
[AS_HELP_STRING([--with-contrib[=DIR]],
AS_HELP_STRING([--with-contrib[=DIR]],
[search for 3rd party libraries in DIR/include and DIR/lib])
])
)
AC_MSG_CHECKING([for 3rd party libraries path])
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
CONTRIB_DIR="${srcdir}/contrib/${host}"
......@@ -420,7 +463,7 @@ AS_IF([test -n "${CONTRIB_DIR}"], [
CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:$PKG_CONFIG_PATH"
LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
AS_IF([test -z "$LUAC"], [
......@@ -444,7 +487,7 @@ AS_IF([test -n "${CONTRIB_DIR}"], [
AC_MSG_ERROR([Third party libraries not found!])
])
])
AC_SUBST(CONTRIB_DIR)
AC_SUBST([CONTRIB_DIR])
dnl Add extras/tools to the PATH
TOOLS_DIR="${srcdir}/extras/tools/build/bin"
......@@ -521,8 +564,8 @@ dnl Check for broken versions of mingw-runtime compatability library
dnl Check for the need to include the mingwex lib for mingw32
VLC_SAVE_FLAGS
AC_CHECK_LIB(mingwex,opendir,
AC_CHECK_LIB(mingw32,opendir,,
AC_CHECK_LIB([mingwex], [opendir],
AC_CHECK_LIB([mingw32], [opendir],,
[VLC_ADD_LIBS([libvlccore],[-lmingwex])])
)
VLC_RESTORE_FLAGS
......@@ -582,7 +625,7 @@ need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale])
AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
......@@ -674,9 +717,10 @@ AC_LINK_IFELSE([
char dst[[sizeof(struct in_addr)]];
inet_pton(AF_INET, "127.0.0.1", dst);
])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
AC_CHECK_FUNCS([if_nameindex])
VLC_RESTORE_FLAGS
AC_SUBST(SOCKET_LIBS)
AC_SUBST([SOCKET_LIBS])
dnl Check for socklen_t
AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
......@@ -720,28 +764,42 @@ AC_CHECK_FUNC(getopt_long,, [
GNUGETOPT_LIBS="-lgnugetopt"
])
])
AC_SUBST(GNUGETOPT_LIBS)
AC_SUBST([GNUGETOPT_LIBS])
AC_CHECK_LIB(m,cos,[
AC_CHECK_LIB([m], [cos], [
LIBM="-lm"
], [
LIBM=""
])
AC_SUBST(LIBM)
AC_SUBST([LIBM])
AC_CHECK_LIB(m,lrintf, [
AC_CHECK_LIB([m], [lrintf], [
AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
VLC_ADD_LIBS([skins2],[-lm])
])
AC_CHECK_LIB(m,nanf,
AC_CHECK_LIB([m], [nanf],
AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
)
AC_CHECK_LIB(m,sincos, [
AC_CHECK_LIB([m], [sincos], [
AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
], [
AC_LIBOBJ([sincos])
])
AC_MSG_CHECKING([broken qsort_r prototype])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
_Static_assert(_Generic((qsort_r),
void (*)(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *)) : 1, default: 0),
"Bad prototype not matched");
])], [
AC_MSG_RESULT([broken])
AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
], [
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([_Thread_local support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
int main() {}])], [
......@@ -776,8 +834,8 @@ AS_IF([test "${SYS}" = "mingw32"], [
])
AC_ARG_WITH([libfuzzer],
[AS_HELP_STRING([--with-libfuzzer=DIR],
[use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
AS_HELP_STRING([--with-libfuzzer=DIR],
[use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
[],
[with_libfuzzer=no])
AS_VAR_IF(with_libfuzzer, no, [], [
......@@ -785,41 +843,29 @@ AS_VAR_IF(with_libfuzzer, no, [], [
enable_static=yes
enable_vlc=no
])
AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
AS_IF([test "${enable_shared}" = "no"], [
have_dynamic_objects=no
])
AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])