1
mirror of https://github.com/mpv-player/mpv synced 2024-08-28 05:46:13 +02:00
Commit Graph

46698 Commits

Author SHA1 Message Date
Akemi
08679f756c vd_lavc: increase the possible length of the hwdec name
this lead to an unexpected videotoolbox-copy hwdec name due to the last
two chars being cut off. since selection is also done by that name one
had to use "videotoolbox-co" to explicitly use the copy mode of
videotoolbox.
2019-01-23 09:30:58 +01:00
Julian
73fe0611b3 stats: merge multiple properties into one line
Merge file-size/file-format and audio channel-count/format into one line
respectively. This fixes stats overflowing the screen in larger than
19:6 aspect ratios. In this case a problem was reported for ~21:9 which
should be common enough for us to "support" it.
2019-01-16 16:59:00 +01:00
Olivier Perret
9be68e49b2 lua: execute idle handlers after timers have been processed
Idle handlers used to not be executed when timers were active
Now they are executed:
* After all expired timers have been executed
* After all events have been processed (same as when there are no timers)
2019-01-16 16:58:46 +01:00
Benjamin Barenblat
c681fc133c DOCS/man: update man pages to describe ReplayGain fallback
Describe ReplayGain album-to-track fallback behavior introduced in
commits e392d6610d and
be90f2c8dd.
2019-01-16 16:58:33 +01:00
Benjamin Barenblat
585f9ff42f demux: make ALBUM ReplayGain tags optional when using libavformat
Commit e392d6610d modified the native
demuxer to use track gain as a fallback for album gain if the latter is
not present. This commit makes functionally equivalent changes in the
libavformat demuxer.
2019-01-16 16:58:33 +01:00
Dan Oscarsson
aab595f828 command: notify on multiply
doing multiply on a property is also a set property command
and the change should be notified so others can observe the change
2019-01-16 16:58:15 +01:00
Oliver Freyermuth
d6d6da4711 stream_dvb: Correct range for dvbin-card option.
Adapt documentation accordingly and
also, fix an off-by-one check in the code.
closes #6371
2018-12-12 01:50:43 +02:00
Niklas Haas
5bcac8580d spirv: remove --spirv-compiler=nvidia
This option has been deprecated upstream for a long time, probably
doesn't even work anymore, and won't work moving forwards as we replace
the vulkan code by libplacebo wrappers.

I haven't removed the option completely yet since in theory we could
still add support for e.g. a native glslang wrapper in the future. But
most likely the future of this code is deletion.

As an aside, fix an issue where the man page didn't mention d3d11.
2018-12-01 15:50:23 +02:00
Anton Kindestam
f0509d3738 drm: rename plane options to better, invariant, names
This commit bumps the libmpv version to 1.102

drm-osd-plane -> drm-draw-plane
drm-video-plane -> drm-drmprime-video-plane
drm-osd-size -> drm-draw-surface-size

"draw plane", as in the plane that OpenGL draws to, whether it be
video + OSD or just OSD.

"drmprime video plane", as in the plane used for hwdec video imported
via drmprime.

"draw surface size", as in the size of the surface used for the draw plane

The new names are invariant whether or not hwdec_drmprime_drm is being
used or not. The original naming was very confusing, as when doing
regular rendering (swdec or vaapi) the video would be displayed on the
"OSD plane", and the "Video plane" would remain unused.
2018-12-01 15:42:20 +02:00
Anton Kindestam
c151fae054 drm_atomic: Add general primary/overlay plane option
Add general primary/overlay plane option to drm-osd-plane-id and
drm-video-plane-id, so that the user can just request any usable
primary or overlay plane for either of these two options. This should
be somewhat more user-friendly (especially as neither of these two
options currently have a useful help function), as usually you would
only be interested in the type of the plane, and not exactly which
plane gets picked.
2018-12-01 15:42:20 +02:00
TheAMM
b6a431ec55 man: fix --watch-later-directory formatting
Extra line prevents the sub-title formatting.
Removing it, the option is formatted like the others.
2018-11-28 18:02:45 +01:00
dudemanguy
8b6064de76 gpu: prefer wayland context on autodetect 2018-11-19 00:26:39 +02:00
Niklas Haas
b8bb5329a5 vulkan: slightly improve vsync jitter measurements
By design, some vulkan implementations block until vsync during
vkAcquireNextImageKHR. Since mpv only considers the time that
`swap_buffers` spent blocking as constituting part of the vsync, we can
help it out a bit by pre-emptively calling this function here in order
to improve the accuracy of vsync jitter measurements on vulkan.

(If it fails, we just ignore the error and have the user call it a
second time later - maybe it will work then)

