Commit Graph

50014 Commits

Author SHA1 Message Date
Kacper Michajłow e4e3a8fc0b ci: pack mingw64 meson build instead of waf 2023-01-31 14:50:26 +00:00
Kacper Michajłow 7151b5122a ci: separate meson/waf build dirs 2023-01-31 14:50:26 +00:00
Kacper Michajłow 08d11e8c5d ci: use meson compile instead of ninja directly 2023-01-31 14:50:26 +00:00
Kacper Michajłow 2868ecf2ac ci: do not print compile commands
It only shadows warnings/errors and makes log files bloated.
2023-01-31 14:50:26 +00:00
Dudemanguy 78d9b40ddc meson: replace check_header with has_header
It turns out that there's a has_header check, and we should actually be
using that instead. We only care here if the header actually exists so
the pre-processor check is all that is needed. check_header depends on
what arguments the user passes among other things. That makes it more
complicated than necessary for our purposes.
2023-01-31 14:50:02 +00:00
Dudemanguy 25f5333b4a meson: actually use -Werror=format-security
We tested for this flag, but never added -Wformat in addition to
-Werror=format-security. The latter was silently ignored and actually
did nothing.
2023-01-31 14:50:02 +00:00
Dudemanguy 9659555d45 hwdec/vaapi: zero-initialize VADRMPRIMESurfaceDescriptor
Otherwise, desc can contain garbage values and segfault trying to close
file descriptors that aren't actually there. Fixes #11239.
2023-01-30 10:41:32 -06:00
StratusFearMe21 3038e578af player/video.c: don't resync audio if video is an image 2023-01-30 14:52:00 +00:00
rcombs 4bcefa5be3 vo_lavc: set frame rate on encoder; fixes #11215
ffmpeg was internally defaulting to 24000fps, which resulted in encoders selecting inappropriate levels and making poor ratecontrol decisions.
2023-01-29 22:14:27 -06:00
Dudemanguy da81a6d532 wayland: add auto choice to wayland-configure-bounds
Previously, this defaulted to yes and configure-bounds from the
compositor would always apply. In the case where the user explicitly set
autofit or geometry, this could be confusing because configure-bounds
would take precedence over it. Instead, let's add an auto choice and
make that the default. If we detect that the option is on auto and that
there is autofit/geometry being set, then ignore the event. This should
be more intuitive since someone who bothers to explicitly set mpv's
geometry would naturally expect that geometry to actually apply.
2023-01-30 03:59:40 +00:00
Dudemanguy adc04dbba0 wayland: handle runtime hidpi-window-scale changes correctly
Semi-regression although this option never really did what the manual
said until recently. In the past, this option also controlled whether or
not mpv set the wayland buffer_scale to the value of the wl_output or
force it 1. This had varying effects depending on the exact compositor
configuration. That logic has now all been removed and this option now
only controls whether or not to scale the window with the hidpi scale
factor we get from the compositor. i.e. it actually does what the
manual says now.
2023-01-30 03:59:40 +00:00
Dudemanguy e6a42f7afc wayland: unbreak runtime geometry/autofit changes
Regressed from 879824a47f. The geometry
needs to be explictly recalculated now. Change up this function a little
bit also give it the ability to directly perform a resize after the
fact. This is a common workflow and we'll be using it in the next
commit.
2023-01-30 03:59:40 +00:00
Avi Halachmi (:avih) 86093fcae7 lua/js: remove user-data helpers
This reverts:
  3fb4140c lua/defaults: add user_data helpers
  68a20e7a javascript/defaults: add user_data helpers
  00510379 lua/js: fix user_data_del util function

As well as the lua/js parts of:
  3ec2a098 docs: document new user-data property

