Commit Graph

41293 Commits

Author SHA1 Message Date
wm4 aa78dff42b input.conf: add CTRL+s key binding for window screenshots 2015-05-17 21:09:21 +02:00
Avi Halachmi (:avih) bc503a0e88 manpage: improve osc help
Signed-off-by: wm4 <wm4@nowhere>
2015-05-16 21:02:11 +02:00
torque 5d2a2c7fc2 DOCS/client_api_examples: Qt: force qmake to use pkg-config. 2015-05-16 20:56:44 +02:00
wm4 f9ff4b59a2 manpage: lua: clarify OSD differences between mp.command/mp.commandv
Conflicts:
	player/audio.c
	player/video.c
2015-05-16 12:32:34 +02:00
wm4 a4f3df5970 x11: attempt to make initial fullscreening more reliable
It appears some WMs have a problem with out method of setting initial
fullscreen mode. We assume that if the window's _NET_WM_STATE includes
_NET_WM_STATE_FULLSCREEN before mapping the window, the WM will show it
as fullscreen at mapped. EWMH doesn't say anything that this should
work, although one could argue that it's implied.

In any case, since it's not standard behavior without at least some
doubt, it's probably a good idea to try the "old" method as well.
Fortunately, it should be idempotent.

See #1937, #1920.
2015-05-15 13:50:44 +02:00
wm4 06bfa9309d vf_vapoursynth: reject unaligned video sizes
Leads to some nice memory corruption otherwise.
2015-05-15 13:41:19 +02:00
wm4 372b85b9d2 vo: remove suspicious line
pts can never be 0 or negative. If there is no frame, some code below
catches this case by checking hasframe.
2015-05-15 13:40:43 +02:00
Michael Vetter 9251fa125f Remove trailing whitespaces 2015-05-15 11:02:44 +02:00
wm4 24f98d1aaf video: add hevc to whitelist of hwdec codecs
This means if --hwdec is used, and hardware decoding is supported for
HEVC, it's actually used.
2015-05-14 20:17:23 +02:00
wm4 a2235b0280 dxva2: support HEVC
This is pretty much copy&pasted from Libav commit
a7e0380497306d9723dec8440a4c52e8bf0263cf.

Note that if FFmpeg was not compiled with HEVC DXVA2 support or your
video drivers do not support HEVC, the player will not fallback and
just fail decoding any video. This is because libavcodec appears not
to return an error in this case. The situation is made worse by the
fact that MSYS2 is on an ancient MinGW-w64 release, which does not
have the required headers for HEVC DXVA2 support.
2015-05-14 17:44:48 +02:00
wm4 bad932e8ed vo_opengl: hardcode rquested GL version in backends
The requested version field didn't make much sense anymore, and was even
partially ignored by some backends.
2015-05-14 13:07:00 +02:00
wm4 fa39dadb05 x11: use new OpenGL backend API 2015-05-14 00:05:54 +02:00
wm4 df97c30e0e vo_opengl: create new API for OpenGL VO backends
An attempt to get rid of the weird mix of callbacks that take either
struct vo or MPGLCopntext as parameter. This is not perfect, and the
API will probably change a bit until all other code is ported to it.
the main question is how to separate struct vo completely from the
windowing code, which actually needs vo for very little.

In the end, the legacy callbacks will be dropped.
2015-05-14 00:05:43 +02:00
wm4 10de9b091a vo_opengl: change user options for requesting GLES
Instead of having separate backends, make use of GLES a flag. This
reduces the number of backends and the resulting annoyances.

Also, nobody cares about using GLES, so there's no backward
compatibility either.
2015-05-14 00:05:39 +02:00
wm4 27da344e6f vo_opengl: merge GL backend creation/initialization
The final goal is to remove the nonsense separation between the 3
backend init/vo_init/GL context creation calls.
2015-05-13 22:56:44 +02:00
wm4 5ab05f61ca vo_opengl: remove mpgl_lock calls
Awkward stuff not needed anymore.
2015-05-13 22:03:24 +02:00
wm4 d89eb74cb7 cocoa: redo synchronization
Before this change, Cocoa state was accessed from both the VO and the
Cocoa main thread. This was probably not a good idea. There was some
locking as well as implicit synchronization using the dispatch
mechanism, but it wasn't watertight.

Change this completely. Now Cocoa things are always accessed from the
main thread only. The old mutex falls away, as well as the
vo_cocoa_set_current_context() function, which implicitly used the lock
to coordinate VO accesses. With the new code, the VO thread generally
has to wait for the main thread, while the main thread never waits for
the VO and rarely accesses it. Fortunately, this is rather straight
forward, and most of this is achieved by making vo_cocoa_control() run
on the main thread. The logic of the code does generally not change.