On my system this drops vsync-jitter from ~0.030 to ~0.007, an accuracy
of +/- 100μs. (Which *might* have something to do with the fact that
this is the polling interval for command polling)
2018-11-19 00:23:15 +02:00
Niklas Haas
34df6bd82f vo_gpu: vulkan: only rotate the queues on swap
Makes performance slightly better when using multiple queues by avoiding
unnecessary semaphores due to bad queue selection.

Also remove an aeons-old workaround for an nvidia bug that only ever
existed in the earliest beta vulkan drivers anyway.
2018-11-19 00:22:41 +02:00
emersion
95589fd4f8 wayland: remove KDE server-decoration support 2018-11-19 00:15:31 +02:00
emersion
6d2be82094 wayland: use xdg-decoration if available 2018-11-19 00:15:31 +02:00
Philip Langdale
ce2253b358 filters: Add cuda/nvdec deinterlacing auto-filter using vf_yadif_cuda
Historically, there's been no way to offer deinterlacing with nvdec,
and for cuviddec, it required a command line flag, with no way to
toggle while playing.

Now that we have a cuda deinterlacing filter in ffmpeg, we can hook
it up hook it up as the cuda auto-deinterlacer. In practice, this
isn't going to be present very often, due to the licensing mess with
the cuda sdk, but we can support it when it is there.
2018-11-19 00:02:41 +02:00
Philip Langdale
721bec7dde vo_gpu: hwdec_cuda: Guard GL and Vulkan headers properly
We are currently unnecessarily including vulkan headers even when
not building with vulkan support. I also guarded the GL header
inclusion even though this doesn't appear to break anything today.

Fixes #6330.
2018-11-18 23:50:38 +02:00
pavelxdd
edbe25f38a w32_common: use the screen working area when resizing the window
This makes the default fit on screen, autofit and window-scale
changing behavior to use the screen working area, instead of
the whole screen area.

As a result mpv window doesn't cover the taskbar now when opening
videos with size larger than the screen size.

The actual behavior now is the same as expected behavior for
usecases 1-4 from #4363.

This commit also removes the screenrc from w32 struct.
The screen rect can now be retrieved via `get_screen_area` function,
which was renamed from `update_screen_rect`.

On a multi-monitor system, if the user moved the window between
monitors, this function will return the current screen area under
the window, and not the screen area from monitor specified by
`--screen` option. The `--screen` option sets the initial monitor
the mpv window is displayed on.
2018-11-18 00:56:34 +02:00
Rikard Falkeborn
f1ba1ef77f vo_x11: fix return value in resize() error paths
Returning -1 in a function with return type bool is the same as
returning true. In the error paths, false should be returned to
indicate that something went wrong.
2018-11-17 00:53:56 +01:00
Niklas Haas
2704625e3f vo_gpu: opengl: disable compute shaders for old GLSL
Fixes #6272.
2018-11-17 00:49:10 +01:00
Akemi
b222980394 cocoa: fix drawing on macOS 10.14 2018-11-13 21:14:29 +02:00
Akemi
e5c4164088 cocoa-cb: add logging for CGL pixel format attributes
depending on the capabilities of the system and testing of various
attributes the resulting CGL pixel format can change. due to that
probing it can be helpful to know which pixel format is used to create
the CGL context. added some verbose logging that outputs final pixel
format.
2018-11-13 20:43:29 +02:00
Akemi
e72093581b vo_libmpv: support render performance data 2018-11-13 20:43:29 +02:00
Akemi
9e466ee621 cocoa-cb: use libmpv's advanced rendering control and timing
this adds support for GPU rendered screenshots, DR (theoretically) and
possible other advanced functions in the future that need to be executed
from the rendering thread.
additionally frames that would be off screen or not be displayed when on
screen are being dropped now.
2018-11-13 20:43:29 +02:00
Jan Ekström
317d3ac266 build: add a version requirement for vulkan pkg-config check
`vkGetPhysicalDeviceProperties2KHR` was added in Vulkan 1.0.39,
but 1.0.61 from Ubuntu Xenial (16.04) was the lowest anyone tried
to build mpv with as of late, so we are marking that as the minimum
required version.

This fixes issues arising during build time from having too old
version of vulkan available on a system, instead of causing a failure
to build.
2018-11-04 00:19:12 +02:00
Philip Langdale
c8a065df12 vo_gpu: vulkan: Always use KHR suffix types and defines
I was inconsistent about this originally, as the functionality was
moved into the core spec in 1.1 and so both suffixed and unsuffixed
versions of everything exist and can be mixed together.

