"enable_brprot" was never set when --disable-branch-protection was passed, so
the test != "no" was always true.
Use the name "enable_branch_protection" instead that will be initialized by
autoconf.
PS: --disable-branch-protection seems to be needed to get symbols via gdb.
Compiling with Xcode 11 automatically enables the -fstack-check feature
which causes stack checking error due to unaligned stack which seem
to not be true. Lots of projects are affected by this currently
so hopefully this will be fixed in an Xcode update.
DOLT (provides doltlibtool and doltcompile to make compilation faster
by not always running full libtool) does not handle --with-pic at all,
so even when PIC is requested, it won't use it.
As a workaround manually add it to X86ASMDEFS.
This is based on the GSoC project of Jai Luthra which final code can be
found here https://code.videolan.org/gsoc2019/darkapex/vlc/commits/nvdec_merge
The added patches on top of this proposal (cleaning, fixing, more codecs) can
be found here https://code.videolan.org/robUx4/vlc/tree/nvdec/10
By default we use Bob deinterlacing if the source is interlaced.
Do not use the VP9 decoder if the profile is unknown, it may need 10 bits
support and the hardware may not support it. This is the same way we support
VP9 in DXVA.
The decoder currently has a lower priority than libavcodec.
Co-authored-by: Jai Luthra <me@jailuthra.in>
Co-authored-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
aligned_alloc() is not portably suitable for over-alignments.
posix_memalign()/memalign() are still needed.
This essentially reverts commit 34cd965645.
If the compiler supports the the dedicated code generation command line
flag, use it to provide return/backward control flow integrity (CFI).
This provides protection against return-oriented programming attacks on
where supported. This has no effects if the processor and/or operating
system do not support the extension, except for adding no-ops in the
generated machine code.
So far the AArch64 assembler code in VLC is only made of leaf functions
which do not not store/load the link register value, so there are no
needs to use the Pointer Authentication instructions manually (at least
not for return-CFI).
We don't include tchar.h anymore, nor TCHAR, nor the *tcs* APIs. Using any of
these will fail to compile if tchar.h is not included. In MinGW it's never
included through other headers.
We don't need _UNICODE either which is specific to tchar.h.
Originally, XVideo was the HAL for video ("2D") overlay.
Nowadays, XVideo is but a backward compatibility wrapper around the 3D
hardware for use by legacy applications (notably GLAMOR provides XVideo
using OpenGL). VLC supports OpenGL well nowadays, so there is no point
in using XVideo.
It seems that lot of developers forget to enable this option. This option
enables assert and other debug codes (like the very useful thread/mutex debug
code) that should be mandatory when you dev on VLC.
This is quite a big change: all VLC maintainers should now add
"--disable-debug" when they release a stable version of VLC.
x86inc.asm copied from dav1d (8c5d34c85613) and x86util.asm from libav
(994c4bc10751). Libav's LGPL licensed x86util.asm is required for yadif.
This reverts "Remove unused support for .asm files"
commit 6c0f63cd68.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Now that we use winpthreads, configure finds clock_nanosleep there,
causing -pthread to be added to the libvlccore requirement, while we
don't use it for win32.
fixed patch with the duplicate "#if defined ..." removed
Janne
---8<---
Some toolchains predefine _FORTIFY_SOURCE resulting in countless
_FORTIFY_SOURCE is redefined warnings. Using _FORTIFY_SOURCE without
compiler optimizations also generates warnings.
_FORTIFY_SOURCE is a reserved identifier in C99 ("All identifiers that
begin with an underscore and either an uppercase letter or another
underscore are always reserved for any use.") so the toolchain is
perfectly free to predefine it.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This brings the modern (well, at least current) X11 rendering protocol
for video output (refs #12348).
Compared to plain X11, it can handle scaling and orientation.
Compared to XVideo, it can handle orientation, and can crop correctly
(without bleeding), but it expects packed RGB rather than YCbCr.
Also RENDER would be able to handle SPU blending (and SPU scaling),
though this is left for future work, which neither X11 nor XVideo can.
This should sort properly on Windows and any other platform without
qsort_r(). It does _not_ fix any potential issues on any platforms with
an incompatible qsort_r() prototype (such as FreeBSD < 13).
It is using the picture callback API so there's is no copy on output of the decoder.
Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Co-authored-by: Steve Lhomme <robux4@ycbcr.xyz>
This uses libplacebo's rendering helpers for all video output, on top of
the vulkan graphics API. Some notes:
- The existing fourcc/chroma helpers don't really line up with what the
libplacebo API expects, or in some cases return values that just don't
seem to make sense. I was advised against touching them for fear of
breaking the rest of VLC - so we add our own helpers that give us the
information in the format we need for libplacebo.
- Not all libplacebo options are mapped. There's no ability to create
custom filter functions (which libplacebo/mpv support), and there's
also no support for ICC profiles / 3DLUTs (which libplacebo supports)
nor for the new color blindness simulation parameters in libplacebo
v0.6. We also don't map the VLC brightness/hue/gamma/etc. options to
the libplacebo structs - we could do it for free as part of the video
decode matrix, rather than needing to insert a CPU filter for it.
- How to create the vulkan surface will depend on the platform (much
like in opengl), so we move context, surface and device creation into
a single module (`vulkan/surface.c`) which will be conditionally
compiled depending on the platform in order to provide support for
multiple surfaces side-by-side (e.g. x11 and wayland). This does mean
that the context/device-related options end up being separate per
platform, but OTOH this is not that bad since different platforms
might want different e.g. swapchain modes (an example being wayland,
which can make better use of mailbox rather than fifo).
- libplacebo doesn't have a "configure" step, instead all rendering
parameters are fully dynamic. So we could call UpdateParams() in our
module at any point in time when the config values change.
Unfortunately, there's no easy way for us to find out when this is the
case, so right now changing the vulkan module options requires a
module reinit to take effect. In theory we could change this. (As an
aside: calling var_Inherit* per frame does work to get us the changes
in "realtime", as soon as the user clicks "save", but this may block
for arbitrary amounts of time so I was advised against doing it)
Due to the new functions, structs and enum members used, the minimum
libplacebo version has been bumped up to v0.5.0. In theory we could also
try and support v0.4.0 with some #ifdefs, but v0.5.0 has been out for
several months now so it should be a safe requirement.
The Decklink SDK has platform-specific implementations for various
calls which return strings. Add some portability macros to
properly handle those calls and then normalize the result down to
a C char * as we would typically see in VLC.
Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Add a comment of which version of a required libavcodec corresponds to what libavutil
version. This way we don't need defines for versions we don't support anymore.
Definitions from AH_TOP aren't included in the configure checks.
This was the original intent of e807c8e91.
This makes sure configure checks and actual compilation are run
with the same version defined.
Since e807c8e91, we're explicitly unconditionally defining _WIN32_WINNT,
regardless if it was set before or not.
If it was set before (e.g. on the command line), to a higher version,
we should honor that.
This is cruicial for WinRT building, where _WIN32_WINNT is set to Windows
8 or higher on the command line.
Because libsmb2 doesn't have any netbios name resolver.
Maybe, every VLC services discoveries should use the IP instead of the netbios
name for SMB shares.
Using libsmb2 from Ronnie Sahlberg https://github.com/sahlberg/libsmb2
This is LGPL 2.1 fully async lib for accessing SMB2 and SMB3 shares.
This module use the async feature of the libsmb2 lib with the vlc interrupt
mechanism, therefore every network requests are cancellable almost immediately.
The 2.0.0 version is required since this version drop OpenSSL dependency and
allow to use Builtin NTLMSSP authentication instead of libkrb5.
Add new kernel mode setting video output plugin.
By default it tries to match vlc suggested video mode to anything
kms api offers. There are command line parameters to control
which video format to use for both vlc and for drm.
kms-vlc-chroma parameter to force VLC to use FourCC as output.
kms-drm-chroma parameter to overide DRM requested framebuffer type.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This appears to be the official way to get POSIX threads. In practice,
it pre-defines _REENTRANT to 1 and pulls -lpthread.
(This works with both GCC and Clang.)
All (useful) parts of libxcb source are mandatory because there is not
much point in splitting hairs. Xproto is mandatory as before.
All errors are printed at once.
This flag was originally not added because of crypto functions,
but together with -lssp in 460879.
Advapi32 is one of the libs that are automatically linked in by
the mingw compiler/linker driver.
Adding it manually here causes issues with linking libupnp_plugin.la
with lld. Libupnp contains md5 functions, and advapi32 also contains
functions with the same names. If -ladvapi32 is specified early in the
link command, before -lupnp, the conflicts arise. (The same conflicts
don't occur with binutils ld though, since it searches libraries
in a slightly different order than lld.)
The conflict can be avoided by fixing one inconsistency in mingw-w64
though, but then libupnp will use MD5 functions from advapi32.dll
(with an ABI not guaranteed to match the ones it expected) instead
of the ones bundled in libupnp.
Even if it's not found have_v4l2 will be set to "yes" anyway.
"For each given system header file header-file in the blank-separated argument
list that exists, define HAVE_header-file (in all capitals). If action-if-found
is given, it is additional shell code to execute when one of the header files
is found."
On Windows on ARM/ARM64, OpenGL isn't available. (For emulation
of i386 binaries, there is an opengl32.dll, but it's only the
fallback software renderer, nothing else. For ARM and ARM64, there
is no opengl32.dll.)
Because some platforms might not support it
Default configuration is unchanged: an optimized build will still have
stack protection enabled.
--enable-ssp --disable-optimizations will have SSP disabled
The == condition is a non-POSIX extension to shell.
It's not supported on NetBSD and it's a fatal error within the pkgsrc
framework, even if the condition might be unused.
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
The original idea was to use versioned directories akin to gstreamer,
but no distributions ever did that with VLC. vlcdatadir was always the
same as pkgdatadir.
This reverts half of commit 5698895948.
In environments that lack a full locale.h implementation, the C++
headers might implement some fallbacks with the same name
(on windows, libcxx does this).
In these cases, don't provide the normal fallbacks from vlc_fixups.h
when compiling in C++ mode, but include the C++ <locale> header instead.
If <locale> provides locale_t, include the header and define
HAVE_NEWLOCALE (which skips the vlc_fixups.h version of locale_t),
but keep the vlc_fixups.h fallback for uselocale. (One could
also add another configure test for whether <locale> provides
the uselocale function.)
(libcxx doesn't provide any fallback for the uselocale function
since it isn't easily implemented with the msvcrt _locale_t objects.
The libcxx fallback locale_t objects are applied via the setlocale
function, and passed to functions that take a _locale_t parameter.)
This avoids warnings that are treated as errors by default when building
with clang - warnings like these:
In file included from modules/access/dcp/dcp.cpp:59:
In file included from contrib/x86_64-w64-mingw32/include/AS_DCP.h:88:
In file included from contrib/x86_64-w64-mingw32/include/KM_fileio.h:35:
contrib/x86_64-w64-mingw32/include/KM_util.h:48:11: error: ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions [-Wincompatible-ms-struct]
class IntPrinter : public std::string
The default value of _WIN32_WINNT isn't something that is built into
the compiler, but is defined by the toolchain headers.
Include windows.h after including ws2tcpip.h/winsock2.h, since those
headers should be included in that particular order.
This fixes the following compilation breakge on OS/2.
-----
CC network/udp.lo
network/udp.c: In function 'net_SetMcastOut':
network/udp.c:259:17: error: implicit declaration of function 'if_nametoindex'; did you mean 'if_nameindex'? [-Werror=implicit-function-declaration]
int scope = if_nametoindex (iface);
^~~~~~~~~~~~~~
if_nameindex
-----
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Some calls got an extra parameter which we don't care about.
Also bump up the minimum libplacebo version to v0.2.0. Note: This
commit doesn't update the contrib/ entry for libplacebo.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Test for the existence of the GNU extension getaddrinf_a and libanl
instead of assuming that every Linux has it. Fall back to posix variant
if they are missing.
This fixes build with musl libc which does not implement this GNU
extension.
Fixes#19320
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
According to the documentation, AM_PROG_CC_C_O is obsolete and
AC_PROG_CC now does the check that this macro used to do, since
Automake 1.14.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This avoids having to enable it explicitly in configure, while also not
installing it by default outside build trees. In the unlikely event
that you actually want to install the plugin, you can still do so but
manually (e.g. libtool install mode).
Secure Reliable Transport library supports nettle backend
since 1.2.1, and the current released version is 1.2.2 which
has a fix of wrong version string.
With the option, `--with-gnutls`, in SRT, VLC can be sure
that non-GPL compatible library won't be linked.
Signed-off-by: Justin Kim <justin.kim@collabora.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
By GNU/automake design, those tools have to be present when building
from VCS, even if the generated code is not actually compiled. This
fixes#19086.
Also this potentially allows more than one module to use them.
DIR is the dir path of the libFuzzer.a static library.
When used, it forces a static build without vlc binary and enable sanitize
coverage.
How to fetch and build libFuzzer.a from llvm.org:
$ git clone https://git.llvm.org/git/compiler-rt
$ cd compiler-rt/lib/fuzzer
for gcc:
$ CXX=g++ ./build.sh
for clang:
$ ./build.sh
This a partial merge of the work done by Shaleen during GSOC 2017. See
https://code.videolan.org/GSoC2017/shalzz/vlc.git
Change the `--enable-breakpad` flag to `--with-breakpad=URL`, that
means in order to enable the Breakpad crash reporter, the CrashDragon
server url needs to be given to that argument.
URL should be the base URL of the crash server, without a trailing `/`.
This adds support for conversion between color spaces, in particular HDR
tone mapping and wide gamut -> standard gamut conversion.
Things that this commit does not (yet) address:
- It does not use libplacebo's scaling features. This is blocked by the
fact that libplacebo does not currently support OpenGL (only Vulkan).
- It does not add support for BT.2020 YCbCr. This would be easy to
implement in much the same way as the tone mapping support, by using
pl_shader_decode_color, replacing the hard-coded matrices. This would
also allow adding support for hue, saturation etc. controls.
- It does not hook up the pl_color_map_params options to the VLC GUI.
This would have to be done to let users influence the subjective
configuration options, as well as specify their display device's
configuration.
All of the new code is optional, due to the lack of rigorous testing of
libplacebo (especially on other platforms) and the short timeframe
between this commit and the VLC 3.0 release. This may be changed later
on (possibly for VLC 4.0).
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
_AM_DEPENDENCIES is a private macro, according to the documentation it
should not be called directly. In this case, _AM_DEPENDENCIES is
already called by AC_PROG_OBJC anyway.
In older versions of the rpi-userland libmmal was linked against
libmmal_core/_components/_util, so they were linked implicitly. Newer
versions don't do that, so we have to link them explicitly.
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This reverts commit 76118f5826.
It turns out this is actually an issue with libtool, cleaning the flags
when in link mode and removing the sanitizer flag.
It was fixed in libtool a5c6466528c060cc4660ad0319c00740db0e42ba
but there was no release since this fix.
The access_output_srt module is a SRT client to send a stream.
Signed-off-by: Justin Kim <justin.kim@collabora.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Secure Reliable Transport (SRT) is a proprietary transport technology
that optimizes streaming performance across unpredictable networks.
This patch is an imlementation of input module which works as a SRT
client based on SRT Library[0].
[0] https://github.com/Haivision/srt/releases
Signed-off-by: Justin Kim <justin.kim@collabora.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Using sanitizer and no-undefined will cause linker errors on darwin due
to undefined symbols of the sanitizer.
This is adapted from a patch by Filip Roséen.
Add an option to compile with a set of the recommended flags for the various
santizers.
Multiple comma separated sanitizers can be specified.
This patch also disables no-undefined-symbols(-Wl,-z,defs) only when this
switch is used, to avoid link errors, mainly with asan.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
The SDL video output has been forcefully disabled on MacOS X for 12
years. It has also been disabled in Windows builds for over 6 years.
Finally, it has been broken on X11 due to lack of windowing
integration, for several years, cannot be fixed without changes to
the SDL API, and is completely useless.
The DirectFB project has been dead for several years, and is ostensibly
not used. If you really need direct access to the Linux frame buffer,
there is still the raw LinuxFB module for the time being.
Unlike, say stream output, the HTTP server has no hooks anywhere within
the rest of the core: it is used exclusively through calls from modules
to the LibVLC run-time.
Thus, if no modules use it, the code will be eliminated by linker (in
static builds) or not paged in (in dynamic builds). There is not much
point in adding a build-time option to turn it off. It only creates
problems with keeping missing.c in sync.
This module converts ambisonics channels to physical ones.
This module contains also a binauralizer submodule: It applies a head-related
transfer function to each physical channel in order to simulate a 3D sound with
a headphone.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Previously there was no error handling if ibtool was not found
and xcrun was not used to find it, but the path that xcrun provides
should be preferred, as on some systems and earlier macOS versions
it might not be in the PATH.
On Pepper 49, recvmsg and sendmsg are implemented as stubs, which always
return ENOTSUP. Proper implementations for these functions will become
available in later Pepper versions, which should make these compat
functions obsolete.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Implement a sigwait dummy for NaCl, which relies on:
- NaCl does never send SIGPIPE to to apps (see
https://codereview.chromium.org/288063004/)
- VLC uses sigwait exclusively to wait for SIGPIPE
If sigwait is asked to wait for anything else than SIGPIPE it will run
into an assertion failure, so that breakage would not be silent.
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
These checks are unnecessary since 6f3e18d534, because the calls to
pthread_condattr_setclock and pthread_cond_timedwait_monotonic_np have
been removed.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>