Commit Graph

211 Commits

Author SHA1 Message Date
Jan Ekström 044f1ffcd5 build: bump wayland-protocols requirement to 1.12+
The stable xdg-shell protocol is only available from this version.
2018-04-29 14:52:47 +03:00
Jan Ekström 46d2f1f08d build: fixup vendored wayland protocols with variants
Utilize the SRC variable for this to get a built-in relative path.
Can be tested by adding `--variant="random_string"` to configure and
build.
2018-04-15 14:09:50 +03:00
Akemi 12b90e744d build: fix swift build with waf 1.8.4
with older waf versions a node doesn't return an absolute path but just
a relative one. fix this by explicitly requesting an absolute one.

Fixes #5604
2018-03-11 22:44:26 -07:00
Akemi 938ad6ebc0 cocoa-cb: change border and borderless window styling
the title bar is now within the window bounds instead of outside. same
as QuickTime Player. it supports several standard styles, two dark and
two light ones. additionally we have properly rounded corners now and
the borderless window also has the proper window shadow.

Also make the earliest supported macOS version 10.10.

Fixes #4789, #3944
2018-02-28 00:48:44 -08:00
Akemi a17456608c build: fix dependency check on macOS
235eb60 added a needed linking flag, but too soon. this lead to some of
the configure checks to fail. add the flag in our build phase.

Fixes #5528
2018-02-16 00:48:34 -08:00
Akemi 6751b5b1c2 build: fix linking libmpv when swift features are built
the swift object file wasn't linked when libmpv was linked, which
resulted in a missing symbol error. add the swift object to the linking
list for libmpv too.

Fixes #5522
2018-02-13 20:31:09 -08:00
Akemi eb224a4a55 build: remove shell usage from swift build scripts
for convenience reasons i used strings for subprocess commands instead
of command lists, which made it mandatory to use a shell. for security
reasons, among others, we removed the shell usage and converted the
commands to actual command lists.
2018-02-13 20:31:09 -08:00
Akemi d0afd37709 build: fix swift detection with python2
c82fed8 fixed the detection with python3 but broke it on python2. the
decode function on python2 converts the str to unicode which causes
problems when concatenating to str when building. instead of decoding
the output we change the subprocess to operate in text mode.

also use check_output instead of Popen for simplicity.
2018-02-13 20:31:09 -08:00
Akemi 8762818dd2 build: fix swift detection on major swift versions
the swift version string on major versions only has two components,
major and minor, the third one is missing.
2018-02-12 08:29:22 -08:00
Akemi c82fed85b9 build: fix swift detection with python3
python3 returns bytes instead of str, unlike python2. explicitly decode
the output.
2018-02-12 08:29:22 -08:00
Akemi 3f73520897 build: fix configure on windows
configure failed because of a wrong check. fix the check and also only
check for swift on macOS.
2018-02-12 08:29:22 -08:00
Akemi c5e4538bc4 cocoa-cb: initial implementation via opengl-cb API
this is meant to replace the old and not properly working vo_gpu/opengl
cocoa backend in the future. the problems are various shortcomings of
Apple's opengl implementation and buggy behaviour in certain
circumstances that couldn't be properly worked around. there are also
certain regressions on newer macOS versions from 10.11 onwards.

- awful opengl performance with a none layer backed context
- huge amount of dropped frames with an early context flush
- flickering of system elements like the dock or volume indicator
- double buffering not properly working with a none layer backed context
- bad performance in fullscreen because of system optimisations

all the problems were caused by using a normal opengl context, that
seems somewhat abandoned by apple, and are fixed by using a layer backed
opengl context instead. problems that couldn't be fixed could be
properly worked around.

this has all features our old backend has sans the wid embedding,
the possibility to disable the automatic GPU switching and taking
screenshots of the window content. the first was deemed unnecessary by
me for now, since i just use the libmpv API that others can use anyway.
second is technically not possible atm because we have to pre-allocate
our opengl context at a time the config isn't read yet, so we can't get
the needed property. third one is a bit tricky because of deadlocking
and it needed to be in sync, hopefully i can work around that in the
future.

