Commit Graph

45043 Commits

Author SHA1 Message Date
wm4 4a084c0df8 m_option: deprecate multiple items for -add etc.
This is more confusing than it helps, and forces escaping more stuff.
For example, for string lists we could remove all need for escaling with
-add and -pre.

The user can simply use multiple of those options.
2017-07-02 16:47:27 +02:00
wm4 e4bc563fd2 options: change everything again
Fucking bullshit.
2017-07-02 16:29:45 +02:00
wm4 d24f4587a7 m_option: remove unused error code
The situation in the str_list_* functions can never happen, and they
were the only users of this error code.
2017-07-02 13:52:36 +02:00
Xu Zhao 1097c1416f x11: add 128x128 sized icon support 2017-07-02 13:07:36 +02:00
wm4 3d31807198 m_option: remove redundant indirections
Remove the various redundant m_config_set_option* calls, rename the
remaining one to m_config_set_option_cli(), and merge the
m_config_parse_option() function.
2017-07-02 13:07:36 +02:00
wm4 66478cff14 bstr: short-circuit bstr_equals() 2017-07-02 12:43:18 +02:00
Raúl Peñacoba d39f3bcd3a
misc/json: avoid redundant condition
Closes #4415
2017-07-01 15:09:21 +01:00
Raúl Peñacoba 71f97d9cf3
demux/demux: avoid redundant condition
Closes #4414
2017-07-01 15:09:12 +01:00
wm4 9127939071 x11: load icon differently
Now it's sourced from the etc/ PNG files directly, instead of
preprocessing them with imagemagick.

Add some ad-hoc code to decode PNG files with libavcodec. At least we
can drop the zlib code in exchange.
2017-07-01 15:56:12 +02:00
wm4 aee81828e2 sws_utils: switch back to GPL
Actually contains some code fragments by Michael Niedermayer (command
line stuff, video equalizer), thus it can be LGPL only once the formal
requirement of mpv's core being LGPL is fulfilled.
2017-07-01 12:51:18 +02:00
Niklas Haas f281ecc4c0
vo_opengl: describe vdpau reinterleaving pass
This shows up as (unknown pass) otherwise.
2017-07-01 09:45:14 +02:00
Niklas Haas 69289aec6c
vo_opengl: fix some more pass_info_reset issues
2f41c4e8 exposed some other edge cases as well. Globally resetting the
pass info was not the right way to go about it, because we don't know in
advance what the frame type is going to be - at least not with the
current code structure. (In principle, we could separately indicate the
frame type and the pass type and then only reset it on the first
actual pass_describe call, but that's annoying as well)

Also fixes a latent issue where p->pass was never initialized, which
broke the MP_DBG debugging code in some cases.
2017-07-01 04:27:09 +02:00
Niklas Haas 2f41c4e81b
vo_opengl: call pass_info_reset earlier
Omitting this call resulted in a crash when has_frame was false. But we
can just call it way earlier, because there's really no reason not to.
2017-07-01 03:32:14 +02:00
Niklas Haas 6a12b1fdc3
vo_opengl: merge uploading and rendering
Since all existing code does gl_video_upload immediately followed by
pass_render_frame, we can just move the upload into pass_render_frame
itself, which arguably makes more sense anyway.
2017-07-01 00:59:15 +02:00
Niklas Haas dd78cc6fe7 vo_opengl: refactor vo performance subsystem
This replaces `vo-performance` by `vo-passes`, bringing with it a number
of changes and improvements:

1. mpv users can now introspect the vo_opengl passes, which is something
   that has been requested multiple times.

2. performance data is now measured per-pass, which helps both
   development and debugging.

3. since adding more passes is cheap, we can now report information for
   more passes (e.g. the blit pass, and the osd pass). Note: we also
   switch to nanosecond scale, to be able to measure these passes
   better.

4. `--user-shaders` authors can now describe their own passes, helping
   users both identify which user shaders are active at any given time
   as well as helping shader authors identify performance issues.

5. the timing data per pass is now exported as a full list of samples,
   so projects like Argon-/mpv-stats can immediately read out all of the
   samples and render a graph without having to manually poll this
   option constantly.

Due to gl_timer's design being complicated (directly reading performance
data would block, so we delay the actual read-back until the next _start
command), it's vital not to conflate different passes that might be
doing different things from one frame to another. To accomplish this,
the actual timers are stored as part of the gl_shader_cache's sc_entry,
which makes them unique for that exact shader.

Starting and stopping the time measurement is easy to unify with the
gl_sc architecture, because the existing API already relies on a
"generate, render, reset" flow, so we can just put timer_start and
timer_stop in sc_generate and sc_reset, respectively.