user-data and its sub-properties can be set/get/observed/deleted
via the standard properties interface, so there's no need for
additional helpers specific to user-data, which only added maintenance
burden.
2023-01-29 01:52:31 +02:00
rcombs 0051037957 lua/js: fix user_data_del util function 2023-01-28 15:21:15 -06:00
rcombs 0f3a041796 doc: correct spelling of user-data/user_data JS/lua helpers 2023-01-28 14:55:24 -06:00
rcombs 3ec2a0988a docs: document new user-data property 2023-01-28 14:37:24 -06:00
rcombs 68a20e7ae4 javascript/defaults: add user_data helpers 2023-01-28 14:37:24 -06:00
rcombs 3fb4140c38 lua/defaults: add user_data helpers 2023-01-28 14:37:21 -06:00
rcombs 0b4860248b player/command: add user-data property
This will replace shared-script-properties in new usage. It can be used for all the same things, but is much more versatile.
Clients can create arbitrary sub-objects, and text expansion can access them.
For instance, if a script sets `user-data/my-script/property1` to "test", that value will be available by expanding ${user-data/my-script/property1}.
2023-01-28 14:37:02 -06:00
rcombs 94e1659b6c javascript: add mp.del_property() 2023-01-28 14:20:20 -06:00
rcombs 51c6784df7 lua: add mp.del_property() 2023-01-28 14:20:20 -06:00
rcombs 2cfaa820e5 libmpv: add mpv_del_property() convenience function 2023-01-28 14:20:20 -06:00
rcombs 04241ab731 player/command: add "del" command 2023-01-28 14:20:20 -06:00
rcombs e1815789f7 m_property: add M_PROPERTY_DELETE 2023-01-28 14:20:20 -06:00
rcombs dc4fd24c6f player/client: support observing sub-properties
This notifies if either a descendent or ancestor of the requested path is modified.
2023-01-28 14:20:20 -06:00
rcombs 0b3c37bc43 options/m_option: support duplicating MPV_FORMAT_BYTE_ARRAY nodes 2023-01-28 14:20:20 -06:00
rcombs 3b2b47e32a misc/node: add bstr-based variants for map_get() and map_add() 2023-01-28 14:20:20 -06:00
rcombs fa7202d9f2 misc/json: don't wrap top-level pretty strings/infs in quotes
This makes pretty-printing nodes substantially more friendly.
2023-01-28 14:20:20 -06:00
Oxan van Leeuwen 91ba71b09f DOCS: Add missing 'not' 2023-01-28 11:59:59 -05:00
Aaron Boxer 588d66fb25 hwdec_vaapi: close file descriptors even if surface export fails
otherwise they can leak
2023-01-28 16:54:48 +01:00
Aaron Boxer 881f820fdf vo_dmabuf_wayland: close file handles when surface export fails
file handles may still be opened despite failure
2023-01-28 16:54:48 +01:00
Aaron Boxer e3618002e3 vo_dmabuf_wayland: plug leaking file descriptor from solid buffer pool 2023-01-28 16:54:48 +01:00
Kacper Michajłow 9d659ed847 DOCS/compile-windows.md: update MSYS2 packages 2023-01-28 01:03:12 +00:00
Kacper Michajłow b5f62050ec test/repack.c: skip tests that exceeded maximum allowed ZIMG dimension
Fixes tests on 32-bit platforms
2023-01-28 01:03:12 +00:00
Kacper Michajłow 5fd6789d90 meson: add missing library dep for egl_angle_lib check 2023-01-28 01:03:12 +00:00
Kacper Michajłow af537eff06 vo_opengl/angle_dynamic: simplify symbol renaming to make it more straightforward 2023-01-28 01:03:12 +00:00
Kacper Michajłow 75e41478cc waf: migrate to version.py
Fixes https://github.com/mpv-player/mpv-build/issues/204
2023-01-28 01:03:12 +00:00
Kacper Michajłow bc1af592db ci: migrate MSYS2 build to GitHub Actions 2023-01-28 01:03:12 +00:00
Kacper Michajłow c3149d9fc2 wscript: remove MSVC from compiler lookup
MSVC is not supported and waf doesn't respect CC environment value like
any sane buildsystem.
2023-01-28 01:03:12 +00:00
Thomas Weißschuh c25682f09e meson: reuse libmpv objects for cplayer
When building both cplayer and libmpv in the same build previously all
sources were built twice.
By reusing the objects from libmpv in cplayer we can thus save 50%
percent of the build steps.
2023-01-26 21:39:04 -08:00
Thomas Weißschuh fb137e8d88 ao_pipewire: align thread name with general conventions 2023-01-25 15:56:36 -08:00
Thomas Weißschuh 870512eb84 audio: simplify implementation of property ao-volume
ao-volume is represented in the code with a `struct ao_control_vol_t`
which contains volumes for two channels, left and right.

However the code implementing this property in command.c never treats
these values individually. They are always averaged together.
On the other hand the code in the AOs handling these values also has to
handle the case where *not* exactly two channels are handled.