Some aspects are trickier. Apparently we can't access the
NSOpenGLContext from the VO thread, because this object is not thread-
safe. We use some CGLContextObj functions instead, such as for making
the context current and swapping the buffers.
2015-05-13 22:00:34 +02:00
wm4 7e21f6fd00 vo_opengl: remove some more Cocoa resize leftovers 2015-05-13 21:58:37 +02:00
wm4 0468a4ea47 manpage: explain some property expansion restrictions 2015-05-13 20:44:55 +02:00
wm4 a23a46c6ed manpage: remove stray newline 2015-05-13 20:44:55 +02:00
Stefano Pigozzi 5258c012fe vda: add support for nv12 image formats
The hardware always decodes to nv12 so using this image format causes less cpu
usage than uyvy (which we are currently using, since Apple examples and other
free software use that). The reduction in cpu usage can add up to quite a bit,
especially for 4k or high fps video.

This needs an accompaning commit in libavcodec.
2015-05-13 19:57:39 +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 0bdef9979f vo: avoid burning CPU when paused
Some code always calls vo_event(), even with event==0, which leads to
immediate wakeup, which in turn causes the function to be called again.
This would burn CPU, which was especially noticeable when paused.
2015-05-13 09:28:59 +02:00
wm4 fc9695e63b win32: add mappings for some special keys
Untested.
2015-05-12 23:01:32 +02:00
wm4 47d69f366b ipc: avoid SIGPIPE
Until now, we just blocked SIGPIPE globally. Fix it properly to get away
from it.

MSG_NOSIGNAL should be widely available and is part of the POSIX.1-2008
standard. But it's not available on OSX, because Apple is both evil and
retarded. Thus we continue to ignore the problem on such shitty systems.
2015-05-12 22:54:11 +02:00
wm4 29eb764fe0 cocoa: make live-resizing as fast as before
Interrupt video timing. This means the Cocoa event loop does not have
to up to 2 video frame durations until redrawing the frame finally has
finished.

We abuse the VO event flags for this. Eventually this should use
wait_vo() or so in the video timing wait function, but for now the
interaction this would require with the code of other VOs/backends
would cause too much of a mess.
2015-05-12 22:42:06 +02:00
wm4 7735b29732 cocoa: handle live-resizing differently
Instead of requiring a complicated mechanism to share the entire OpenGL
and renderer state between VO and Cocoa thread just to do the redrawing
during live-resize on the Cocoa thread, let the Cocoa thread wait on the
VO thread. This wil allow some major simplifications and cleanups in the
future.

One problem with this is that it can enter a deadlock whenever the VO
tries to sync with the Cocoa thread. To deal with this, the Cocoa thread
waits with a timeout. This can probably be improved later, though in
general this situation can always happen, unless the Cocoa thread waits
in a reentrant way.

Some other details aren't completely clean either. For example,
pending_events should be accessed atomically. This will also be fixed
later.
2015-05-12 22:31:03 +02:00
wm4 434343d634 vo: use pthread_cond_timedwait() for video timing
Will be used to make video waiting interruptible with Cocoa (see the
following commit).

One worry was that this could cause hangs if the system clock jumps
backwards. Normally we don't support such behavior, because it's
almost impossible to handle it reasonably. E.g. we would have to
change the default clock type for condition variables, which in turn
would require a custom function for creating condition variables,
or so. If the OS even supports different clocks.

But it turns out that this is no issue, because other events seem
to wakeup the wait call anyway, and mpv internal absolute times use
a monotonic clock.
2015-05-12 22:30:45 +02:00
wm4 6b7155c05b vo_opengl_cb: add support for interpolation
This uses the OpenGL frame interpolation code, which before could be
used by vo_opengl only.

Some effort was made to make it behave like vo_opengl, for the better or
the worse. As a consequence, there is a minor duplication of code and
mechanism. Hopefully this can all be wiped as soon as the VO frame
queue/timing mechanism is cleaned up.

This also attempts to use mpv_opengl_cb_report_flip() (as called by the
API user) to determine the vsync interval. This might need refinement as
well.

(In general, we simply expect the API user to work in vsync-blocking
manner.)
2015-05-12 22:16:38 +02:00
wm4 ee3de1a063 vo_opengl_cb: add a "block" framedrop mode and make it default
(I have no idea why there are different modes.)

