Commit Graph

45013 Commits

Author SHA1 Message Date
wm4 af5a71f52e video: drop some unused IMGFMT aliases
These formats are supported in a generic way.

To get rid of IMGFMT_NV21, remove support from vo_direct3d.c completely.
2017-06-29 20:56:29 +02:00
wm4 1dffcb0167 vo_opengl: rely on FFmpeg pixdesc a bit more
Add something that allows is to extract the component order from various
RGBA formats. In fact, also handle YUV, GBRP, and XYZ formats with this.

It introduces a new struct mp_regular_imgfmt, that hopefully will
eventually replace struct mp_imgfmt_desc. The latter is still needed by
a lot of code though, especially generic code. Also vo_opengl still uses
the old one, so this commit is sort of incomplete.

Due to its genericness, it's also possible that this commit introduces
rendering bugs, or accepts formats it shouldn't accept.
2017-06-29 20:52:05 +02:00
wm4 016c9a1d8f DOCS/tech-overview.txt: updates
Oh, this file still exists.
2017-06-29 17:31:55 +02:00
wm4 1b0dec04f4 manpage: fix unfinished sentence
No idea what I intended to write here, so I'm finishing it in some way
that makes sense (going by the commit that added it).

Fixes #4525.
2017-06-29 16:24:17 +02:00
wm4 80f939df03 Copyright: the build system is now LGPL
All relevant authors have agreed.

mpv as a whole is still GPL.
2017-06-29 14:41:43 +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
wm4 3e9075787f ao_wasapi: UWP wrapper hack support
UWP does not support the whole IMMDevice API. Instead, you need to use a
new API (available starting from Windows 8), which is in addition not in
MinGW, and extremely unpleasant to use.

The wasapiuwp2.dll wrapper is a small custom MSVC DLL, which does this
instead, and returns a normal IAudioClient.

Before this, ao_wasapi did not initialize on UWP.
2017-06-29 10:38:05 +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
Pedro Pombeiro f22d12ac51 ao_wasapi: do not use deprecated wchar functions
These break on UWP. Based on a patch by Pedro Pombeiro.
2017-06-29 10:35:25 +02:00
wm4 cd25d98bfa Avoid calling close(-1)
While this is perfectly OK on Unix, it causes annoying valgrind
warnings, and might be otherwise confusing to others.

On Windows, the runtime can actually abort the process if this is
called.

push.c part taken from a patch by Pedro Pombeiro.
2017-06-29 10:31:13 +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 3a3a0aced2 ao_wasapi: remove subtly duplicated code
Seems like this can be slightly simplified.
2017-06-28 18:43:19 +02:00
wm4 3b7e292844 ao_wasapi: remove duplicate code for creating IAudioClient
The code accounting for the terrible AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED
semantics (which MSDN claims can happen "starting with Windows 7" - so
probably on Windows 10 too) duplicated the call for creating the
IAudioClient. That's not great, so get rid of it.

