Commit Graph

345 Commits

Author SHA1 Message Date
wm4 028faacff5 video: add metadata handling for spherical video
This adds handling of spherical video metadata: retrieving it from
demux_lavf and demux_mkv, passing it through filters, and adjusting it
with vf_format. This does not include support for rendering this type of
video.

We don't expect we need/want to support the other projection types like
cube maps, so we don't include that for now. They can be added later as
needed.

Also raise the maximum sizes of stringified image params, since they
can get really long.
2017-08-21 14:56:07 +02:00
Martin Herkt 82d9419f62
Revert "x11: drop xscrnsaver use"
This broke screensaver/powersave inhibition with at least KDE and
LXDE. This is a release blocker.

Since fdo, KDE and GNOME idiots seem to be unable to reach
a consensus on a simple protocol, this seems unlikely to get
fixed upstream this year, so revert this change.

Fixes #4752.
Breaks #4706 but I don’t give a damn.

This reverts commit 3f75b3c343.
2017-08-20 09:18:39 +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 3f75b3c343 x11: drop xscrnsaver use
It's an ancient X11 protocol extension that apparently nobody uses
anymore (desktop environments in particular have replaced it with
equally bad protocols that require tons of dependencies). Users keep
complaining about it being a required dependency.

The impact is likely minimal to none.