So let's remove the `struct ao_control_vol_t` and replace it with a
simple float.
This makes the semantics clear to AO authors and allows us to drop some code from the AOs and command.c.
2023-01-25 15:49:21 -08:00
Dudemanguy 5510d9f663 stream/dvb: remove some unused variables
Missed in b6b8380518.
2023-01-24 21:21:02 -06:00
Sultan Alsawaf 0d44ae319d x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timing
PresentNotifyMSC turns out to be not only redundant, but also harmful with
mesa-backed egl/glx/vulkan VOs because for all of them, mesa uses
PresentPixmap behind the scenes when DRI3 is available, which already
spawns a PresentCompleteNotify event when the buffer swap actually
finishes. This is important because without using the timing information
from these PresentCompleteKindPixmap events, there's no way for mpv to know
exactly when a frame becomes visible on the display.

By using PresentNotifyMSC in conjunction with DRI3-enabled mesa, two
problems are created:
1. mpv assumes that a vblank won't elapse (i.e., it assumes the current MSC
   won't change) between the time when mesa enqueues the buffer swap and
   the time when mpv calls PresentNotifyMSC to ask xorg for a notification
   at the next MSC, relative to the current MSC at the time that xorg reads
   it for the PresentNotifyMSC call. This means that mpv could get a
   notification one or more vblanks later than it expects, since the
   intention here is for mpv to get a notification at the MSC that the
   buffer swap completes.
2. mpv assumes that a buffer swap always takes one vblank to complete,
   which isn't always true. A buffer swap (i.e., a page flip) could take
   longer than that depending on hardware conditions (if the GPU is running
   slowly or needs to exit a low-power state), scheduling delays (under
   heavy system or GPU load), or unfortunate timing (if the raster scan
   line happens to be at one of the last few rows of pixels and a vblank
   elapses just before the buffer swap is enqueued).

This causes mpv to have a faulty assumption of when frames become visible.

Since mpv already receives the PresentCompleteNotify events generated by
mesa's buffer swaps under the hood, the PresentNotifyMSC usage is unneeded
and just throws a wrench in mpv's vsync timing when xpresent is enabled.

Simply removing the PresentNotifyMSC usage from the egl, glx, and vulkan
VOs fixes the xpresent vsync timing.
2023-01-25 03:13:23 +00:00
Dudemanguy 879824a47f wayland: add wp-fractional-scale-v1 support
This protocol is pretty important since it finally lets us solve the
longstanding issue of fractional scaling in wayland (no more mpv doing
rendering over the target resolution and then being scaled down). This
protocol also can completely replace the buffer_scale usage that we are
currently using for integer scaling so hopefully this can be removed
sometime in the future. Note that vo_dmabuf_wayland is omitted from the
fractional scale handling because we want the compositor to handle all
the scaling for that VO.

Fixes #9443.
2023-01-24 00:04:39 +00:00
Dudemanguy 006ec9ce43 wayland: rewrite geometry and scaling handling
This is in preparation for fractional scaling support. Basically, redo
all the coordinates in wayland so that wl->geometry is equal exactly to
what is being put out to the screen (no extra wl->scaling multiplication
required). The wl->vdparams variable is also eliminated for simplicity.
This changes mpv's behavior on wayland with hidpi scaling but that will
be addressed in more detail with the next commit.
2023-01-24 00:04:39 +00:00
sfan5 9b59d39a3a vo_gpu: implement VO_DR_FLAG_HOST_CACHED
For OpenGL, this is based on simply comparing GL_VENDOR strings against
a list of allowed vendors.

Co-authored-by: Nicolas F. <ovdev@fratti.ch>
Co-authored-by: Niklas Haas <git@haasn.dev>
2023-01-23 14:13:34 +01:00
Niklas Haas 2531a89fcb vo_gpu_next: implement VO_DR_FLAG_HOST_CACHED
For sufficiently new versions of libplacebo.
2023-01-23 14:13:34 +01:00
sfan5 c7ea0cd68f vd_lavc: add "auto" choice for vd-lavc-dr
--vd-lavc-dr defaulted to "yes", which caused issues on certain
hardware. Instead of disabling it, add a new "auto" value and
make it the default.

The "auto" choice will enable DR only when we can request host-cached
buffers (as signalled by the new VO_DR_FLAG_HOST_CACHED).

Co-authored-by: Nicolas F. <ovdev@fratti.ch>
Co-authored-by: Niklas Haas <git@haasn.dev>
2023-01-23 14:13:34 +01:00
Niklas Haas f8c17f55f9 vo: add `int flags` to the get_image signature
This is a huge disgusting mess to thread through everywhere. Maybe I'm
stupid for attempting to solve the problem this way.
2023-01-23 14:13:34 +01:00