Commit Graph

156 Commits

Author SHA1 Message Date
Kevin Mitchell 70a190af04 build: fix missing windows libraries 2015-03-16 21:27:48 -07:00
wm4 ae6019cbc9 build: simplify windows checks
There's no reason to do finegrained checks for libraries which always
must be present. It also reduces the number of extra dependencies.
2015-03-11 23:44:34 +01:00
Stefano Pigozzi ca0b33e9b1 build: disable tests by default
Having them autodetect is a bad idea since it would link cmocka in the main
mpv binary (which users don't want).
2015-03-10 18:22:16 +01:00
wm4 dfa562b5db build: make vdpau and dxva2 checks nicer
Using check_statement() with an empty statement just to check for the
header is quite a hack. Fix check_headers() (so it takes a "use"
parameter), and use it for the checks instead.
2015-03-06 11:31:06 +01:00
wm4 baa354c64c build: check whether hwaccels are enabled in FFmpeg
FFmpeg can be compiled with them disabled, and then it won't provide the
public headers specific to these APIs, causing mpv compilation failure.
2015-03-05 17:10:00 +01:00
wm4 c31e5da734 Remove some FFmpeg/Libav compatibility hacks
All of these are now in the supported FFmpeg and Libav versions.

The 3 remaining API checks are for FFmpeg-only things.
2015-03-03 12:28:46 +01:00
wm4 5808f1c408 build: bump required FFmpeg/Libav libraries
The af_lavrresample commit made compilation fail on Libav 10, so I think
it's time to require somewhat more recent dependencies.

Libav 11 is the latest release, and FFmpeg 2.4 seems to correspond to
Libav 11. So use these.

Also adjust the configure failure message. Instead of (accidentally)
printing the pkg-config versions twice, print the release version
numbers too. This is helpful, because the release version numbers are
completely different from the pkg-config ones.

I will probably remove some compatibility hacks in the following commits
too.
2015-03-03 11:56:44 +01:00
Niklas Haas a76cc1dafc
Revert "Revert recent vo_opengl related commits"
Omitted a simple, but devastasting check. Fixed the relevant commits
now.

This reverts commit 8d24e9d9b8.

diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 9c8a643..f1ea03e 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1034,9 +1034,9 @@ static void compile_shaders(struct gl_video *p)
     shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma);
     shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma);
     shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886",
-                   gamma_fun == MP_CSP_TRC_BT_1886);
+                   use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886);
     shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB",
-                   gamma_fun == MP_CSP_TRC_SRGB);
+                   use_linear_light && gamma_fun == MP_CSP_TRC_SRGB);
     shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid);
     if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3)
         shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
2015-02-28 20:23:47 +01:00
wm4 8d24e9d9b8 Revert recent vo_opengl related commits
Breaks vo_opengl by default. I'm hot able to fix this myself, because I
have no clue about the overcomplicated color management logic. Also,
whilethis is apparently caused by commit fbacd5, the following commits
all depend on it, so revert them too.

This reverts the following commits:
 e141caa97d
 653b0dd529
 729c8b3f64
 fbacd5de31

Fixes #1636.
2015-02-28 19:29:03 +01:00
Niklas Haas 653b0dd529
screenshots: check for AVFrame csp support
Apparently, libav stable is old enough to not have these fields.
2015-02-28 01:39:31 +01:00
wm4 a22de99544 input: avoid creating world-writeable file with --input-unix-socket
This requires fchmod(), which is not necessarily available everywhere.
It also might not work at all. (It does work on Linux.)
2015-02-26 21:44:35 +01:00
Stefano Pigozzi f3eb6ae783 remove dead comment 2015-02-25 22:17:22 +01:00
Stefano Pigozzi 8e80b3fd2f build: move QuartzCore linking to the cocoa check
It's needed for the DisplayLink functions so it must be enabled for the basic
cocoa code.
2015-02-25 22:13:07 +01:00
wm4 78fb7cbf4d wscript: adjust some pkg-config checks
Make the version a separate argument, like in all other pkg-config
checks.
2015-02-23 15:56:55 +01:00
wm4 076037531f build: slightly improve libass version number test failure message 2015-02-21 17:39:48 +01:00
wm4 c314385280 build: require recent libass
Nobody should use an older version. It's perfectly backwards and forward
compatible, so distros have no excuse not to package a recent version.
Older versions lack tons of bug fixes (some of them crashing bugs, and
potentially security relevant).

With love to Debian, which is still on 0.10.2.
2015-02-18 21:13:11 +01:00
wm4 6e50e59386 vf_vapoursynth: replace a hack with a newer VS API function
The new function does exactly what we need. Replaces the old hack, which
created the vscore by running an empty script.
2015-02-16 20:56:00 +01:00
wm4 b6ab34fc98 af_rubberband: pitch correction with librubberband
If "--af=rubberband" is used, librubberband will be used to speed up or
slow down audio with pitch correction.