Instead of risking to drop frames too early, give it some margin. Since
there are situations this could deadlock, wait with a timeout. This can
happen if e.g. the API user is refusing to render anything, or if
uninitialization is happening.
2015-05-12 22:16:19 +02:00
wm4 4d9255a5e1 vo_opengl_cb: actually set requested options
Quite an oversight.
2015-05-12 22:16:07 +02:00
wm4 af157db7e5 vo: always call draw_image_timed() if available
Gives the VOs more flexibility.

gl_video.c already ignores the timing info if no interpolation is
active, so this requires no further changes.
2015-05-12 22:15:04 +02:00
wm4 92b9d75d72 threads: use utility+POSIX functions instead of weird wrappers
There is not much of a reason to have these wrappers around. Use POSIX
standard functions directly, and use a separate utility function to take
care of the timespec calculations. (Course POSIX for using this weird
format for time values.)
2015-05-11 23:44:36 +02:00
wm4 ca9964a4fb ao: make better use of atomics
The main reason for this was compatibility; but some associated problems
have been solved in the previous commit.
2015-05-11 23:27:41 +02:00
wm4 cc24ec5b3c atomics: add atomic_fetch_and/atomic_fetch_or
As usual, we prefer plain C11 names and semantics, and have to emulate
them if C11 atomics are not available.

For the non-atomic fallback (which is just there to make code compile in
situations the atomic property is not overly important), we require a
gross hack to make the generic macros work without using compiler-
specific extensions.
2015-05-11 23:20:45 +02:00
wm4 e5573728c7 cocoa: remove unused declaration 2015-05-11 22:56:20 +02:00
wm4 10149f68a5 cocoa: add missing break statements in switch
The first one (for VOCTRL_GET_DISPLAY_FPS) could have led to undefined
behavior if the FPS was unknown. The second is for general symmetry.
2015-05-11 22:56:18 +02:00
wm4 a7ecb11ddd cocoa: remove unused macro 2015-05-11 22:56:15 +02:00
wm4 4858c47e1c Always block SIGPIPE globally
OpenSSL and GnuTLS are still causing this problem (although FFmpeg could
be blamed as well - but not really). In particular, it was happening to
libmpv users and in cases the pseudo-gui profile is used. This was
because all signal handling is in the terminal code, so if terminal is
disabled, it won't be set. This was obviously a questionable shortcut.

Avoid further problems by always blocking the signal. This is done even
for libmpv, despite our policy of not messing with global state.

Explicitly document this in the libmpv docs. It turns out that a version
bump to 1.17 was forgotten for the addition of MPV_FORMAT_BYTE_ARRAY, so
document that change as part of 1.16.
2015-05-11 17:38:35 +02:00
wm4 a5aa58c63c TOOLS/stats-conv.py: add another event type 2015-05-11 17:20:30 +02:00
rrooij 47ee67b8a2 DOCS/man/options.rst: Remove trailing whitespaces 2015-05-10 12:36:55 +02:00
rrooij 5d7468a06e DOCS/man/opions.rst: Elaborate on --no-video
When --no-video is set, the ytdl-format is set to "bestaudio/best". This
wasn't documented in the man page yet.
2015-05-10 12:30:24 +02:00
wm4 9438f811ae ytdl_hook: remove tabs
We don't allow tabs in normal source code.
2015-05-09 21:41:44 +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
wm4 0f063a5011 old-configure: hide
It shouldn't be used, but it's still in the repo because I say so.
2015-05-09 19:55:11 +02:00
wm4 1f389b05fc old-configure: bump libbluray version
Fixes #1927.
2015-05-09 19:50:13 +02:00
wm4 5fe2c19029 player: reuse a function
This has the side-effect that now all encoding-profiles.conf files are
loaded. It's not clear if not doing this was intended or not.
2015-05-09 16:48:08 +02:00
wm4 e9963139da path: improve verbose logging 2015-05-09 16:48:08 +02:00
wm4 6d93dd8969 path: use mp_path_join in one more place 2015-05-09 16:48:08 +02:00
wm4 b6346cd0ba player: make resuming playlists less noisy in verbose mode
mp_find_config_file() will print the filename lookup and its result in
verbose mode. This is wanted, but gets inconvenient when it is done for
every playlist entry (for resuming).

Lookup the watch_later subdir only once and cache the result instead.

This drops the logic for loading the resume file from other locations,
which should generally be unnecessary, though might lead to confusion if
the user has mixed old and new config paths (which the user shouldn't).

Also add a mp_find_user_config_file() function for a more
straightforward and reliable way to get actual local configpaths,
instead of possibly global and unwritable locations.

Also, for symmetry, check the resume option in mp_load_playback_resume()
just like mp_check_playlist_resume() does.
2015-05-09 16:48:05 +02:00