There's no reason to fail to build with 1.0.39+ so I'm fixing the
names.
2018-11-03 23:53:08 +02:00
Niklas Haas
880c59d189 ipc-unix: don't blow up on readonly fd://
On my system, when trying to use mpv with a read-only fd created by
python 3.7, `send` triggers ENOTSOCK, not EBADF. Extend the logic to
detect non-writable fds by this `errno`.
2018-10-31 09:20:44 +01:00
Ben Boeckel
6f0ed8e0b2 audio: increase a buffer size
The buffer is written to in `audio_config_to_str_buf` using `snprintf`
with a `%s` formatting of a 128-byte buffer. This can overflow the
target buffer of 80 causing a truncated output.
2018-10-31 09:20:26 +01:00
Ben Boeckel
e3e1bdfb13 ipc-unix: leave room for a NUL terminator
The `strncpy` function will not always place a terminating `NUL` if the
source is longer than the destination buffer. Instead, let `strncpy`
truncate as it normally would, but leave the last byte alone (it is
zero-initialized when declared).
2018-10-31 09:20:26 +01:00
Philip Langdale
84d6638907 vo_gpu: hwdec_cuda: Clean up init() error handling
Currently, the error paths in init() are a bit confusing, and we can
end up trying to pop the current context when there is no context,
which leads to distracting error messages.

I also added an explicit path to return early if the GPU backend is
not OpenGL or Vulkan. It's pointless to do any other cuda init
after that point. (Of course, someone could write more interops.)

Fixes #6256
2018-10-31 09:20:06 +01:00
Jan Ekström
4056a9a420 ad_spdif: cosmetic alignment 2018-10-30 02:13:04 +02:00
Jan Ekström
25ee18d6e5 ad_spdif: fix DTS-HD HRA handling
Apparently, for bit streaming DTS-HD MA is specified to be handled as an
eight channel (7.1) bit stream, while DTS-HD HRA is specified to be
handled as a stereo bit stream.

Define a variable for this, and utilize it to set the correct values
for both the DTS-HD bit streaming rate, as well as the channel count
for the SPDIF encoder.

Fixes #6148
2018-10-30 02:13:04 +02:00
Akemi
865627d849 build: pass include paths as a list instead of a string in cocoa check
when passed as a string check_cc tries to split that string, since it
assumes that several include paths can be passed to it. instead we just
use a list to make it unambiguous.
2018-10-28 15:48:37 +02:00
Akemi
543a3bc0bd build: don't hardcode swift module name 2018-10-28 15:48:37 +02:00
Akemi
eab30807fe build: use an argument list for the Swift build args
that way we don't need to quote or escape anything.

Fixes #6220
2018-10-28 15:48:37 +02:00
Anton Kindestam
ba2dee38fb hwdec_drmprime_drm: Missing NULL-check on drm_atomic_context video_plane
Since 810acf32d6 video_plane can be NULL
under some circumstances. While there is a check in init, init treats
this as an error condition and would call uninit, which in turn calls
disable_video_plane, which would then segfault. Fix this by including
a NULL check inside disable_video_plane, so that it doesn't try to
disable what isnt' there.
2018-10-25 13:50:09 +02:00
pavelxdd
bdec4421e6 stream_smb: make sure the string is NULL-terminated after strncpy
strncpy does not guarantee that the string will be NULL-terminated.
2018-10-25 13:49:49 +02:00
Philip Langdale
da1073c247 vo_gpu: vulkan: hwdec_cuda: Add support for Vulkan interop
Despite their place in the tree, hwdecs can be loaded and used just
fine by the vulkan GPU backend.

In this change we add Vulkan interop support to the cuda/nvdec hwdec.

The overall process is mostly straight forward, so the main observation
here is that I had to implement it using an intermediate Vulkan buffer
because the direct VkImage usage is blocked by a bug in the nvidia
driver. When that gets fixed, I will revist this.

Nevertheless, the intermediate buffer copy is very cheap as it's all
device memory from start to finish. Overall CPU utilisiation is pretty
much the same as with the OpenGL GPU backend.

Note that we cannot use a single intermediate buffer - rather there
is a pool of them. This is done because the cuda memcpys are not
explicitly synchronised with the texture uploads.

In the basic case, this doesn't matter because the hwdec is not
asked to map and copy the next frame until after the previous one
is rendered. In the interpolation case, we need extra future frames
available immediately, so we'll be asked to map/copy those frames
and vulkan will be asked to render them. So far, harmless right? No.

All the vulkan rendering, including the upload steps, are batched
together and end up running very asynchronously from the CUDA copies.

The end result is that all the copies happen one after another, and
only then do the uploads happen, which means all textures are uploaded
the same, final, frame data. Whoops. Unsurprisingly this results in
the jerky motion because every 3/4 frames are identical.

The buffer pool ensures that we do not overwrite a buffer that is
still waiting to be uploaded. The ra_buf_pool implementation
automatically checks if existing buffers are available for use and
only creates a new one if it really has to. It's hard to say for sure
what the maximum number of buffers might be but we believe it won't
be so large as to make this strategy unusable. The highest I've seen
is 12 when using interpolation with tscale=bicubic.