this also has at least one additional feature or eye-candy. a properly
working fullscreen animation with the native fs. also since this is a
direct port of the old backend of the parts that could be used, though
with adaptions and improvements, this looks a lot cleaner and easier to
understand.

some credit goes to @pigoz for the initial swift build support which
i could improve upon.

Fixes: #5478, #5393, #5152, #5151, #4615, #4476, #3978, #3746, #3739,
#2392, #2217
2018-02-12 04:49:15 -08:00
Akemi 235eb60671 build: fix linking to dev SDK on macOS
on macOS mpv was linked to the system SDK which didn't cause any
problems as long as the system SDK was the same as the dev SDK. though
it started to cause linking warnings when a new xcode version with the
SDK for the next macOS was installed. in the worst case it could also
cause linking errors. to fix this we explicitly set the SDK path to the
SDK that is used for building instead.
2018-02-12 04:49:15 -08:00
James Ross-Gowan 257a2b9646 win32: add more-POSIXy versions of open() and fstat()
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes #4711
2017-10-25 22:37:20 +11:00
Rostislav Pehlivanov 68f9ee7e0b wayland_common: rewrite from scratch
The wayland code was written more than 4 years ago when wayland wasn't
even at version 1.0. This commit rewrites everything in a more modern way,
switches to using the new xdg v6 shell interface which solves a lot of bugs
and makes mpv tiling-friedly, adds support for drag and drop, adds support
for touchscreens, adds support for KDE's server decorations protocol,
and finally adds support for the new idle-inhibitor protocol.

It does not yet use the frame callback as a main rendering loop driver,
this will happen with a later commit.
2017-10-03 19:36:02 +01:00
wm4 dc5fcced23 vd_lavc: cuda requires setting hw_device_ctx
This restores cuda/cuvid under Windows.

Cuvid is relatively useless under Windows, but this was requested.
2017-09-26 23:20:20 +02:00
orbea c09760d948 build: fix build for waf 2.0
Thanks to ita1024 for the patch.

Fixes https://github.com/mpv-player/mpv/issues/4894

Signed-off-by: wm4 <wm4@nowhere>
2017-09-22 09:14:37 +02:00
wm4 bfa9b62858 build: add preliminary LGPL mode
See "Copyright" file for caveats.

This changes the remaining "almost LGPL" files to LGPL, because we think
that the conditions the author set for these was finally fulfilled.
2017-09-21 13:56:27 +02:00
wm4 0169da86df build: remove some dead code 2017-09-19 18:37:11 +02:00
wm4 acb28e922b build: use unified dependency expressions instead of weird fields
Instead of "deps", "deps_neg", and "deps_any" fields, just have a single
"deps" field, which changes from an array to a string. The string is now
an expression, which can contain the operators &&, ||, !, and allows
grouping with ( ).

It's probably overkill. If it gets a maintenance burden, we can switch
to specifiying the dep expressions as ASTs (or maybe eval()-able Python
expressions), and we could simplify the code that determines the reason
why a dependency is not fulfilled. The latter involves a complicated
conversion of the expression AST to DNF.

The parser is actually pretty simple, and pretty much follows:
https://en.wikipedia.org/wiki/Shunting_yard_algorithm
2017-09-18 22:35:37 +02:00
wm4 72a8120daa Revert "build: rpi: rely on pkgconfig for compiler flags"
This reverts commit ea40fa36ee.

This caused strange runtime failure on Raspbian (when running mpv,
vc_dispmanx_display_open() returned 0, while other dispmanx using
programs were fine). The problem must have been something about the
compiler flags, maybe linking order or set of include paths.
2017-08-15 18:41:16 +02:00
wm4 38b367c039 build: warn against VLA
Although C99 supports them, they are optional in C11, and we don't
like/use them anyway.
2017-07-24 08:12:42 +02:00
wm4 7eca787571 build: change how some OS specific source files are selected
In a bunch of cases, we emulate highly platform specific APIs on a
higher level across all OSes, such as IPC, terminal, subprocess
handling, and more. We have source files for each OS, and they implement
all the same mpv internal API.

