Commit Graph

175 Commits

Author SHA1 Message Date
Timo Rothenpieler f890a6d712 compat/cuda: make cuvidGetDecoderCaps optional 2017-06-01 12:39:06 +02:00
Timo Rothenpieler 88896c4619 compat/cuda/ptx2c: remove bashism and harden against arbitrary input 2017-05-15 18:54:38 +02:00
Timo Rothenpieler f1ab71b046 build: add support for building .cu files via nvcc
Original work by Yogender Gupta <ygupta@nvidia.com>
2017-05-15 11:46:50 +02:00
Timo Rothenpieler f15129a44b compat/cuda: fix cast warnings on windows 2017-05-09 18:38:30 +02:00
Timo Rothenpieler 17f63d98e6 compat/cuda: update cuvid/nvdec headers to Video Codec SDK 8.0.14
This raises the required minimum NVIDIA display driver versions:
NVIDIA Linux display driver 378.13 or newer
NVIDIA Windows display driver 378.66 or newer
2017-05-09 18:38:30 +02:00
Timo Rothenpieler 78518b72cf compat/nvenc: bump nvEncodeAPI.h to Video Codec SDK 8.0.14
This raises the required minimum NVIDIA display driver versions:
NVIDIA Linux display driver 378.13 or newer
NVIDIA Windows display driver 378.66 or newer
2017-05-09 18:38:30 +02:00
Carl Eugen Hoyos 3624d45ddb compat/strtod: Add missing const qualifiers.
Fixes many warnings:
initialization discards 'const' qualifier from pointer target type
2017-05-04 23:17:20 +02:00
Aaron Levinson bceb3d0f86 Support building C++ files with MSVC
Made appropriate changes to be able to successfully
build C++ files using a Visual C++ build on Windows.

Based on an earlier patch by Kyle Schwarz.

Comments:

-- compat/w32pthreads.h: Made appropriate changes to w32pthreads.h to
   get it to build when it is being included in a C++ file and built
   with Visual C++.  This is mostly a copy of Kyle Schwarz's patch as
   described above.

-- configure:
a) Now calling set_ccvars CXX to cause the various CXX_ variables to
   be setup properly.  For example, with MSVC (Microsoft Visual C++),
   this causes CXX_O to be set to -Fo$@ instead of using the default
   value.  The default value does not work with Visual C++.  This
   change will also have the impact of correcting CXX_O (and possibly
   CXX_C) for other compilers, although this is really only relevant
   for the Intel compiler, in addition to MSVC.
b) Now using cl for the C++ compiler for the MSVC toolchain.  This is
   currently only relevant for building the
   Blackmagic/Decklink-related files under avdevice.

Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2017-04-13 23:57:31 +02:00
James Almer eab5d29810 Merge commit '6a93b596c5c3af31b843d63013a7985ffeea354d'
* commit '6a93b596c5c3af31b843d63013a7985ffeea354d':
  compat/atomics: add typecasts in atomic_compare_exchange_strong()

Merged-by: James Almer <jamrial@gmail.com>
2017-04-13 18:27:20 -03:00
Clément Bœsch 210678d3c5 Merge commit '3794062ab1a13442b06f6d76c54dce51ffa54697'
* commit '3794062ab1a13442b06f6d76c54dce51ffa54697':
  Remove Plan 9 support

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-09 14:52:00 +02:00
James Almer b30cd14b57 Merge commit 'bd9cd04626a98a752c5771d057a6b86779359904'
* commit 'bd9cd04626a98a752c5771d057a6b86779359904':
  w32pthreads: Fix function pointer casts

Merged-by: James Almer <jamrial@gmail.com>
2017-04-04 15:59:56 -03:00
Hendrik Leppkes 9ac1e88436 stdatomic/win32: only include the lean windows headers to avoid conflicts 2017-04-04 09:33:23 +02:00
James Almer 7942907878 compat/atomics: fix atomic_fetch_xor 2017-04-02 00:57:17 -03:00
James Almer 824d4062a1 compat/atomics/gcc: use __typeof__ instead of typeof
The typeof keyword is apparently not available when using the -std=c99 option.

Fixes the use of C11 atomic functions with old GCC.