Fixes #4706 and other annoying people.
2017-08-08 12:55:41 +02:00
feixm1 a434892208 build: fix dependencies for Cygwin environment
This replaces previous commit with same intentions. This time, with
proper formating (no tabs in code).
2017-08-08 11:41:56 +02:00
Aman Gupta a680c643eb wscript: fix build of videotoolbox hwaccel for iOS 2017-08-05 22:10:14 +03:00
Jan Ekström 1a0d92aeca build: re-add and re-structurize the glob() checks
* If we have glob() supported, we have `HAVE_GLOB = 1'.
* If we have specifically POSIX glob(), we have
  `HAVE_GLOB_POSIX = 1`.
* If we have specifically Win32 glob(), we have
  `HAVE_GLOB_WIN32 = 1`
2017-08-05 01:51:29 +03:00
Jan Ekström 69650851f8 build: move Android environment check to main dependencies
Additionally change the description to better match what Android is,
which is an "environment". The original positioning of this check
was unfortunate.
2017-08-05 01:51:29 +03:00
Niklas Haas 1aab037601 vd_lavc: decode embedded ICC profiles
Since these need to be refcounted, we throw them directly into struct
mp_image instead of being part of mp_colorspace. Even though they would
semantically make more sense in mp_colorspace, having them there is
really awkward because mp_colorspace is passed around and stored a lot,
and this way their lifetime is exactly tied to the lifetime of the
mp_image associated with it.
2017-08-03 21:48:25 +02:00
wm4 dd408e68ed d3d: make DXVA2 support optional
This partially reverts the change from a longer time ago to always build
DXVA2 and D3D11VA together.

To make it simpler, we change the following:
- building with ANGLE headers is now required to build D3D hwaccels
- if DXVA2 is enabled, D3D11VA is still forcibly built
- the CLI vo_opengl ANGLE backend is now under --egl-angle-win32

This is done to reduce the dependency mess slightly.
2017-06-30 18:57:37 +02:00
wm4 b8bdb0ba4e build: allow --disable-zlib
Since strictly speaking, it's still optional. It's just very much
recommended not to disable it.
2017-06-29 11:15:11 +02:00
Pedro Pombeiro 4637b029cd Universal Windows Plaform (UWP) support
libmpv only. Some things are still missing.

Heavily reworked.

Signed-off-by: wm4 <wm4@nowhere>
2017-06-29 10:36:16 +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 70a70b9da3 build: replace glob() check and assume it's always in POSIX
POSIX requires glob(), so no need to check for it. Together with the
fact that we can emulate glob() on Windows, glob() is always available.
2017-06-29 10:30:13 +02:00
wm4 0b77f6fd22 build: remove unnecessary dlopen check
Probably became unnecessary with the vf_dlopen removal.
2017-06-29 10:29:43 +02:00
wm4 5cd7b1c8a6 build: pick up new libavcodec D3D hwaccel API
This was enabled for Libav already. The patches got merged into FFmpeg
now.
2017-06-27 18:08:34 +02:00
wm4 7b84a3b04e build: disable ancient V4L TV support by default 2017-06-25 11:59:03 +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 9f461b85bf Revert "osdep: NetBSD pthread_setname_np()"
This reverts commit 2e81698d28.

Seems like this was a patch applied from someone who can't agree to LGPL
relicensing (see previous commit), with the author field not properly
set.

This is not so important anyway, so just revert it.
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
Niklas Haas deb9370779 vd: use ST.2086 / HDR10 MaxCLL in addition to mastering metadata
MaxCLL is the more authoritative source for the metadata we are
interested in. The use of mastering metadata is sort of a hack anyway,
since there's no clearly-defined relationship between the mastering peak
brightness and the actual content. (Unlike MaxCLL, which is an explicit
relationship)

Also move the parameter fixing to `fix_image_params`

I don't know if the avutil check is strictly necessary but I've included
it anyway to be on the safe side.
2017-06-18 20:54:44 +02:00
wm4 c680cfd18a vf_dlopen: remove this filter
It was an attempt to move some MPlayer filters (which were removed from
mpv) to external, loadable filters. That worked well, but then the
MPlayer filters were ported to libavfilter (independently), so they're
available again. Also there is a more widely supported and more advanced
loadable filter system supported by mpv: vapoursynth.

In conclusion, vf_dlopen is not useful anymore, confusing, and requires
quite a bit of code (and probably wouldn't survive the rewrite of the
mpv video filter chain, which has to come at some point). It has some
implicit dependencies on internal conventions, like possibly the format
names dropped in the previous commit.

We also deprecated it last release. Drop it.
2017-06-18 13:55:40 +02:00
Avi Halachmi (:avih) 071118e4d2 js: wscript: use pkgconfig for mujs (recently added .pc and 1.0.0 tag) 2017-06-16 15:24:24 +03:00
Avi Halachmi (:avih) d223a63bc5 js: add javascript scripting support using MuJS
Implements JS with almost identical API to the Lua support.

Key differences from Lua:
- The global mp, mp.msg and mp.utils are always available.
- Instead of returning x, error, return x and expose mp.last_error().
- Timers are JS standard set/clear Timeout/Interval.
- Supports CommonJS modules/require.
- Added at mp.utils: getenv, read_file, write_file and few more.
- Global print and dump (expand objects) functions.
- mp.options currently not supported.

See DOCS/man/javascript.rst for more details.
2017-06-14 12:29:32 +02:00
wm4 0754cbc83e d3d: add support for new libavcodec hwaccel API
Unfortunately quite a mess, in particular due to the need to have some
compatibility with the old API. (The old API will be supported only in
short term.)
2017-06-08 21:51:25 +02:00
wm4 11c7775b2c build: enable cplugins by default
There's probably no reason to keep this disabled. The -rdynamic (and the
approach we use) is probably a bit scary, but should not break anything.

Just to be sure I'm hard-disabling this on win32 anyway. We know it
can't work there in its current form.

Fixes #4491.
2017-06-07 20:43:59 +02:00
wm4 83a9b0bc48 videotoolbox: support new libavcodec API
The new API has literally no advantages (other than that we can drop
mp_vt_download_image and other things later), but it's sort-of uniform
with the other hwaccels.

"--videotoolbox-format=no" is not supported with the new API, because it
doesn't "fit in". Probably could be added later again.

The iOS code change is untested (no way to test).
2017-05-24 15:25:48 +02:00
wm4 2b616c0682 vo_opengl: drop TLS usage
TLS is a headache. We should avoid it if we can.

The involved mechanism is unfortunately entangled with the unfortunate
libmpv API for returning pointers to host API objects. This has to be
kept until we change the API somehow.

Practically untested out of pure laziness. I'm sure I'll get a bunch of
reports if it's broken.
2017-05-11 17:47:33 +02:00
wm4 99cef59fc9 dvb: disable by default
It fails building with some older kernel headers, and the current test
does not auto-disable it in these cases.

Since DVB isn't going to be used by many people, I think disabling it by
default is reasonable.
2017-05-11 08:19:02 +02:00
wm4 f38bd0f25a stream_smb: disable by default, mark as GPLv3
It seems libsmbclient has been GPLv3 for years. Also, it's certainly not
LGPL (unlike some of its support libs like talloc). Thus, mpv built with
Samba support is GPLv3.

Disable it by default, so we don't have to go through the trouble to
indicate the correct license in our output, and we don't trick people
into distributing stuff under the wrong license.
2017-05-11 08:19:02 +02:00
wm4 0d122f8963 wscript: make OpenGL VO failure message less misleading
It doesn't even use OpenGL header anymore. What it needs are EGL and GLX
libs/header and similar.
2017-05-04 23:44:06 +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
wm4 f59371de21 video: drop vaapi/vdpau hw decoding support with FFmpeg 3.2
This drops support for the old libavcodec APIs. Now FFmpeg 3.3 or FFmpeg
git is required. Libav has no release with the new APIs yet, so for
Libav git as of a few weeks or months ago or so is required if you want
to use Libav.

Not much actually changes in hwdec_vaegl.c - some code is removed, but
the reindentation inflates the diff.
2017-04-23 16:07:03 +02:00
wm4 927afa311d build: make various x11 protocol extension libs mandatory
Reduces the ifdeffery, which is good and will avoid silent breakages, or
weird behavior if a lib is omitted.

Also reorder the x11_common.c include statements.
2017-04-21 07:30:03 +02:00
Ricardo Constantino aa4b0e319b
wscript: don't make dvdread-common an option
This just checks if dvdread or dvdnav are enabled so it can
compile dvdread code.

Change description to be clearer on what this does differently from
--enable-dvdread.
2017-04-07 16:26:02 +01:00
wm4 eb83ee4a4a vo_opengl: add our own copy of OpenGL headers
gl_headers.h is basically header_fixes.h done consequently. It contains
all OpenGL defines (and some typedefs) we need. We don't include GL
headers provided by the system anymore.

Some care has to be taken by certain windowing APIs including all of
gl.h anyway. Then the definitions could clash. Fortunately, redefining
preprocessor symbols to the same content is allowed and ignored. Also,
redefining typedefs to the same thing is allowed in C11. Apparently the
latter is not allowed in C99, so there is an imperfect attempt to avoid
the typedefs if required API symbols are apparently present already.

The nost risky part about this are the standard typedefs and GLAPIENTRY.
The latter is different only on win32 (and at least consistently so).
The typedefs are mostly based on stdint.h typedefs, which khrplatform.h
clumsily emulates on platforms which don't have it. The biggest
difference is that we define GLsizeiptr directly to ptrdiff_t, instead
of checking for the _WIN64 symbol and defining it to long or long long.

This also typedefs GLsync to __GLsync, just like the khronos headers.
Although symbols prefixed with __ are implementation reserved, khronos
also violates this rule, and having the same definition as khronos will
avoid problems on duplicate definitions.

We can simplify the build scripts too. The ios-gl check seems a bit
wrong now (what we really want to test for is EAGLContext), but I can't
test and thus can't improve it.

cuda_dynamic.h redefined two GL symbols; just include the new headers
directly instead.
2017-04-07 15:09:27 +02:00
wm4 258d6b4a35 wscript: avoid compose_checks in one case
Avoid it where we can, because it tends to have unexpected side-effects.
(Probably not in this case, but still a reason to avoid it.)
2017-04-06 08:42:18 +02:00
wm4 755ce9dac5 build: replace android-gl check with a standard GLES3 check
There's no reason to make it Android specific, as it uses standard
include paths.
2017-04-06 08:35:47 +02:00
Ricardo Constantino 1d2910af95
wscript: fix broken build with dvdread+dvdnav in 34e6a26
Didn't know waf actually tried to compile the same files twice.
2017-03-31 20:17:01 +01:00
Ricardo Constantino 34e6a26f4d
wscript: decouple dvdnav check from dvdread
Reallows enabling dvdnav without enabling dvdread which was broken
in 77cbb3543 when they were both disabled by default.
Since dvdnav requires dvdread, we can enable dvdread:// even if
--enable-dvdread isn't passed.

Fixes #4290
2017-03-31 16:46:58 +01:00
Akemi f8a223b7ac osx: initial Touch Bar support 2017-03-26 20:26:18 +02:00
wm4 a52a52fa6e vdpau: support new vdpau libavcodec decode API
The new API works like the new vaapi API, using generic hwaccel support.

One minor detail is the error message that will be printed if using
non-4:2:0 surfaces (which as far as I can tell is completely broken in
the nVidia drivers and thus not supported by mpv). The HEVC warning
(which is completely broken in the nVidia drivers but should work with
Mesa) had to be added to the generic hwaccel code.

This also trashes display preemption recovery. Fuck that. It never
really worked. If someone complains, I might attempt to add it back
somehow.

This is the 4th iteration of the libavcodec vdpau API (after the
separate decoder API, the manual hwaccel API, and the automatic vdpau
hwaccel API). Fortunately, further iterations will be generic, and not
require much vdpau-specific changes (if any at all).
2017-03-23 11:14:11 +01:00
wm4 77cbb35437 build: disable optical media libs by default (DVD/BD/CD)
Pure garbage.
2017-03-15 01:20:47 +01:00
Alexis Nootens 1245ac1dc5 wscript: substitute cplugins linker flag for macOS compatiblity
For an unknown reason, '-Wl -export-dynamic' doesn't work anymore
on the last macOS build (10.12.3 with Apple LLVM 8.0.0) so forcing
cplugins is useless because the check fails. Replacing the linker
option with its substitute '-rdynamic' do the trick.

The syms module from waf still works as expected and only the
symbols specified in mpv.def are exported.
2017-03-06 15:37:44 +01:00
wm4 c0cbe74912 wscript: drop pointless libavcodec vaapi.h/dxva2.h/d3d11va.h checks
Not needed under any circumstances. While the Windows ones export
functions to which we must link, these functions are always available,
even if libavcodec was compiled with D3D disabled.
2017-02-20 08:46:05 +01:00
James Ross-Gowan f9369750b1 wscript: fix --egl-angle-lib for waf 1.9 2017-02-19 23:49:16 +11:00
wm4 81efe20cd7 atomic: remove __atomic builtin usage
Using these was a temporary solution while some compilers implemented
the underlying atomic mechanisms, but not the C11 language parts (or
that's what I guess). Not really useful for us anymore. Also, there is
the slight risk of having subtly incorrect semantics by using
potentially changing compiler internals and such.
2017-02-13 06:45:40 +01:00
James Ross-Gowan e0250b9604 vo_opengl: angle: rewrite with custom swap chain
This replaces the old backend that exclusively used EGL windowing with
one that can also use ANGLE's ability to render to directly to a
texture. The advantage of this is that it allows mpv to create the swap
chain itself and this allows mpv to use a flip-mode swap chain on a HWND
(which avoids problems with DirectComposition) and to use a longer swap
chain that has six backbuffers by default (which reportedly fixes
problems with rendering 24fps video on 24Hz monitors.)

Also, "screenshot window" should now work on DXGI 1.2 and up (Windows 8
and up.)
2017-02-07 22:45:07 +11:00
wm4 dccb752b5f build: fix --disable-gl if cuda is enabled
video/out/opengl/hwdec_cuda.c is enabled with cuda-hwaccel. But it makes
only sense to build if GL is enabled, and in fact it fails to link
without GL as it calls a specific GL helper function.

In theory it would be perfectly possible to use cuda-copy with GL
disabled. But I'm not bothering with the complexity.
2017-01-30 09:34:10 +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