Selecting which source file to use on an OS can be tricky, because there
is partially overlapping and emulated APIs (consider Cygwin on Windows).
Add a pick_first_matching_dep() function to make this slightly easier
and more structured.

Also add dummy backends in some cases, to deal with APIs not being
available.

Clarify the Windows dependency identifiers, as these are the most
confusing.
2017-06-29 10:30:16 +02:00
wm4 0788d7961f build: reduce GLX test fragment
While it doesn't matter for anything, we don't really need to check for
GL symbols (neither headers nor for linking).
2017-06-22 13:17:40 +02:00
wm4 915722e035 build: remove Linux DVB test fragment
Most of the DVB test fragment was added in 2e399f39 by someone who
wasn't asked for LGPL relicensing permission. Thus remove it. (For some
weird reason, the configure check wasn't even for the later added actual
DVB code.)

Since DVB is disabled by default, this isn't too bad. But if someone
enables it, and the system doesn't support it, he will receive a weird
compilation error. That has to be good enough, until maybe someone adds
a new check.
2017-06-22 13:17:40 +02:00
wm4 e1bc592ce6 build: remove unused pvr.c test fragment 2017-06-22 13:17:40 +02:00
wm4 5c038e6999 build: simplify OSS checks and remove changes by "bugmen0t"
The user bugmen0t was apparently a shared github account with publicly
available login. Thus, we can't get LGPL relicensing permission from the
people who used this account. To relicense successfully, we have to
remove all their changes.

This commit should remove 20d1fc13, f26fb009, defbe48d. It also should
remove whatever test fragments were copied from the ancient configure,
as well as some configure logic (potentially that device path stuff).

I think this change still preserves the most important use-cases of OSS:
BSDs, and the Linux OSS emulation (the latter for testing only).
According to an OSS user, the 4front checks were probably broken anyway.
The SunAudio stuff was probably for (Open)Solaris, which is dead.

ao_oss.c itself will remain GPL, and still contains bugmen0t changes.
2017-06-22 13:17:14 +02:00
wm4 cb25bb5776 build: remove checks for libGL
We don't need to link against libGL directly, nor do we need OpenGL
headers. The only thing we need is the windowing interop stuff, such as
libEGL.
2017-04-26 17:09:16 +02:00
Ilya Tumaykin 9d80c08441 build: rely on internal GL headers for rpi check
Since mpv ships all the required OpenGL defines now,
rpi check doesn't need to check system GL headers.
2017-04-26 17:00:23 +02:00
wm4 e7e6aa3d64 demux_mkv: change license to LGPL
Most contributors have agreed. This claims it's based on gstreamer code,
but this was LGPL at the time (and still is). Contributors whose code
was removed were not accounted for. There are still some potentially
problematic cases:

06eee1b67 is potentially the most problematic case. Most of these
changes are gone due to mpv not using BITMAPINFOHEADER anymore. Some
of the other changes are rather trivial. If someone contests this and
claims that copyrightable changes are left, the original change can
simply be reverted.

62bfae140 has only 2 lines left: a "char *name;" struct field, and a
line that prints a message. All other code was removed. The parsing code
in particular was made declarative, which replaced reading this element
explicitly (and  other elements, see 1b22101c77). I'm putting the log
message under HAVE_GPL, but I don't think the declaration is
copyrightable, or the mere concept of reading this element. Redoing the
other 2 lines of code would result in the  same program text.

d41e860ba was applied by someone who (potentially) disagreed. The patch
itself is from someone who did agree, though. It's unknown whether the
applier changed the patch. But it seems unlikely, and the change was
mostly rewritten.