This still has some problems: the audio delay is not calculated
correctly, so the audio position jitters around by a few milliseconds.
This will probably ruin video timing.
2015-02-11 00:29:12 +01:00
Stefano Pigozzi f8d7756a14 build: add option to generate a clang compilation database
The compilation database is a JSON file[1] storing all compilation flags. That
is useful for tools using libclang for code completion and error reporting
(for example: YouCompleteMe for vim).

[1]: http://clang.llvm.org/docs/JSONCompilationDatabase.html
2015-02-05 21:06:34 +01:00
wm4 1ba03f6813 build: disable pdf build by default
rst2pdf keeps having sporadic layouting failures, causing build
failures.
2015-02-02 12:06:06 +01:00
wm4 6f1357d876 build: fix v4l2 support on NetBSD
It was accidentally broken. Tested by a NetBSD user. May help with other
BSDs.
2015-01-31 16:14:14 +01:00
wm4 a0ed62fc1d build: remove bogus client API examples build
The symlink trick made waf go crazy (deleting source files, getting
tangled up in infinite recursion... I wish I was joking). This means we
still can't build the client API examples in a reasonable way using the
include files of the local repository (instead of globally installed
headers). Not building them at all is better than deleting source files.

Instead, provide some manual instructions how to build each example
(except for the Qt examples, which provide qmake project files).
2015-01-23 15:32:23 +01:00
wm4 5a93dd6245 build: reduce worst case with mismatching FFmpeg pkg-config files
Handles mismatching libavfilter/libavdevice and libavcodec slightly
better.

libavfilter and libavdevice are optional, and thus are checked
separately and at a later point of the build. But if a user system has
at least 2 FFmpeg installations, and one of them lacks libavfilter or
libavdevice, the build script will pick up the libavfilter/libavdevice
package of the "other" FFmpeg installation. The moment waf picks these
up, all include paths will start pointing at the "wrong" FFmpeg, and the
FFmpeg API checks done earlier might be wrong too, leading to obscure
and hard to explain compilation failures.

Just moving the libavfilter/libavdevice checks before the FFmpeg API
checks somewhat deals with this issue. Certainly not a proper solution,
but since the change is harmless, and there is no proper solution, and
the change doesn't actually add anything new, why not.
2015-01-20 15:53:40 +01:00
wm4 6b24cb2756 win32: remove check for SetPriorityClass()
This function is always available, which is reflected by the fact that
the configure check doesn't actually bother to check for its existence.
Instead, MinGW and Cygwin imply it. The check was probably "needed" when
the priority code was still in a separate source file.

Remove the check, and use _WIN32 for testing for the win32 API (in a
bunch of other places too).
2015-01-20 15:18:51 +01:00
wm4 594114e660 build: prefer libswresample over libavresample on FFmpeg
I hoped we could always use libavresample, but the FFmpeg project is
being too dickish to enable libavresample by default - which means we
need our libswresample-to-libavresample hack anyway.

Give up, and use the "supported" one of the duplicated libraries when
compiling against FFmpeg (relying on the fact that libswresample won't
be present if compiling against Libav).
2015-01-02 01:43:59 +01:00
wm4 4ed0907f2d build: try to make examples build both in-tree and out-of-tree
The examples simple.c and cocoabasic.m can be compiled without
installing libmpv. But also, they didn't use the correct include path
libmpv programs normally use, so they couldn't be built with a properly
installed system-libmpv. That's pretty bad for examples, which are
supposed to show how to use libmpv correctly.

So do some bullshit that symlinks libmpv to a "mpv" include directory
under the build directory. This name-mismatch is a direct consequence of
the bullshit done in 499a6758 (requested in #539 for dumb reasons). (We
don't want to name the client API headers directory "mpv", because that
would be too unspecific, and clashes with having the mpv binary in the
same directory.)

If you have spaces or other "unusual" characters in your paths, the
build will break, because I couldn't find out where waf hides its
function to escape shell parameters (or a way to invoke programs
without involving the shell). Neither does such a thing to be
documented, nor do they seem to have a clear way to do this in
their code.

This also doesn't compile the Qt examples, because everything becomes
even more terrible from there on.
2015-01-02 00:00:03 +01:00
wm4 bafb9b2271 win32: add native wrappers for pthread functions
Off by default, use --enable-win32-internal-pthreads .

This probably still needs a lot more testing. It also won't work on
Windows XP.
2015-01-01 15:10:42 +01:00
wm4 4075518011 ao_portaudio: remove this audio output
It's just completely useless. We have good native support for all 3
desktop platforms, and ao_sdl or ao_openal as fallbacks.
2014-12-29 18:53:12 +01:00
Stefano Pigozzi 54aea7d5de chmap_sel: add multichannel fallback heuristic
Instead of just failing during channel map selection, try to select a close
layout that makes most sense and upmix/downmix to that instead of failing AO
initialization. The heuristic is rather simple, and uses the following steps:

1) If mono is required always prefer stereo to a multichannel upmix.
2) Search for an upmix that is an exact superset of the required channel map.
3) Search for a downmix that is the exact subset of the required channel map.
4) Search for either an upmix or downmix that is the closest (minimum difference
   of channels) to the required channel map.