A future optimisation here is to synchronise the CUDA copies with
respect to the vulkan uploads. This can be done with shared semaphores
that would ensure the copy of the second frames only happens after the
upload of the first frame, and so on. This isn't trivial to implement
as I'd have to first adjust the hwdec code to use asynchronous cuda;
without that, there's no way to use the semaphore for synchronisation.
This should result in fewer intermediate buffers being required.
2018-10-22 21:35:48 +02:00
Philip Langdale
621389134a vo_gpu: vulkan: Add a function to get the device UUID
We need this to do device matching for the cuda interop.
2018-10-22 21:35:48 +02:00
Philip Langdale
a782197d21 vo_gpu: vulkan: Add arbitrary user data for an ra_vk_buf
This is arguably a little contrived, but in the case of CUDA interop,
we have to track additional state on the cuda side for each exported
buffer. If we want to be able to manage buffers with an ra_buf_pool,
we need some way to keep that CUDA state associated with each created
buffer. The easiest way to do that is to attach it directly to the
buffers.
2018-10-22 21:35:48 +02:00
Philip Langdale
93f800a00f vo_gpu: vulkan: Add support for exporting buffer memory
The CUDA/Vulkan interop works on the basis of memory being exported
from Vulkan and then imported by CUDA. To enable this, we add a way
to declare a buffer as being intended for export, and then add a
function to do the export.

For now, we support the fd and Handle based exports on Linux and
Windows respectively. There are others, which we can support when
a need arises.

Also note that this is just for exporting buffers, rather than
textures (VkImages). Image import on the CUDA side is supposed to
work, but it is currently buggy and waiting for a new driver release.

Finally, at least with my nvidia hardware and drivers, everything
seems to work even if we don't initialise the buffer with the right
exportability options. Nevertheless I'm enforcing it so that we're
following the spec.
2018-10-22 21:35:48 +02:00
Akemi
6fbd933108 build: more reliable way of getting the Swift version from a string
Fixes #6212
2018-10-22 01:41:09 +03:00
Niklas Haas
facc63b862 vo_gpu: vulkan: suppress bogus error message on --vulkan-device
Since the code just broke out of the loop on a match rather than jumping
straight to the end of the function body, it ended up hitting the code
path for when the end of the list was reached.
2018-10-21 23:33:36 +02:00
Akemi
9a52b90f04 cocoa-cb: fix double clicking the title bar
since we draw our own title bar we lose the standard functionality of
the system provided title bar. because of that we have to reimplement
the functionality of double clicking the title bar. depending on the
system preferences we want to minimize, zoom or do nothing.

Fixes #6223
2018-10-21 23:33:25 +02:00
BtbN
f3098cd61b vo_gpu: vulkan: fix strncpy truncation in spirv_compiler_init
Fixes GCC8 warning
../video/out/gpu/spirv.c: In function 'spirv_compiler_init':
../video/out/gpu/spirv.c:68:9: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
2018-10-21 23:33:10 +02:00
slatchurie
24e21a0236 x11: fix icc profile when the window goes near off screen
On a multi monitor setup, when the center of the window was going off
screen, the icc profile would always switch to the profile of the first
screen.

This fixes the issue by defaulting the value to the current screen.
2018-10-21 23:32:50 +02:00
Niklas Haas
0f3e25cb0a vo_gpu: vulkan: fix the buffer size on partial upload
This was pased on the texture height, which was a mistake. In some cases
it could exceed the actual size of the buffer, leading to a vulkan API
error. This didn't seem to cause any problems in practice, since a
too-large synchronization is just bad for performance and shouldn't do
any harm internally, but either way, it was still undefined behavior to
submit a barrier outside of the buffer size.

Fix the calculation, thus fixing this issue.
2018-10-19 22:58:16 +02:00
Niklas Haas
7ad60a7c5e vo_gpu: split --linear-scaling into two separate options
Since linear downscaling makes sense to handle independently from
linear/sigmoid upscaling, we split this option up. Now,
linear-downscaling is its own option that only controls linearization
when downscaling and nothing more. Likewise, linear-upscaling /
sigmoid-upscaling are two mutually exclusive options (the latter
overriding the former) that apply only to upscaling and no longer
implicitly enable linear light downscaling as well.

The old behavior was very confusing, as evidenced by issues such
as #6213. The current behavior should make much more sense, and only
minimally breaks backwards compatibility (since using linear-scaling
directly was very uncommon - most users got this for free as part of
gpu-hq and relied only on that).

Closes #6213.
2018-10-19 22:58:01 +02:00
Nicolas F
448cbd472e x11_common: replace atoi with strtoul
Using strtol and strtoul is allegedly better practice, and I'm going
for strtoul here because I'm pretty sure X11 displays cannot be in
the negative.
2018-10-19 22:57:49 +02:00