50a86fcc3 all demux_mkv changes were reverted (old stdout slave mode)
3a406e94d same
2e40bfa13 the old MPlayer subtitle code was completely removed
316bb1d44 completely removed in 1cf4802c1d
87f93d9d7 same
11bfc6780 relative seeks were removed in 92ba630796
be54f4813 the corresponding demux_mkv code was removed in 5dabaaf093
efd53eed6 all internal vobsub handling is now in FFmpeg
d7f693a20 removed in f3db4b0b93
e8a1b3713 removed in 522ee6b783
cfb890259 removed, see 6b1374b203 for analysis
c80808b5a same
2017-04-21 12:21:33 +02:00
Akemi f8a223b7ac osx: initial Touch Bar support 2017-03-26 20:26:18 +02:00
Ricardo Constantino e69b69add3
waf: fix linking of win32 console wrapper
Broken with waf 1.9.8 update.
Not noticed right away if previous waf version was present.
2017-02-19 03:34:27 +00:00
kwkam d9ef1333c6 waftools/checks/generic: hacks for linking against static/shared libs
When mpv is being linked against static libraries which have shared
libraries as dependencies, linker will throw error because pkg-config
with --static flag will return shared libraries which will be placed
under the -Wl,-Bstatic section, while pkg-config without --static flag
will omit the private libraries required to link the static library.

With this function users can modify the wscript to insert the dependencies
when necessary. For example, linking FFmpeg with shared OpenSSL and zlib:
'func': check_pkg_config_mixed(['crypto','ssl','z'], 'libavcodec')
2017-01-28 14:02:36 +01:00
kwkam d41f25009d wscript: add LIBRARY_PATH for library detection
MinGW GCC seems to ignore LIBRARY_PATH which causes problem
when some libraries not using pkg-config were installed to
local directory
2017-01-28 14:02:34 +01:00
Ilya Tumaykin ea40fa36ee build: rpi: rely on pkgconfig for compiler flags
Upstream provides pkgconfig files for quite some time now [1,2].
Use them to determine the required flags instead of hard coding.

This makes cross-compilation easy, which I dare to say is important for
many raspberry-pi users. This also prevents picking libEGL and libGLESv2
from mesa when they are present, which can happen with the current code.

Good distros should put these pkgconfig files into default pkg-config
search path or populate PKG_CONFIG_PATH for users. However, be nice to
everybody and manually look into '/opt/vc/lib/pkgconfig' just in case.
Hence the PKG_CONFIG_PATH mangling.

[1]: https://github.com/raspberrypi/userland/issues/245
[2]: 05d60a01d5
2017-01-28 14:02:22 +01:00
Stefano Pigozzi 68d737bd92 build: always run code generators before compiling 2017-01-07 15:00:22 +01:00
wm4 7aca328eb1 waf: don't discard line endings when using file2string.py 2017-01-05 16:48:27 +01:00
Stefano Pigozzi 737e3b1758 build: use matroska.py & file2string.py as python modules 2017-01-05 11:25:18 +01:00
wm4 ff9f5e06ff Revert "Port several python scripts to Perl"
This reverts commit fae7307931.

Before the waf build system was used, we had a configure script written
in shell. To drop the build dependency on Python, someone rewrote the
Python scripts we had to Perl. Now the shell configure script is gone,
and it makes no sense to have a build dependency on both Perl and
Python.

This isn't just a straight revert. It adds the new Matroska EBML
elements to the old Python scripts, adjusts the waf build system, and of
course doesn't add anything back needed by the old build system.

It would be better if this used matroska.py/file2string.py directly by
importing them as modules, instead of calling them via "python". But for
now this is simpler.
2016-12-17 15:43:15 +01:00
Akemi 2b8b17402e cocoa: cosmetic fixes 2016-12-16 16:32:26 +01:00
Philip Langdale 3abb6f1fef wscript: Fix cuda test to actually work when cuda SDK is not present
The test ended up failing if cuda.h wasn't present, even if cuda.h
isn't used during the actual build.