Let wasapi_thread_init() handle this. It has a retry loop anyway. This
redoes device lookup and format negotiation, but potential failures due
to race conditions (what if the driver decides to change behavior)
shouldn't be worse than before.
2017-06-28 18:43:18 +02:00
wm4 36fadac750 ring: use 64 bit counters
Apparently, this messes up on wraparound (although it shouldn't). After
2^32 bytes an audio "blip" happens with AOs that use this ringbuffer.

Whatever, we can fix this by switching to a 64 bit counter. There's also
a good chance the ringbuffer will be dropped completely, so don't waste
more time on this.
2017-06-28 18:43:14 +02:00
wm4 c5a82f729b audio/out/pull: detect and log underflows
Mostly for debugging, I guess.
2017-06-28 13:18:59 +02:00
Niklas Haas 0af561953a
vo_opengl: unify user_shaders constants
Commit 3fb6380 was supposed to increase MAX_TEXTURE_HOOKS but instead
increased SHADER_MAX_HOOKS, since I forgot that they were separate (for
whatever reason).

To prevent this mistake from happening again, and to unify the location
in which user_shader-specific #defines are placed, get rid of the two
constants in opengl/video.c and move/reuse them from user_shaders.h
instead.

Also bump up MAX_SAVED_TEXTURES (now SHADER_MAX_SAVED) slightly as a
precaution against adding more passes to vo_opengl. I think we're
already flirting with the limit.
2017-06-28 00:01:25 +02:00
wm4 dd87ce6f4b terminal: remove unused return value 2017-06-27 18:08:56 +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 e7990944de README: shorten a section and link to FAQ instead 2017-06-27 11:36:20 +02:00
wm4 45bd739796 options: sort action list alphabetically
There is no technical need for this, but it's nicer if --list-options
appears to output them sorted (it only actually sorts the actual option
list, while actions are output in the order they are defined).
2017-06-27 11:27:19 +02:00
wm4 1328005937 options: expose string list actions for --sub-file option
This means you can use --sub-file-set=a,b,c to set a string list
separated by ',', while --sub-file=filename,with,commas.srt still works
(the original motivation for changing the --sub-file option this way).

You can also use it to append strings to string list options without the
need for escale, e.g.: --opengl-shaders-add-str=unescapesdfilename.glsl

(The normal -add for some reason expects a ',' separated list as
argument.)
2017-06-27 11:25:02 +02:00
wm4 c8930d0be2 options: list suffix actions as options too
These are not "really" separate actions, but on the command line they're
obserable as such. So it would be a good idea to list them too.

Adds about 117 options (holy fuck).
2017-06-27 11:14:06 +02:00
wm4 24b2d672ee input.conf: drop TV/DVB bindings
Is anyone still using them? Well, I'm removing them anyway.
2017-06-27 11:04:30 +02:00
Niklas Haas db36aa06f4
vo_opengl: tone map using only luminance information
This is even better at preventing discoloration than tone mapping on the
XYZ image. Partly inspired by the HLG OOTF. Also simplifies the way we
tone map, and moves this logic to the pass_tone_map function where it
belongs.

This also fixes what could arguably be considered a bug in the HLG
implementation when using HLG for non-BT.2020 colorspaces, which is not
permitted by spec but thinkable in theory. Although in this case, I
guess it will be arbitrary whether people use the BT.2020-normalized
luma coefficients or change it to fit the colorspace, so I guess either
way could be considered "right", depending on what people end up doing.
Either way, in lieue of standard practice, we do what makes the most
sense (to me), and hopefully others will follow.

The downside is that we upload an extra vec3 uniform even if we don't
use it, but eliminating that would be ugly.
2017-06-27 01:05:43 +02:00
Niklas Haas f82ba75bd4 mp_image: infer correct HLG sig_peak
For HLG, due to the usage of a reference OOTF configured for 1000 cd/m²,
the default sig_peak of =nom_peak was suboptimal. We can go down to
1000/100 (=10.0), since that's the true dynamic range of the output
signal after it passes through the OOTF.
2017-06-27 00:33:42 +02:00
wm4 50008adf4a options: handle suffixes like -add in a more generic way
This affects options like --vf or --display-tags. These used a "*"
suffix to match all options starting with a specific name, and handled
the rest in the option parser. Change this to remove the "*" special
case, and require every option parser to declare a list of allowed
suffixes via m_option_type.actions.

The new way is conceptually simpler, because we don't have to account
for the "*" in a bunch of places anymore, and instead everything is
centrally handled in the CLI part of the option parser, where it's
actually needed.

It automatically enables suffixes like -add for a bunch of other
stringlist options.
2017-06-26 21:07:00 +02:00
wm4 6f80a694d3 client API: drop old "no-" option emulation
You could do mpv_set_option(h, "no-fs", ""), which would behave like
"--no-fs" on the command line. At one point, this had to be emulated for
compatibility, and printed a deprecation warning. This was almost a year
ago, so remove it.
2017-06-26 20:07:20 +02:00
wm4 4c17ed457d stream_bluray: change license to LGPL
While I'm not particularly attached to this, the history is pretty
simple, and all relevant authors have agreed.

2f004875: removed in 2c693a47, patch author was not asked.
1ef239a4: removed, author was not asked.
2017-06-26 19:25:22 +02:00
wm4 c5e52746b8 Copyright: the icon is LGPLv2.1+ now
We got permission from the original author.
2017-06-26 13:24:57 +02:00
wm4 80416b34a2 player: document where the magic "encoding" section name is used 2017-06-26 11:46:36 +02:00
wm4 0dcb51c7fa player: always load encoding-profiles.conf
This makes things like --show-profile=enc-v-h264 just work again.

Currently I don't see a reason why we should not always load the
encoding profiles. Although I guess this used to be different in the
past. (It probably won't take long until I revert this again - seems
like a fight you can't win for some reason.)

Fixes #4551.
2017-06-26 11:44:10 +02:00
James Ross-Gowan 8ce65f7c11 manpage: fix --angle-swapchain-length requirements
This should also make a difference with the Windows 7 Platform Update.
2017-06-26 18:59:54 +10:00
wm4 d8ad8ae015 etc/encoding-profiles.conf: use new option syntax
This is only for the comments, but since the old syntax is "discouraged"
(and might change semantics one day), we should use the new syntax in
all documentation-like things.
2017-06-25 19:02:24 +02:00
wm4 7293d9cf85 options: suggest a replacement for --field-dominance 2017-06-25 18:54:33 +02:00
wm4 037c37519b audio/out: require AO drivers to report period size and correct buffer
Before this change, AOs could have internal alignment, and play() would
not consume the trailing data if the size passed to it is not aligned.
Change this to require AOs to report their alignment (via period_size),
and make sure to always send aligned data.

The buffer reported by get_space() now always has to be correct and
reliable. If play() does not consume all data provided (which is bounded
by get_space()), an error is printed.

This is preparation for potential further AO changes.

I casually checked alsa/lavc/null/pcm, the other AOs might or might not
work.
2017-06-25 15:57:43 +02:00
Ricardo Constantino 72ef74dab5
encoding-profiles: remove useless noformat vf from enc-v-h264
Instead, add instructions on how to properly restrict output video
to a relatively compatible profile/level.
2017-06-25 14:36:10 +01:00
Ricardo Constantino 7dee6eb22f
mpv_identify: replace deprecated fps property
Closes #4550
2017-06-25 14:24:49 +01:00
wm4 7b84a3b04e build: disable ancient V4L TV support by default 2017-06-25 11:59:03 +02:00
Niklas Haas 7bfeb8bd26
vo_opengl: silence -Wmaybe-uninitialized false positive
These can never be uninitialized because the enum cases are exhaustive and
the fallback is in the correct order, but GCC is too dumb to understand
this.

Also explicitly initialize tex_type, because while GCC doesn't warn
about it (for some reason), maybe it will in the future.
2017-06-24 22:51:48 +02:00
wm4 628a2deb1d DOCS/contribute.md: add rules for push access, that nobody will read...
...but that doesn't mean they're not binding. Also, they're made up on
the spot, and probably bad.
2017-06-24 21:03:29 +02:00
wm4 21e1bb9807 DOCS/contribute.md: some updates
Some of this is outdated by years. I don't think we even have
MPlayer-style randomly formatted source files anymore (except
stream_dvd.c).
2017-06-24 21:02:45 +02:00
wm4 aa458c1fef osx: change license header on some more cocoa files
Changing the headers was actually forgotten in the previous commit.
2017-06-24 16:50:52 +02:00
wm4 6b303d5c3c osx: change license of OSX and cocoa files to LGPL
All authors of the current code have agreed.
2017-06-24 16:29:22 +02:00
wm4 4abd5683d5 ao_openal: change license to LGPL
All authors have agreed.
2017-06-24 14:10:14 +02:00
wm4 f033c488e8 demux_raw: change license to LGPL
All relevant authors have agreed.

I'm removing the NV12 FourCC, which was added in f910f3d9 by someone who
was not contacted for the relicensing. I doubt the remaining code is
copyrightable (basically all what remains the fact is that NV12 uses the
same amount of space like YV12), but in this case I feel more
comfortable removing it.

Might contain some trace amounts of "michael"'s copyright, who agrees
with LGPL only once the core is relicensed - but with the core already
mostly relicensed, I'm changing the license header to LGPL, and only
marking this in the "Copyright" file.
2017-06-24 13:56:53 +02:00
wm4 fcbcd1d3c0 demux_mf, stream_mf: change license to LGPL
cehoyos, who did not agree to the relicensing, added bcb5c78ce3. If
there was copyright, we consider it gone, because the table changed. It
does not map file extension to a FourCC anymore, and codecs.conf is
gone. The new mapping is a libavcodec codec name (happens to be the same
as the file extension).

The same applies to commits 60ecafec, b749836b, 5b3e3be1. None of these
authors were contacted. These were before the code was replaced with a
table (in d0326807). The parts outside of demux_mf.c were removed a long
time ago. Like in the previous comment, we don't think any copyright
applies at least to the new code (at least after the FourCC removal).

iive authored 0aa37a0d, which is probably still left in some form, and
makes demux_mf.c "LGPL 3 or later".

stream_avdevice.c (unrelated) has been marked as LGPL before.
2017-06-24 13:28:01 +02:00
wm4 c9696a1b14 w32_common, w32_keyboard: change license to LGPL
All authors agreed.
2017-06-24 12:54:45 +02:00
wm4 8922c7b84a chmap: remove misleading "downmix" channel layout name
I'm not even sure when/if FFmpeg produces those. It's just confusing. If
you really need this, you can still use dl-dr. I expect that most use is
unintentional.

Probably fixes #4545.
2017-06-24 11:36:10 +02:00