Commit Graph

137 Commits

Author SHA1 Message Date
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
wm4 987146362e lua: add an utility function for starting processes
Because 1) Lua is terrible, and 2) popen() is terrible. Unfortunately,
since Unix is also terrible, this turned out more complicated than I
hoped. As a consequence and to avoid that this code has to be maintained
forever, add a disclaimer that any function in Lua's utils module can
disappear any time. The complexity seems a bit ridiculous, especially
for a feature so far removed from actual video playback, so if it turns
out that we don't really need this function, it will be dropped again.

The motivation for this commit is the same as with 8e4fa5fc.

Note that there is an "#ifndef __GLIBC__". The GNU people are very
special people and thought it'd be convenient to actually declare
"environ", even though the POSIX people, which are also very special
people, state that no header declares this and that the user has to
declare this manually. Since the GNU people overtook the Unix world with
their very clever "embrace, extend, extinguish" strategy, but not 100%,
and trying to build without _GNU_SOURCE is hopeless; but since there
might be Unix environments which support _GNU_SOURCE features partially,
this means that in practice "environ" will be randomly declared or not
declared by system headers. Also, gcc was written by very clever people
too, and prints a warning if an external variable is declared twice (I
didn't check, but I suppose redeclaring is legal C, and not even the gcc
people are clever enough to only warn against a definitely not legal C
construct, although sometimes they do this), ...and since we at mpv hate
compiler warnings, we seek to silence them all. Adding a configure test
just for a warning seems too radical, so we special-case this against
__GLIBC__, which is hopefully not defined on other libcs, especially not
libcs which don't implement all aspects of _GNU_SOURCE, and redefine
"environ" on systems even if the headers define it already (because they
support _GNU_SOURCE - as I mentioned before, the clever GNU people wrote
software THAT portable that other libcs just gave up and implemented
parts of _GNU_SOURCE, although probably not all), which means that
compiling mpv will print a warning about "environ" being redefined, but
at least this won't happen on my system, so all is fine. However, should
someone complain about this warning, I will force whoever complained
about this warning to read this ENTIRE commit message, and if possible,
will also force them to eat a printed-out copy of the GNU Manifesto, and
if that is not enough, maybe this person could even be forced to
convince the very clever POSIX people of not doing crap like this:
having the user to manually declare somewhat central symbols - but I
doubt it's possible, because the POSIX people are too far gone and only
care about maintaining compatibility with old versions of AIX and HP-UX.

Oh, also, this code contains some subtle and obvious issues, but writing
about this is not fun.
2014-10-19 05:51:37 +02:00
Stefano Pigozzi 49b6fa8779 cocoa: allow to disable apple remote at compile time
Actually doesn't remove the related flags so that one can still pass the
option with the option doing nothing.
2014-10-17 19:16:58 +02:00
wm4 3093d93e1f vf_vapoursynth: add standalone Lua scripting 2014-10-12 01:33:10 +02:00
Stefano Pigozzi d906d09162 build: update waf to version 1.8.1
Fixes #1164
2014-10-11 20:54:42 +02:00
Philip Sequeira 977ff1034f build: make zsh completion directory configurable
Also, use the zsh default location (rather than the Debian one).
2014-10-11 13:26:12 +02:00
wm4 cf2add4ff9 audio: skip samples and adjust timestamps ourselves
This gets rid of this warning:

  Could not update timestamps for skipped samples.

This required an API addition to FFmpeg (otherwise it would instead
doing arithmetic on the timestamps itself), so whether it works depends
on the FFmpeg version.
2014-10-03 23:03:22 +02:00
wm4 d778130dc4 audio/out: disable ao_sndio by default
Don't build it, move it down the autoprobe list even if it's enabled. It
doesn't work well enough.
2014-09-26 15:52:29 +02:00
Alexander Preisinger b99c67f9bb build: update minimum wayland version
Uh oh.
2014-09-19 17:40:26 +02:00
wm4 e0b4daf3ad input: use libwaio for pipe input on Windows
Use libwaio to read from pipes (stdin or named pipes) on Windows. This
liberates us from nasty issues, such as pipes (as created by most
programs) not being possible to read in a non-blocking or event-driven
way. Although it would be possible to do that in a somewhat sane way
on Vista+, it's still not easy, and on XP it's especially hard. libwaio
handles these things for us.