This test is attempting to establish if the ffmpeg being built
against has dynlink_cuda support. While it might theoretically be
possible to build against the older normally-linked-cuda version
of ffmpeg, it seems more trouble than it's worth.
2016-11-23 20:48:26 +01:00
Aman Gupta 3f5b41dfa3 audio/out: add AudioUnit output driver for iOS 2016-11-01 16:25:40 +01:00
Thomas Nagy d38baa65ca build: Set a default error message for #3692
This change will prevent annoying exceptions from
appearing when error messages are missing.
2016-10-21 17:11:26 +02:00
James Ross-Gowan 3751065f97 win32: build with -DINITGUID
We always want to use __declspec(selectany) to declare GUIDs, but
manually including <initguid.h> in every file that used GUIDs was
error-prone. Since all <initguid.h> does is define INITGUID and include
<guiddef.h>, we can remove all references to <initguid.h> and just
compile with -DINITGUID to get the same effect.

Also, this partially reverts 622bcb0 by re-adding libuuid.a to the
build, since apparently some GUIDs (such as GUID_NULL) are not declared
in the source file, even when INITGUID is set.
2016-09-28 21:38:52 +10:00
Josh de Kock af6126adbe ao_openal: enable building on OSX
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-09-21 12:43:14 +02:00
stepshal 9c286d7472 waftools: remove trailing newline 2016-06-08 12:01:57 +02:00
Niklas Haas 5b5db336e9 build: silence -Wunused-result
For clang, it's enough to just put (void) around usages we are
intentionally ignoring the result of.

Since GCC does not seem to want to respect this decision, we are forced
to disable the warning globally.
2016-06-07 14:12:33 +02:00
Quentin Glidic f0d7437412 build: Do not link to libGL for egl-drm
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-05-20 14:15:44 +02:00
q66 bea7675307 build: also use the iconv check on freebsd
This is necessary to make mpv build out of box on FreeBSD.
2016-05-10 23:03:53 +02:00
wm4 67888a41e7 build: make DVB test stricter
I got a report that the build on a recent aarch64 Linux kernel failed.
DVB support was detected, but errored on compilation:

In file included from ../stream/stream_dvb.c:57:0:

../stream/dvbin.h:72:5: error: unknown type name 'fe_bandwidth_t'

     fe_bandwidth_t bw;

Make the test stricter, which should take care of this. (I couldn't find
out what exactly triggered the failure, nor could I attempt to reproduce
it.)

The change in stream/dvbin.h is to make sure that this isn't caused by
incorrect header inclusion. It now includes the same files as the
configure test.
2016-04-02 20:51:39 +02:00
Stefano Pigozzi b7e613f261 build: add special openbsd case for iconv check
Fixes #2710
2016-02-01 23:04:23 +01:00
Stefano Pigozzi 7c804cd796 build: add option to customize config files system path
Some packagers need to install default config files to some path but
automatically load system configuration files from another path.

See #2704
2016-01-11 21:11:10 +01:00
Dmitrij D. Czarkoff a1f949d3b8 waf: add "lua51" ("51obsd") to list of possible lua names 2016-01-11 11:52:27 +01:00
James Ross-Gowan abbb43759a win32: build: set subsystem version
This sets the minimum supported Windows version to Windows Vista. The
subsystem version also affects some Windows API functions, including
GetSystemMetrics(SM_CXPADDEDBORDER).
2015-12-20 21:06:02 +11:00
James Ross-Gowan 647b360a0a w32: use DisplayConfig API to retrieve correct monitor refresh rate
This is based on an older patch by James Ross-Gowan. It was rebased and
cleaned up. Also, the DWM API usage present in the older patch was
removed, because DWM reports nonsense rates at least on Windows 8.1
(they are rounded to integers, just like with the old GDI API - except
the GDI API had a good excuse, as it could report only integers).

Signed-off-by: wm4 <wm4@nowhere>
2015-11-06 19:53:18 +01:00
wm4 0ae8aebb89 video: refactor GPU memcpy usage
Make the GPU memcpy from the dxva2 code generally useful to other parts
of the player.