The ugliest thing about this code is that due to the need to keep pass
information relatively stable in between frames, we need to distinguish
between "new" and "redrawn" frames, which bloats the code somewhat and
also feels hacky and vo_opengl-specific. (But then again, this entire
thing is vo_opengl-specific)
2017-07-01 00:58:27 +02:00
wm4 f003d8ea36 d3d: UWP support for D3D11VA
For some braindead reason, Microsoft decided to prevent you from
dynamically loading system libraries. This makes portability harder.

And we're talking about portability between Microsoft OSes!
2017-06-30 18:57:37 +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 c61520b6bd img_format: drop some unused things 2017-06-30 18:38:23 +02:00
wm4 2ef0ff3ad5 mp_image: use new code for determining RGB/XYZ exceptions
Slightly cleaner, possibly slightly more correct. (The last case should
be dead code now. In general, we can't know the implied colorspace from
a AV_PIX_FMT, at least not if FFmpeg adds a new one.)
2017-06-30 18:27:35 +02:00
wm4 2aff6f8c95 vo_direct3d: remove non-working nv12 shader support
It never worked. It relied on some obscure texture format to provide the
equivalent of GL_RG or GL_LUMINANCE_ALPHA, but no hardware seemed to
report support for it ever. No idea what's the correct way to do this.
On D3D11 it exists, of course.

(Actually I'd like to remove the whole VO.)
2017-06-30 18:13:01 +02:00
wm4 1ad036a2ef video: get rid of swapped packed YUV
Another legacy annoyance. The only place where packed YUV is still
important is slightly older Apple hardware or drivers, which require
it for efficient hardware decoding.
2017-06-30 18:01:29 +02:00
wm4 6eb0bbe312 vo_opengl: remove mp_imgfmt_desc and IMGFLAG_ usage
These were weird due to their past, and often undefined or ill-defined.
Time to get rid of them.
2017-06-30 17:56:42 +02:00
wm4 0c0a06140c vo_opengl: restructure format setup
Instead of setting up a weird swizzle (which is linked to how the
internal renderer code works, rather than the generic format code), add
per-component mapping to gl_imgfmt_desc.

The renderer still computes the weird swizzle, but at least it's
confined to itself. Also, it appears the hwdec backends don't need this
anymore.

It's really nice that the messy init_format() goes away too.
2017-06-30 17:07:55 +02:00
wm4 91583fccac options: change path list options, and document list options
The changes to path list options is basically getting rid of the need to
pass multiple paths to a single option. Instead, you can use the option
multiple times. The old behavior can be used by using the -set suffix
with the option.

Change some options to path lists. For example --script is now append by
default, and if you use --script-set, you need to use ":"/";" as
separator instead of ",".

--sub-paths/--audio-file-paths is a deprecated alias now, and will break
if the user tries to pass multiple paths to it. I'm assuming that if
these are used, most users will pass only 1 path anyway.

--opengl-shaders has more compatibility handling, since it's probably
rather common that users pass multiple options to it.

Also document all that in the manpage.

I'll probably regret this later, as it somewhat increases the complexity
of the option parser, rather than increasing it.
2017-06-30 16:39:36 +02:00
Ricardo Constantino c1f46dbbe9
scripting: add wrapper to load scripts with user paths
Fixes regression since b2f756c80e, which broke load-script command
when used with user paths (ex: ~~/script.lua)
2017-06-30 15:03:10 +01:00
wm4 ba8160cf59 client API: change mpv_create() behavior, run init always on mpv thread
This takes car eof unsubtle bugs if something at init does not work
(specifically if mp_new_client() returns NULL). It also removes the need
for that PMP MF hack.
2017-06-30 13:14:39 +02:00
wm4 d0e8d6114b ao_coreaudio: insane hack for passing through AC3 as float PCM
This uses the same hack as Kodi uses, and I suspect MPlayer/ancient mpv
also did this (but didn't research that).
2017-06-30 09:06:01 +02:00
wm4 9b5281148c vo_direct3d: fix build
That format is worthless anyway.
2017-06-29 23:13:08 +02:00
wm4 b266a334c1 video: change --video-aspect-method default value again
I noticed that the previous default, bitstream, actually breaks with
some shitty anamorphic DVD rips that signal square pixel aspect in the
bitstream. So I think the "container" method is a better default.
2017-06-29 22:34:57 +02:00
wm4 300f6a3344 video: drop some more IMGFMT aliases
For vo_opengl and vo_direct3d, these are supported in a generic way.

For vf_vapoursynth, we could probably map its VSFormat struct in a
generic way, but for now do some bullshit.

vf_eq.c actually loses support for these formats. We could add generic
support too (anything that has 8 bit planes will work), but why bother.
The filter is deprecated anyway.
2017-06-29 21:30:10 +02:00
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