Move pipe.c to pipe-unix.c, and remove Windows specific things. Also
adjust the input.c code to make this work cleanly.
2014-09-14 16:24:01 +02:00
wm4 5f80e3f91a ao_oss: use poll(), drop --disable-audio-select support
Replace select() usage with poll() (and reduce code duplication).

Also, while we're at it, drop --disable-audio-select, since it has the
wrong name anyway. And I have doubts that this is needed anywhere. If
it is, it should probably fallback to doing the right thing by default,
instead of requiring the user to do it manually. Since nobody has done
that yet, and since this configure option has been part of MPlayer ever
since ao_oss was added, it's probably safe to say it's not needed.

The '#ifdef SNDCTL_DSP_GETOSPACE' was pointless, since it's already used
unconditionally in another place.
2014-09-11 02:03:15 +02:00
wm4 302a04091b build: fix everything
A missing dependency entry made ./waf configure always fail.
2014-09-10 04:09:06 +02:00
wm4 e9b756c7ad input: remove central select() call
This is now unused. Get rid of it and all surrounding infrastructure,
and replace the remaining "wakeup pipe" with a semaphore.
2014-09-10 03:24:45 +02:00
Stefano Pigozzi a1d3afb395 vo_corevideo: remove this VO
This was kept in the codebase because it is slightly faster than --vo=opengl
on really old Intel cards (from the GMA era). Time to kill it, and let it rest.

Fixes #1061
2014-09-06 14:10:22 +02:00
wm4 b518142236 build: handle insane libavcodec API bullshit
The oldest supported FFmpeg release doesn't provide
av_vdpau_alloc_context(). With these versions, the application has no
other choice than to hard code the size of AVVDPAUContext. (On the other
hand, there's av_alloc_vdpaucontext(), which does the same thing, but is
FFmpeg specific - not sure if it was available early enough, so I'm not
touching it.)

Newer FFmpeg and Libav releases require you to call this function, for
ABI compatibility reasons. It's the typcal lakc of foresight that make
FFmpeg APIs terrible. mpv successfully pretended that this crap didn't
exist (ABI compat. is near impossible to reach anyway) - but it appears
newer developments in Libav change the function from initializing the
struct with all-zeros to something else, and mpv vdpau decoding would
stop working as soon as this new work is relewased.

So, add a configure test (sigh).

CC: @mpv-player/stable
2014-09-05 01:52:29 +02:00
wm4 c41fdfb4ef build: disable terminfo and termcap code by default
If nobody complains soon enough, I will remove the code completely.
2014-08-21 22:45:58 +02:00
wm4 1e04c474ab x11: listen to xrandr events
If the Xrandr configuration changes, re-read it. So if you change
display modes or screen configuration, it will update the framedrop
refresh rate accordingly.

This passes the rootwin to XRRSelectInput(), which may or may not be
allowed. But it works, and the documentation (which is worse than used
toilet paper, great job Xorg) doesn't forbid it, or in fact say anything
about what the window parameter is even used for.
2014-08-17 15:39:18 +02:00
wm4 d811f6a9ed build: use pkg-config for xscreensaver 2014-08-16 22:00:00 +02:00
wm4 f8f3a1b4a1 build: drop check for XF86keysym.h
This is always included in the Xorg development headers. Strictly
speaking it's not necessarily available with other X implementations,
but these are hopefully all dead.
2014-08-16 21:57:51 +02:00
wm4 fe782a6e95 x11: use xrandr to retrieve display refresh rate
Drop use of the ancient XF86VM, and use the slightly less ancient Xrandr
extension to retrieve the refresh rate. Xrandr has the advantage that it
supports multiple monitors (at least the modern version of it).

For now, we don't attempt any dynamic reconfiguration. We don't request
and listen to Xrandr events, and we don't notify the VO code of changes
in the refresh rate. (The later works by assuming that X coordinates map
directly to Xrandr coordinates, which probably is wrong with compositing
window manager, at least if these use complicated transformations. But I
know of no API to handle this.)

It would be nice to drop use of the Xinerama extension too, but
unfortunately, at least one EWMH feature uses Xinerama screen numbers,
and I don't know how that maps to Xrandr outputs.
2014-08-16 21:56:22 +02:00