We need to check at configure time whether SSE intrinsics work at all.
(At least in this form, they won't work on clang, for example. It also
won't work on non-x86.)

Introduce a mp_image_copy_gpu(), and make the dxva2 code use it. Do some
awkward stuff to share the existing code used by mp_image_copy(). I'm
hoping that FFmpeg will sooner or later provide a function like this, so
we can remove most of this again. (There is a patch, bit it's stuck in
limbo since forever.)

All this is used by the following commit.
2015-09-25 19:18:16 +02:00
Stefano Pigozzi d0e19b659e build: make sure the HAVE_ key is undefined on failure
Some particular checks can define the HAVE_ key on their own. To make sure
they work correctly when composed (with compose_checks) we force the HAVE_
key to be undefined if a check fails.
2015-08-19 00:15:41 +02:00
wm4 41101c2996 win32: revert wchar_t changes
Revert "win32: more wchar_t -> WCHAR replacements"
Revert "win32: replace wchar_t with WCHAR"

Doing a "partial" port of this makes no sense anymore from my
perspective. Revert the changes, as they're confusing without
context, maintenance, and progress. These changes were a bit
premature anyway, and might actually cause other issues
(locale neutrality etc. as it was pointed out).
2015-08-01 21:09:11 +02:00
wm4 fefac2c941 win32: more wchar_t -> WCHAR replacements
This was essentially missing from commit 0b52ac8a.

Since L"..." string literals have the type wchar_t[], we can't use them
for UTF-16 strings. Use C11 u"..." string literals instead. These have
the type char16_t[], but we simply assume char16_t is the same
underlying type as WCHAR. In practice, they're both unsigned short.

For this reason use -std=c11 on Windows. Since Windows is a "special"
environment (we require either MinGW or Cygwin), we don't need to worry
too much about compiler compatibility.
2015-07-30 21:50:11 +02:00
Stefano Pigozzi a3a453b69b build: remove useless class 2015-07-26 15:00:47 +02:00
wm4 dbf21467f0 build: always regenerate version hash
Until now, it only used the hash from the previous configure run,
instead of trying to get the latest hash. The "old" build system did
this correctly - we just have to use the existing logic in version.sh.

Since waf supports separate build dirs, extend version.sh with an
argument for setting the path of version.h.
2015-06-30 15:56:26 +02:00
Christian Hesse 5b085fd8b1 build: check for lua52
Arch linux is about to update to lua 5.3.x, but lua 5.2.x will be
provided by package lua52, which contains pkg-config file lua52.pc.

Signed-off-by: wm4 <wm4@nowhere>
2015-05-13 14:59:52 +02:00
wm4 27f7489adc build: exclude -Wredundant-decls
It's useless, and creates a bogus warning in subprocess-posix.c.

Since I don't know which compilers might have it by default, just change
it to -Wno-redundant-decls.
2015-05-09 19:59:52 +02:00
James Ross-Gowan ac7ecbe30c win32: use a platform-specific unicode entry-point
Add a platform-specific entry-point for Windows. This will allow some
platform-specific initialization to be added without the need for ugly
ifdeffery in main.c.

As an immediate advantage, mpv can now use a unicode entry-point and
convert the command line arguments to UTF-8 before passing them to
mpv_main, so osdep_preinit can be simplified a little bit.
2015-04-11 14:27:25 +10:00
wm4 9b59c175e3 lua: reject Lua 5.3
It simply doesn't work, and is hard to make work. Lua 5.3 is a different
language from 5.1 and 5.2, and is different enough to make adding
support a major issue. Most importantly, 5.3 introduced integer types,
which completely mess up any code which deals with numbers.

I tried to make this a compile time check, but failed. Still at least
try to avoid selecting the 5.3 pkg-config package when the generic "lua"
name is used (why can't Lua upstream just provide an official .pc
file...). Maybe this actually covers all cases.

Fixes #1729 (kind of).
2015-04-01 23:59:15 +02:00
Philip Sequeira 5035501037 build: fix building with spaces in path 2015-03-31 15:05:08 +02:00
wm4 8a4239e0c2 player: dump list of satisfied deps instead of config.h with -v
Starting to get tired of seeing the full config.h in verbose output
every time. Make it slightly more elegant by outputting the list of
satisfied dependencies instead.
2015-03-11 23:33:05 +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 445b3fbf82 buid: readd -Wparentheses
This warning wasn't overly helpful in the past, and warned against
perfectly fine code. But at least with recent gcc versions, this is the
warning that complains about assignments in if expressions (why???), so
we want to enable it.

Also change all the code this warning complains about for no reason.
2015-03-02 19:09:25 +01:00
Oliver Freyermuth 40c9e79068 stream_dvb: Always define NO_STREAM_ID_FILTER if missing.
It is also used for initialization in channel-list setup.
Should fix compilation on FreeBSD, and is more correct
since it is used unconditionally.
Reverts 6445648 .
2015-02-28 18:27:21 +01:00
wm4 64456488b3 build: improve DVB check
A use of NO_STREAM_ID_FILTER was added to the DVB code recently. While I
have no idea what it's needed for, it makes mpv fail to compile on
FreeBSD 10.1. Add it to the dvb configure check.
2015-02-27 18:52:53 +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
Stefano Pigozzi 0466ce2f98 build: print pkg-config query on failure 2015-02-21 20:25:50 +01:00
wm4 14b231119d build: fix Python 3 unicode issue with waf 1.8.6
Starting with waf 1.8.6 (in Python 3), the hcode variable isn't a
string, but a byte string.

This commit adds the solution proposed in the upstream waf bug report:
https://code.google.com/p/waf/issues/detail?id=1535

It seems a bit overly verbose, but on the other hand, this solution has
the chance of being most correct/compatible.

Fixes #1604.
2015-02-19 09:40:50 +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 e34957940b vo_opengl: cleanups after vo_opengl_old removal
Don't load all the legacy functions (including ancient extensions).
Slightly simplify function loader and context creation, now that legacy
GL doesn't need to be handled. Remove the code for drawing OSD in legacy
mode.

Remove all the header hacks, which were meant for ancient OpenGL headers
which didn't even support things like OpenGL 1.3. Instead, adjust the
GLX check to make sure we get both OpenGL 3x and 2.1 symbols. For win32
and OSX, we assume that the user has the latest headers anyway. For
wayland, we hope that things somehow go right.
2015-01-21 20:32:42 +01:00
James Ross-Gowan e93c62520e win32: make sure __STRICT_ANSI__ is not defined
__STRICT_ANSI__ disables functions and definitions that aren't in ANSI
C. Unfortunately this includes j1(), which is used by the new
ewa_lanczos code. Cygwin's CFLAGS already unset __STRICT_ANSI__, but it
should be unset for both Cygwin and MinGW.
2015-01-16 21:34:46 +11:00
wm4 3b091995a0 win32: drop hacks for possibly broken static pthreads-win32 linking
We now use threads and other pthread API a lot, and not always we use it
from threads created with pthread_create() (or the main thread). As I
understand, with static linking we would have to use
pthread_win32_thread_attach/detach_np() every time we enter or leave a
foreign thread. We don't do this, and it's not feasible either, so it's
just broken.

This still should work with dynamic pthreads-win32. The MinGW pthread
implementation should be unaffected from all of this.
2015-01-11 02:23:02 +01:00
wm4 f61b8b312d win32: request UTF-16 API variants, Vista+ APIs, and COM C macros
Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into
the build system, instead of defining them over and over in the code.
2015-01-07 21:42:44 +01:00
wm4 c4f39d2aba build: rename MPLAYER_CONFDIR define
We certainly don't use the mplayer configuration dir. The name didn't
matter, but now that it's in user-visible output (as part of config.h
being dumped in verbose mode), it's a bit too strange.
2015-01-02 03:18:16 +01:00
wm4 a2d790b3a4 player: print config.h contents in verbose mode
It was requested that mpv should print what features etc. have been
enabled at compile time. It can print the configure command line, but it
obviously doesn't include autodetected features.