Reviewed-by: Muhammad Faiz <mfcc64@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-18 12:13:46 -03:00
Timo Rothenpieler b27be563a8 compat/cuda: fix ulong size on cygwin 2017-03-01 12:08:34 +01:00
Wan-Teh Chang 6a93b596c5 compat/atomics: add typecasts in atomic_compare_exchange_strong()
The Solaris and Windows emulations of atomic_compare_exchange_strong()
need typecasts to avoid compiler warnings, because the functions they
call expect a void* pointer but an intptr_t integer is passed.

Note that the emulations of atomic_compare_exchange_strong() (except
the gcc version) only work for atomic_intptr_t because of the type of
the second argument (|expected|). See
http://en.cppreference.com/w/c/atomic:

_Bool atomic_compare_exchange_strong( volatile A* obj,
                                      C* expected, C desired );

The types of the first argument and second argument are different
(|A| and |C|, respectively). |C| is the non-atomic type corresponding
to |A|. In the emulations of atomic_compare_exchange_strong(), |C| is
intptr_t. This implies |A| can only be sig_intptr_t.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
2016-12-08 15:53:58 -05:00
Diego Biurrun 3794062ab1 Remove Plan 9 support
Supporting the system was a nice joke for the 9 release, but it has
run its course. Nowadays Plan 9 receives no testing and has no
practical usefulness.
2016-12-03 09:15:01 +01:00
James Almer f88c8e0dc3 compat/atomics: rename header guards
Fixes fate-source.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 20:08:54 -03:00
Anton Khirnov 41e891e89e Add a compat dummy stdatomic.h used when threading is disabled
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit eb34d40354.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov 74b5f10862 Add a compat stdatomic.h implementation based on pthreads
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit f9a6a80e06.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov 70faadc826 Add a compat stdatomic.h implementation based on suncc atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit bb81ed4765.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:18 -03:00
Anton Khirnov c91e72ed52 Add a compat stdatomic.h implementation based on windows atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit c2755864af.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:17 -03:00
Anton Khirnov 3359eede8f Add a compat stdatomic.h implementation based on GCC atomics
Adapted from the code by Rémi Denis-Courmont from VLC

This merges libav commit 4e928ef340.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-02 16:25:17 -03:00
Diego Biurrun bd9cd04626 w32pthreads: Fix function pointer casts
This eliminates a handful of warnings at every inclusion of the header.
2016-11-24 16:14:33 +01:00
Philip Langdale 81147b5596 avcodec/cuvid: Add support for P010/P016 as an output surface format
The nvidia 375.xx driver introduces support for P016 output surfaces,
for 10bit and 12bit HEVC content (it's also the first driver to support
hardware decoding of 12bit content).