2014-12-29 17:56:53 +01:00
wm4 3fdb6be316 win32: add mmap() emulation
Makes all of overlay_add work on windows/mingw.

Since we now don't explicitly check for mmap() anymore (it's always
present), this also requires us to make af_export.c compile, but I
haven't tested it.
2014-12-26 17:30:10 +01:00
wm4 161bdbdb7a build: require alsa libs not older than 6 years
Some IEC958 flags we use have been introduced in 2008, which makes
compilation fail on older systems.
2014-12-16 06:12:46 +01:00
Stefano Pigozzi 4979f2f452 build: update to waf 1.8.4 2014-12-04 21:55:00 +01:00
wm4 44edb13443 video: remove things forgotten in previous commit
Oops.
2014-12-03 23:12:22 +01:00
wm4 809936fdb9 video/filter: kill vf_pp (libpostproc)
This is an ancient filter, and we assume it's not useful anymore.

If you really want this, it's still available in libavfilter (e.g. via
--vf=lavfi=[pp...]). The disadvantage is that mpv doesn't pass through
QP information to libavfilter. (This was probably the reason vf_pp still
was part of mpv - it was slightly easier to pass QP internally.)
2014-12-03 23:01:19 +01:00
Stefano Pigozzi 2658dc712d build: move --cplayer to build options
This way it’s near to it’s libmpv counterparts
2014-11-28 15:57:13 +01:00
Stefano Pigozzi b4deba7cc9 build: move --dvbin to TV features, remove --dvb 2014-11-28 15:57:04 +01:00
Stefano Pigozzi 8fcd4b572a build: fix typos
thanks to @Nikoli
2014-11-28 15:40:55 +01:00
wm4 ed59234378 wscript: move down some less important checks 2014-11-17 23:50:32 +01:00
wm4 41fd7fa021 build: check for mingw-w64 explicitly
And fail building if not any of MingW-w64 or POSIX are found. Obviously,
mpv needs one of those 2.
2014-11-17 23:47:30 +01:00
wm4 0025f0042f atomics: add atomic_compare_exchange_strong()
As usual, we use C11 semantics, and emulate it if <stdatomic.h> is not
available.

It's a bit messy with __sync_val_compare_and_swap(). We assume it has
"strong" semantics (it can't fail sporadically), but I'm not sure if
this is really the case. On the other hand, weak semantics don't seem to
be possible, since the builtin can't distinguish between the two failure
cases that could occur. Also, to match the C11 interface, use of gcc
builtins is unavoidable. Add a check to the build system to make sure
the compiler supports them (although I don't think there's any compiler
which supports __sync_*, but not these extensions).

Needed for the following commit.
2014-11-09 15:12:54 +01:00
wm4 bebfaae666 vo_opengl: minimal EGL on X11 support
Pretty useless and only good for testing.

Does not include any form of GLES support.
2014-11-04 01:41:37 +01:00
Stefano Pigozzi fba8fedf66 build: remove bundle support from waf
Use TOOLS/osxbundle.py instead. It's just better and less hacky.
2014-11-01 11:00:03 +01:00
wm4 b66669ef2c build: fix 'ar' invocation when cross-compiling
This shouldn't use the host's 'ar' when building static libs. It only
worked until now because Linux 'ar' is usually built with PE support.

Couldn't confirm whether it works, because this dumb crap is just
broken when cross-compiling to mingw.
2014-11-01 00:28:19 +01:00
wm4 9b45b48c46 Drop libquvi support
No development activity (or even any sign of life) for almost a year.

A replacement based on youtube-dl will probably be provided before the
next mpv release. Ask on the IRC channel if you want to test.

Simplify the Lua check too: libquvi linking against a different Lua
version than mpv was a frequent issue, but with libquvi gone, no
direct dependency uses Lua, and such a clash is rather unlikely.
2014-10-25 20:18:22 +02:00
wm4 423a7de676 video: initial dxva2 support
Shamelessly stolen from ffmpeg. It probably doesn't work - you can debug
it yourself.
2014-10-25 19:25:22 +02:00
wm4 a10321835e build: enable cdda:// by default again
Apparently people want this. (???)

See #1214.
2014-10-25 17:20:18 +02:00
wm4 7593706af0 terminal: drop ncurses/terminfo/termcap support
It was disabled since the last release, and nobody complained loudly.

Further details see commit 4b5c3ea7.
2014-10-23 19:48:42 +02:00
wm4 2e81698d28 osdep: NetBSD pthread_setname_np()
From: bugmen0t on github

Fixes #1207.
2014-10-22 01:04:52 +02:00
wm4 9ba6641879 Set thread name for debugging
Especially with other components (libavcodec, OSX stuff), the thread
list can get quite populated. Setting the thread name helps when
debugging.

Since this is not portable, we check the OS variants in waf configure.
old-configure just gets a special-case for glibc, since doing a full
check here would probably be a waste of effort.
2014-10-19 23:48:40 +02:00
Stefano Pigozzi 7e66a35969 fix build on OS X and BSD 2014-10-19 12:55:29 +02:00