I tried to think of a nicer way than dumping the config.h as text, but
this was still the simplest way.
2015-01-02 03:06:06 +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 592aa9c70c build: add -Werror=format-security, add -W flags in all platforms
The idea of using -Werror=format-security comes from MPlayer.

Try to use the compiler flags with any compiler. There's no reason not
to apply them on clang.
2014-12-17 22:24:20 +01:00
wm4 91b8a7f994 build: add checks for some compiler warning flags 2014-12-14 20:44:27 +01:00
wm4 031aef9be9 vaapi/GLX: don't access VO backend
Same as with the VDA change.
2014-12-03 21:07:18 +01:00
Stefano Pigozzi d7adb818b0 build: give precedence to Lua52 over LuaJIT
LuaJIT ships with a broken .pc file on OS X (see #1110), and leaving
Lua52 last was done only to improve libquvi interoperability.
2014-12-02 22:10:13 +01:00
Stefano Pigozzi 90e3e99021 build: fix Lua detection
We need to manually define the flag since we are using a separate identifier
for each of the Lua checks. This was done before 9b45b48 by the composed check
with a define_key (see waftools/checks/generic.py).

The pkg-config check was the only one to not redefine a define key because Waf
already does that automatically when we call the generated function with the
same identifier as the generator function. Now if they are called with two
different arguments we will get two different definitions.

Fixes #1218
2014-10-25 23:05:50 +02: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
Stefano Pigozzi f2ef3e664b build: remove useless function 2014-10-11 21:03:13 +02:00
Stefano Pigozzi d906d09162 build: update waf to version 1.8.1
Fixes #1164
2014-10-11 20:54:42 +02:00
wm4 8fd954ac8e build: add -Wno-format-zero-length
This warning makes absolutely no sense. Passing an empty string to
printf-like functions is perfectly fine. In the OSD case, it just sets
an empty message, practically clearing the OSD.
2014-09-26 13:52:55 +02:00
Stefano Pigozzi 7b0de4aa0e build: add a check_program check
This wraps waf's find_program in our own check boilerplate code so that it
can be used in the declarative dependencies section of the wscript.

Can be used like this:

    }, {
        'name': 'sed',
        'desc': 'sed program',
        'func': check_program('sed', 'SED'),
    }, {

First argument is the program name, and the second is the waf variable name
where the program path will be stored. In this example we will be able to
refer to sed with ${{SED}} when creating waf Tasks in wscript_build.

/cc @giselher: I think you need this for wayland-scanner.
2014-09-03 23:52:56 +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
Stefano Pigozzi 212374149f build: expose waf variants to the user
This allows the user to execute multiple configuration and build steps. It
can be used for several scenarios where you need different compiler flags.
2014-08-06 09:31:59 +02:00
Stefano Pigozzi 8af0d9fec8 build: syms: reindent
We avoided reindenting this in the past to allow merging upstream changes.
In hindsight these are very unlikely and we are actually doing changes on
the code, so it's better to have the correct indentation and formatting in
our source file.
2014-08-05 12:57:34 +02:00
Stefano Pigozzi b34621e1b1 build: syms: fix *.def file for mach-o binary format
There was a missing trailing newline which caused some warnings when calling
`ld`.
2014-08-05 12:13:27 +02:00
wm4 bdf607ea5f build: list exported symbols explicitly
Instead of using a regex to match names to be exported from the libmpv
dynamic shared library, use a libmpv.def file, which lists all exported
functions explicitly.

This reduces the platform specifics in syms.py. I'm not sure if the
separate compile_sym task is still needed (it could probably be
collapsed, which would concentrate the platform specifics into one
place).
2014-08-05 02:21:29 +02:00
wm4 62a79ae556 build: fix export of libmpv symbols on mingw
The _ usually prefixed to functions on Windows was unexpectedly missing.
2014-08-05 01:02:54 +02:00
Tsukasa OMOTO b0ff0527a3 build: enable compiler optimization by default 2014-07-20 00:08:36 +02:00