The cuvid api, as far as I can tell, only declares one output format
that they appear to refer to as P016 in the driver strings. Of course,
10bit content in P016 is identical to P010, and it is useful for
compatibility purposes to declare the format to be P010 to work with
other components that only know how to consume P010 (and to avoid
triggering swscale conversions that are lossy when they shouldn't be).

For simplicity, this change does not maintain the previous ability
to output dithered NV12 for 10/12 bit input video - the user will need
to update their driver to decode such videos.
2016-11-22 10:09:30 -08:00
Timo Rothenpieler d9ad18f3b4 avcodec/cuvid: use dynamically loaded CUDA/CUVID
And remove the now obsolete compat headers.
2016-11-22 10:34:27 +01:00
Timo Rothenpieler 5c02d2827b compat/cuda: add dynamic loader 2016-11-22 10:34:27 +01:00
Matt Oliver 85553b42f9 compat/w32dlfcn.h: Add safe win32 dlopen/dlclose/dlsym functions.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2016-11-05 18:08:32 +11:00
Anton Khirnov eb34d40354 Add a compat dummy stdatomic.h used when threading is disabled
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:57:56 +02:00
Anton Khirnov f9a6a80e06 Add a compat stdatomic.h implementation based on pthreads
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:56:52 +02:00
Anton Khirnov bb81ed4765 Add a compat stdatomic.h implementation based on suncc atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:55:41 +02:00
Anton Khirnov c2755864af Add a compat stdatomic.h implementation based on windows atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:54:28 +02:00
Anton Khirnov 4e928ef340 Add a compat stdatomic.h implementation based on GCC atomics
Adapted from the code by Rémi Denis-Courmont from VLC
2016-10-02 18:52:08 +02:00
Timo Rothenpieler 7904859fd8 compat/cuda: convert to unix line endings 2016-09-23 11:43:00 +02:00
Philip Langdale 843aff3cf7 cuvid: Use bundled headers
We need to remove the dynlink fanciness and replace it with normal
function prototypes and update the include paths and configure logic.

We don't need to explicitly check for PICPARMS now - they're going
to be there.
2016-09-22 18:38:51 -07:00
Philip Langdale f59e10b0f4 cuvid: Add MIT licenced nvcuid headers from Video SDK 7.0
For unknown reasons, the only accurately descriptive version of
cuviddec.h is in the Video SDK - the one in CUDA 7.5 lacks vp8
PICPARAMS and the vp9 struct definition is inaccurate. The CUDA 8 RC
includes an ancient version of this file from many many years go.

However, the one in the Video SDK is modified to work through a
dynamic link mechanism which we don't really want to use, so the
next change will modify the files to just declare functions in
the normal way.

I've split the changes so it's clear to see what changed between
the original files and ones that work for us.
2016-09-22 18:38:36 -07:00
Timo Rothenpieler 325e56479f avcodec/nvenc: include nvEncodeAPI v7 SDK header
As Nvidia has put the most recent Video Codec SDK behind a double
registration wall, of which one needs manual approval of a lenghty
application, bundling this header saves everyone trying to use NVENC
from that headache.

The header is still MIT licensed and thus fine to bundle with ffmpeg.

Not bundling this header would get ffmpeg stuck at SDK v6, which is
still freely available, holding back future development of the NVENC
encoder.
2016-08-28 16:47:54 +02:00
Stephen Hutchinson f84cff8565 compat/avisynth: update AviSynth+ header
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-17 18:08:29 +02:00
Derek Buitenhuis dc0152548f Merge commit '6bb99757b780144d9fa27cdce09d3621e1a0ed43'
* commit '6bb99757b780144d9fa27cdce09d3621e1a0ed43':
  jack: Support OSX

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 23:02:33 +01:00
Josh de Kock 6bb99757b7 jack: Support OSX
Previously, with JACK installed, the configure script would enable the
JACK indev; this broke on OS X due to an incomplete pthreads
implementation. Add some simple macros to map libdispatch to pthreads
on OS X.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-03-31 18:03:21 +02:00
KO Myung-Hun b8bc6b14a5 compat/os2threads: split long lines
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 19:17:36 +01:00
KO Myung-Hun 6bf5e7d3e7 compat/os2threads: support the return value of joined thread
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 19:17:36 +01:00
KO Myung-Hun 22a4046d66 compat/os2threads: Improve pthread_cond_xxx() functions
1. Manipulate waiting count in pthread_cond_wait()
2. Use builtin atomic functions to manipulate waiting count

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 19:17:36 +01:00
Timothy Gu 180f9a0958 all: Make header guard names consistent 2016-01-31 15:44:11 -08:00
Timothy Gu 44304ae322 all: Add missing header guards 2016-01-28 19:49:48 -08:00
KO Myung-Hun 6248f23859 os2threads: Add pthread_once()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 22:31:46 +01:00
Hendrik Leppkes c1b712e078 Merge commit '407ac22322e5ce67996ec54ef619cafa4c9ceb78'
* commit '407ac22322e5ce67996ec54ef619cafa4c9ceb78':
  w32pthreads: Map MemoryBarrier to __sync_synchronize on mingw

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:58:27 +01:00
Martin Storsjö 407ac22322 w32pthreads: Map MemoryBarrier to __sync_synchronize on mingw
This fixes building on older mingw (both mingw.org and mingw64;
mingw64 from before May 2011).

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-10-30 20:15:11 +02:00
Michael Niedermayer e91cd8a9c4 compat/solaris/make_sunver.pl: Use /usr/bin/env perl instead of /usr/bin/perl
This is how the other perl scripts in git call perl

Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-20 02:21:34 +02:00
Hendrik Leppkes 68e00ad66d w32pthreads: fix mingw build on x86 with -msse2 or higher
When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-16 17:46:41 +02:00
Hendrik Leppkes 97be5d4d20 w32pthreads: fix mingw build on x86 with -msse2 or higher
When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.
2015-10-16 14:54:48 +02:00
wang-bin 0861862b89 winrt: multithreading support
_beginthreadex is for desktop only. CreateThread is available for windows store apps on windows (and phone) 8.1 and later. http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-16 00:54:57 +11:00
Hendrik Leppkes fcfb66ba9b Merge commit 'c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b'
* commit 'c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b':
  build: add Solaris symbol versioning

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 13:54:50 +02:00
Sean McGovern c1aac39eac build: add Solaris symbol versioning
The versioning facility in the Solaris linker differs from Linux in 3 ways:

1. It does not support globs in linker scripts for
symbol versioning -- this is a GNU extension.

2. The linker argument is '-M', instead of '--version-script'.

3. It is picky about line endings.
Each symbol or directive must be on a line of it's own.

Let's use make_sunver.pl from GCC to generate a version script that works
correctly with the Solaris linker. It's function is to correctly expand the
globs in the original generated version script.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-11 15:42:36 +02:00
Hendrik Leppkes 9d6873a43d Merge commit '2830bce47e2eb29c76202f19017031ddc1f95dd3'
* commit '2830bce47e2eb29c76202f19017031ddc1f95dd3':
  w32pthreads: Load dynamically loaded functions on demand

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-10 09:45:44 +02:00
Hendrik Leppkes 89da893c88 Merge commit 'b22693b06d1e5d73454a65c203b4d31c1ca5b69a'
* commit 'b22693b06d1e5d73454a65c203b4d31c1ca5b69a':
  w32pthreads: Add pthread_once emulation

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-10 09:45:16 +02:00
Hendrik Leppkes 2830bce47e w32pthreads: Load dynamically loaded functions on demand
This removes the requirement of calling w32thread_init before being
able to use the threading primitives.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-07 18:45:50 +02:00
Hendrik Leppkes b22693b06d w32pthreads: Add pthread_once emulation
The emulation uses native InitOnce* APIs on Windows Vista+, and a
lock-free/allocation-free approach using atomics and spinning for
Windows XP.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-07 18:45:50 +02:00
Matt Oliver ae58abeabb compat/w32pthreads: Add return values to match the simulated pthread functions. 2015-09-30 13:41:33 +10:00
Steve Lhomme 58ed7b6328 use a wrapper script to call MS link.exe to avoid mixing with /usr/bin/link.exe
favor link over link.exe in case some wrapper script already exists
fallback to "link" in the path if the one next to cl is not found

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-24 20:02:32 +02:00
Steve Lhomme c9edbe4af9 use a wrapper script to call MS link.exe to avoid mixing with /usr/bin/link.exe
Fallback to "link" in the path if the one next to cl is not found.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-24 18:21:22 +03:00
Michael Niedermayer ea9daefe93 compat/os2threads: Check av_malloc() return code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-02 15:16:45 +02:00
Stephen Hutchinson 1492118c9d avisynth: drop support of AviSynth 2.5
If the user attempts to use AviSynth 2.5, an error message will
now tell them they need to upgrade.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 20:37:26 +01:00
Stephen Hutchinson 3a6df0b4bb avisynth: ifdef to avoid implicit function declaration errors
The demuxer doesn't use these functions, so it shouldn't affect
anything.  Investigate whether this can be fixed by how headers
are checked in configure.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 16:19:14 +01:00
Stephen Hutchinson e003a53452 avisynth: update headers against AviSynth+
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 00:22:15 +01:00
Michael Niedermayer 0babb896b4 compat/avisynth/windowsPorts/windows2linux: Add () to protect macro arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-18 01:49:35 +01:00
Michael Niedermayer ff0a0b62f3 compat/avisynth/avxsynth_c: Clear all unused fields in returned structs
Fixes: CID1257658

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-11 16:12:47 +01:00
James Almer b7c3bfd5eb w32pthreads: use the condition variable API directly when targeting newer versions of Windows
Wrap the function calls in a similar fashion to how it's being done
with the critical section API.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-10 11:27:30 +03:00
James Almer 73ea3ffcd5 w32pthreads: use the CONDITION_VARIABLE typedef if available
This silences warnings about passing arguments from incompatible pointer type
when targeting Windows Vista or newer.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-10 11:27:26 +03:00
James Almer 8c6992bf0c compat/w32pthreads: use the condition variable API directly when targeting newer versions of Windows
Wrap the function calls in a similar fashion to how it's being done
with the critical section API.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-09 17:51:46 -03:00
James Almer 0c06949314 compat/w32pthreads: use the CONDITION_VARIABLE typedef if available
This silences warnings about passing arguments from incompatible pointer type
when targeting Windows Vista or newer.

Tested-by: Matt Oliver <protogonoi@gmail.com>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-09 13:26:44 -03:00
Michael Niedermayer fb33bff990 Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'
* commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39':
  cosmetics: Write NULL pointer equality checks more compactly

Conflicts:
	cmdutils.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/dvbsub.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/dxa.c
	libavcodec/libxvid_rc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/rv10.c
	libavcodec/tiffenc.c
	libavcodec/utils.c
	libavcodec/vc1dec.c
	libavcodec/zmbv.c
	libavdevice/v4l2.c
	libavformat/matroskadec.c
	libavformat/movenc.c
	libavformat/sdp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 21:00:50 +02:00
Michael Niedermayer 6afd726b7b Merge commit '6baeadd11083774ebd823dd5e1a744c2150a3bfc'
* commit '6baeadd11083774ebd823dd5e1a744c2150a3bfc':
  w32pthreads: Mark functions in compatibility wrapper as av_unused

Conflicts:
	compat/w32pthreads.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 12:31:29 +02:00
Gabriel Dume f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Diego Biurrun 6baeadd110 w32pthreads: Mark functions in compatibility wrapper as av_unused
This avoids annoying warnings about unused functions. The compatibility
wrapper is designed to provide a complete (stub) API, so some functions
being unused by some files is natural and no reason for a warning.
2014-08-15 09:37:38 +02:00
Michael Niedermayer a0f3db8f60 Merge commit '428b0578c64241fc677fed7083cc8fe65e10f32e'
* commit '428b0578c64241fc677fed7083cc8fe65e10f32e':
  w32threads: Use newer thread synchronization functions when targeting Vista

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 18:33:06 +02:00
Martin Storsjö 428b0578c6 w32threads: Use newer thread synchronization functions when targeting Vista
When explicitly targeting Vista or newer (which only happens if the
caller explicitly sets _WIN32_WINNT to a high enough value via the
extra cflags option - otherwise configure script sets
-D_WIN32_WINNT=0x0502), we already unconditionally link to the
ConditionVariable functions, since 4622f11f9.

Similarly use the newer -Ex versions of CreateEvent, CreateSemaphore,
InitializeCriticalSection and WaitForSingleObject, that all appeared
in Vista. When building Windows Store applications, the older versions
of these functions aren't available, only the -Ex functions. When
doing such a build, the user can set -D_WIN32_WINNT=0x0600 to
forcibly use the newer functions instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-13 14:38:18 +03:00
Nicolas George 58a10e0e2c compat/w32pthreads: add return value to pthread_cond_init(). 2014-05-26 11:33:42 +02:00
Michael Niedermayer 27b4d154ca Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Work around broken floating point limits on some systems.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-10 12:05:02 +01:00
Anton Khirnov e854b8f9f4 Work around broken floating point limits on some systems.
The values of {FLT,DBL}_{MAX,MIN} macros on some systems (older musl
libc, some BSD flavours) are not exactly representable, i.e.
(double)DBL_MAX == DBL_MAX is false
This violates (at least some interpretations of) the C99 standard and
breaks code (e.g. in vf_fps) like
double f = DBL_MAX;
[...]
if (f == DBL_MAX) { // f has not been changed yet
    [....]
}
2014-03-10 10:27:17 +01:00
Andreas Cadhalpun 64b6164b72 Correct the FSF address for two avisynth files to '51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 20:44:33 +01:00
Reimar Döffinger b74eead27b compat: provide va_copy for old gcc versions.
Since we have this compat/va_copy.h header already we might just as well make
use of it for more than one compiler.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-12-30 12:38:03 +01:00
Michael Niedermayer 988bda8a69 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  build: Import makedef script from c99-to-c89

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-24 23:27:32 +01:00
Derek Buitenhuis dedfa00107 build: Import makedef script from c99-to-c89
This allows MSVC 2013 and ICL to build with no external
dependencies.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-11-24 19:36:09 +00:00
Michael Niedermayer 48f37664a8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Remove #undefs for formerly forbidden system functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-07 23:39:31 +01:00
Dave Yeo f9c6044a6f Fix compilation with os2threads
Signed-off-by: Dave Yeo <daveryeo@telus.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-07 20:46:44 +01:00
Diego Biurrun 86f910806b Remove #undefs for formerly forbidden system functions
The macros forbidding the system functions no longer exist, obviating
the need for the #undefs.
2013-11-07 00:26:15 +01:00
Michael Niedermayer 983ed20c1c Merge commit 'ef51692a49d58963966adca55c62da9c34c3c7e1'
* commit 'ef51692a49d58963966adca55c62da9c34c3c7e1':
  Revert "w32pthread: help compiler figure out undeeded code"

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 12:46:12 +02:00
Michael Niedermayer a8ddafb0f4 Merge commit '4332bf98dc051fd1ffbd9d4ddc1c5e55790c96f1'
* commit '4332bf98dc051fd1ffbd9d4ddc1c5e55790c96f1':
  w32threads: Don't use function pointers when linking directly to newer APIs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 12:41:16 +02:00
Martin Storsjö ef51692a49 Revert "w32pthread: help compiler figure out undeeded code"
This reverts commit 4622f11f9c.

The compiler should be able to do the dead code elimination now
without this when the cond_* names point directly to the real
functions instead of to local function pointers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 23:12:49 +03:00
Martin Storsjö 4332bf98dc w32threads: Don't use function pointers when linking directly to newer APIs
This reduces the call overhead slightly. More noticeably, it
restores the earlier (unintended?) feature that condition variable
functions work just fine even if w32thread_init() hasn't been called.
This was broken as a side effect of 4622f11f9, if explicitly targeting
Vista+.

This makes w32threading work in VP8 again, if targeting Vista+.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 23:12:28 +03:00
Michael Niedermayer 221a99aae7 Merge commit '4622f11f9c83db8a2e08408c71ff901826ca652c'
* commit '4622f11f9c83db8a2e08408c71ff901826ca652c':
  w32pthread: help compiler figure out undeeded code

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-22 13:09:24 +02:00
Rafaël Carré 4622f11f9c w32pthread: help compiler figure out undeeded code
The emulation code is not needed when targetting Vista+
This helps getting rid of CreateSemaphore symbol, which is
forbidden in Windows Store apps.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-21 14:20:33 +01:00
Stephen Hutchinson 2c25e83b1d avisynth: Support video input from AviSynth 2.5 properly.
Uses the 2.5 compatibility header included with the variant of
FFMS2 that uses AviSynth's C-interface. A copy of this header is
now provided in compat/avisynth.

avs_get_row_size_p and avs_get_height_p changed between versions
2.5 and 2.6. Since the avisynth_c.h header that avformat uses
assumes AviSynth 2.6, it would cause 2.5 to crash if given any
kind of real video (the Version() function was known to work,
though).

AvxSynth was unaffected by this issue because, despite being based
on AviSynth 2.5.8 and using 2.5.8's interface version number of 3,
it actually uses 2.6's versions of these functions.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 14:27:25 +02:00
Michael Niedermayer 25ffaf5277 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  compat: Add missing license boilerplates

Conflicts:
	compat/tms470/math.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-19 11:08:38 +02:00
Michael Niedermayer c88503e3f6 Merge commit '439902e0d68a0f0d800c21b5e6b598d5fa0c51da'
* commit '439902e0d68a0f0d800c21b5e6b598d5fa0c51da':
  Employ consistent LIBAV_COMPAT_ multiple inclusion guards in compat/

Conflicts:
	compat/aix/math.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-19 10:56:10 +02:00
Diego Biurrun 910042072a compat: Add missing license boilerplates 2013-07-18 18:12:38 +02:00
Diego Biurrun 439902e0d6 Employ consistent LIBAV_COMPAT_ multiple inclusion guards in compat/
Also fix a comment and an #endif comment.
2013-07-18 18:12:38 +02:00
Michael Niedermayer 47ca9f041c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  compat: wrap math.h to avoid AIX-specific clashes

Conflicts:
	configure

See: bf18abb2eb, 0915b531bc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-05 13:11:06 +02:00
Luca Barbato d3635f3ab0 compat: wrap math.h to avoid AIX-specific clashes
AIX defines a class() function in its math.h header without any
guard.
2013-07-04 21:54:32 +02:00