| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
There's a lot of wild 1e6, 1000, etc. lying around in the code. A macro
is much easier to read and understand at a glance. Add some helpers for
this. We don't need to convert everything now but there's some simple
things that can be done so they are included in this commit.
|
|
|
|
|
|
|
|
| |
add support for vulkan through metal and a translation layer like
MoltenVK. also add the possibility to use different render timing modes
for testing.
i still consider this experimental atm.
|
|
|
|
|
|
|
| |
add an animation lock to the window to prevent the window from closing
while animating. if this is done while the fs animation is running the
dock will stay hidden. this is not used yet, because it's unnecessary
for cocoa-cb but will be for new vo backends.
|
|
|
|
|
|
| |
Fixes type mismatch after recent changes.
Fixes: 59dd7d94af7651baf7e60966c5f8e7d52959d958
|
|
|
|
|
| |
While the video playing, it's not actually needed and can cause
unnecessary redraws. Fixes #12623.
|
|
|
|
| |
same rationale as last commit
|
|
|
|
|
|
|
|
|
|
|
| |
Several window resizing operations (i.e., --auto-window-resize,
border dragging with --keep-aspect-window, Alt+0/1/2) cause the
window to detach from the snapped borders. This patch resolves
this by recording to which borders the window is snapped, and
using this info to determine how the window should be placed after
resizing.
Closes https://github.com/mpv-player/mpv/issues/6588
|
|
|
|
|
|
|
|
|
|
|
| |
Linux and macOS already use nanosecond resolution for their sleep
functions. It was just being converted from microseconds before. Since
we have mp_time_ns now, go ahead and bump the precision here. The timer
for windows uses some timeBeginPeriod thing which I'm not sure what it
does really but whatever just convert the units to ms like they were
doing before. There's really no reason to keep the mp_sleep_us helper
around. A multiplication by 1000 is trivial and underlying OS clocks
have nanosecond precision.
|
|
|
|
|
|
|
|
|
|
| |
On linux, several platforms poll for events over a fd. This has ms
accuracy, but mpv's timer is in ns now so lots of precision is lost. We
can use an mp_poll wrapper to use ppoll instead which takes a timespec
directly with nanosecond precision. On systems without ppoll this falls
back to old poll behavior. On wayland, we don't actually use this
because ppoll completely messes up the event loop for some unknown
reason.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many cases, this is purely cosmetic because poll still only accepts
microseconds. There's still a gain here however since
pthread_cond_timedwait can take a realtime ts now.
Additionally, 37d6604d70c8c594de2817db26356c4c950ac0fd changed the value
added to timeout_ms in X11 and Wayland to ensure that it would never be
0 and rounded up. This was both incomplete, several other parts of the
player have this same problem like drm, and not really needed. Instead
the MPCLAMP is just adjusted to have a min of 1.
|
| |
|
|
|
|
|
| |
This is weird. The caller should be responsible for converting the value
if desired. Move the conversion to player/command.c instead.
|
|
|
|
|
| |
This timing dependency does not guarantee that we will wake up in the
future, depending on processing times.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vo_still_displaying() is racey with vo_request_wakeup_on_done() and above
that it doesn't work as expected. VO can run out of work and go to sleep
for 1000s, while the play thread still returns on vo_still_displaying()
check, because of a check `now < frame_end` so it never advances and go
to sleep itself.
This fixes dead lock that we have when image parameters changes during
playback.
This reverts commit 0c9ac5835be70ae26e4aa875e833fe2c7b3b3bf3.
Fixes: #12575
|
|
|
|
|
|
| |
It is already set above.
Fixes: #12577, #12587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fbe154831a8addfc18a4f81e1c4b9284c31acace added a new VOCTRL to signal
when the OSD changed for gpu-next's handling of subtitles, but this is
both not necessary and actually incomplete. The VOCTRL would signal OSD
changes, but not all subtitle changes (like selecting another
non-external sub track for example). VOCTRL_OSD_CHANGED was used to
increment p->osd_sync which would then redraw the blended subtitles if
the player was paused.
But there's already a VOCTRL_PAUSE and VOCTRL_RESUME. Plus, the
sub_bitmap_list object will have items in it if it changed in any way,
so we don't need the VOCTRL_OSD_CHANGED method at all. That can be
removed.
The check that fp->osd_sync < p->osd_sync stays in place since that's an
optimization while the video is playing, but we also check the pause
state as well since the VO can know this. If we're paused, then always
do update_overlays since core must be signalling a redraw to us if we
get a draw_frame call here. Additionally in update_overlays itself, the
p->osd_sync counter is incremented if we have any items since the frame
signature will need that. As for the actual bug that is fixed, changing
subtitle tracks while paused with blended subtitles now correctly works.
Previously, it was never updated so the old subtitle stayed there
forever until you deselected it (since VOCTRL_OSD_CHANGED triggered
there).
Also include some cosmetic code fixes that were noticed.
|
|
|
|
|
|
|
|
|
|
|
| |
The current calculation makes the implicit assumption that the margins
on both sides are always equal (the 2 times multiplication). This isn't
true though. For example, a 720p video fullscreened on a 1680x1050
display will have a top margin of 52 but a bottom margin of 53. The
current calculation just multiplies 52 by 2, so it's off by one. Fix
this by adding together all the margins together (left + right or top +
bottom) then adding that to the dst window size (width or height). This
way, we get the full size of the window for the viewport. Fixes #12554.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes white background appearing for short period of time before
first frame is drawn. Clear to black as this is way less distracting
than bright white flash.
Borderless window and fullscreen seems to be initially not
drawn/transparent, so no need to clear it to black. Only when
decorations are enabled (--border) the issue happens.
Fixes: #12549
|
|
|
|
|
|
| |
Forgotten in 7b8a30fc8132203bc93d35ac887682d2044ad5a9. Every other case
either is either a dummy frame (no allocated memory) or we manage it as
part of the usual wayland buffer release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When implementing vo_dmabuf_wayland, it always did a copy of the image
from the current frame and worked with that. The reason was because
mpv's core held onto the frame and caused some timing issues and
rendering glitches depending on when it freed the image. This is pretty
easy to fix: just make vo_dmabuf_wayland manage the the frames. In vo.h,
we add a boolean that a VO can set to make them manage freeing frames
directly. After doing this, change the buffers in vo_dmabuf_wayland to
store the whole vo_frame instead of just the image. Then, just modify
some things a bit so frame is freed instead of the image. Now, we should
truly have zero-copy playback. Well as long as you don't use libass to
render anything (that's still a copy from system memory).
|
|
|
|
| |
We have to support all changing states, not only borderless.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
e125da2096d97ec7e64701bf6289705a24c31729 changed the z order of the
surfaces a bit, but it turns out this has a side effect. If the aspect
ratio of the actual video doesn't match your display, the osd surface
doesn't scale properly and gets clipped. Put the z ordering back where
it used to be. Instead when we have the force window case, simply attach
the already existing solid buffer to the video surface. This allows the
osd surface to actually draw over it instead of always being obscured so
it satisfies the case of not having any real video frames but still
wanting to draw the osd. Also don't mess with any of the viewport source
setting stuff with force window. Weston complains about it, and it's
nonsensical anyway. Fixes #12547.
|
|
|
|
|
|
| |
Fixes window resizing in borderless mode after adding WS_SYSMENU.
Fixes: 172d9be3005c6a85f4f139f1dedccefe26ea8d91
|
|
|
|
|
|
|
|
|
|
|
|
| |
0739cfc20934ac7772ab71dbae7ecba4ba10fda4 added the draw_frame API
deprecated draw_image internally. VOs that still used draw_image were
around, but really there's no reason to not just "upgrade" them anyway.
draw_frame is what the "real" VOs that people care about (gpu/gpu-next)
use. So we can just simplfy the code a bit now. VOCTRL_REDRAW_FRAME is
also no longer needed so that can be completely deleted as well. Note
that several of these VOs are legacy crap anyway (e.g. vaapi) and maybe
should just be deleted but whatever. vo_direct3d was also completely
untested (not that anyone should ever use it).
|
|
|
|
|
|
| |
Fixes missing icon when initial window is created without caption.
Fixes: #12472
|
|
|
|
|
|
|
|
| |
This causes only problems, because we convert mp_time to realtime, which
is not atomic, so we introduce error. And even though on sane platforms
it should work fine, after all the sleep time is in the past.
winpthreads like to sleep for like over 10ms when the time is less than
current time, but not more than 1s.
|
|
|
|
| |
High refresh rate displays exists...
|
|
|
|
|
| |
There is no reason to use microseconds precision. We have precise timers
all all relevant platforms.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In practice, most compositors implement the rotation clockwise which
matches mpv's option, but amusingly this is actually incorrect.
According to the spec*, wayland buffer rotations are counter-clockwise.
So with this assumption in mind, in order for the rotation to match
mpv's usual semantics, the 90 degree and 270 degree positions need to be
flipped. Of course, this will make the VO rotate the wrong way on most
compositors, but this is what the spec says (sway master is known to
currently be correct). Fixes #12508 (sort of but will break the rotation
direction on other compositors. Oh well).
*: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_output-enum-transform
|
|
|
|
|
|
|
|
|
| |
NV16 is the half subsampled version of NV12 format. Decoders which
support High 4:2:2 of h264 provide the frame in NV16 format to establish
richer colorspace. Similar profiles are also available in HEVC and other
popular codecs. This commit allows NV16 frames to be displayed over
drmprime layers.
Signed-off-by: hbiyik <boogiepop@gmx.com>
|
|
|
|
|
|
|
|
| |
Calling wl_display_disconnect closes the file descriptor, no need to
manually do it ourselves beforehand which causes a double close on the
fd.
Signed-off-by: Jack Mitchell <jack.mitchell@tuxable.co.uk>
|
| |
|
|
|
| |
uses the same mechanic as for x11
|
|
|
|
|
|
|
| |
Pointless bloat option, hard-coded as 256 now in libplacebo and no
reason not to also hard-code in mpv.
See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
|
|
|
|
|
|
|
| |
Pointless bloat option, hard-coded as 1e-3 now in libplacebo and no
reason not to also hard-code in mpv.
See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
|
|
|
|
|
|
|
| |
Unbelievably, mutter actually supports the idle inhibit protocol now
after many years of pain*. Let's remove this hacky warning.
*: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3145
|
|
|
|
| |
Also change a ta_free to talloc_free for consistency reasons.
|
|
|
|
| |
Gets rid of yet another mp_read_option_raw call.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Apparently removing WS_CAPTION disables some window animations. Instead
adjust non-client area to not draw title bar.
Note that we do not account for difference in real border size and
invisible one, but seems to work correctly.
|
| |
|
|
|
|
|
|
| |
I don't think in fullscreen mode it makes sense to enable rounded corners.
We can add another option if someone needs it, but for now `window_corners`
affects only the window as one would expect.
|
|
|
|
| |
Allows to set preference for window corners rounding for DWM.
|
|
|
|
| |
Fixes too small initial window size.
|
|
|
|
| |
DWM makes part of left, right and bottom border invisible.
|
|
|
|
| |
Fixes: #11432
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the addition of fractional scaling support, wl->scaling was
converted to a double. Some compositors (Plasma) can report values under
1 for fractional scaling, so this meant wl->scaling could be some
small fractional value. This is fine except that when using the legacy
code for drawing the mouse cursor (i.e. not the cursor-shape protocol),
it still uses the old integer scaling method in core wayland. The reason
for this is simply because fractionally scaling the mouse cursor surface
is nonsense and nobody even has cursor images for anything besides a
select few sizes anyways (32x32, 48x48, etc.). The existing integer
scaling sort of works but it's pretty bad too and you can get some weird
sizes anyway. This is why cursor-shape is preferred since it fixes this.
Anyways, since buffer scaling for the cursor only takes integers, there
could be truncation to 0 in the previously mentioned fractional scale
this. This naturally causes the compositor to send us an error and mpv
quits. The fix is to always make sure that the scale value used for the
cursor is at least 1. Anything less makes no sense. Fixes #12309.
|
|
|
|
|
| |
Fixes: #11610
Fixes: 9feeb324eddd9ed73ae667e10275f663d70f7544
|
|
|
|
|
| |
All SUBBITMAP_LIBASS are converted to sRGB beforehand, for the rest we
need to use video color space.
|
|
|
|
|
|
|
| |
There was assumption in the code that default settings are compatible
with dumb mode and are only one that should be used in this case.
Force bilinear if dumb mode is enabled.
|
|
|
|
|
| |
THis allows adding grain without debanding. libplacebo already supported
this, so no changes are required there.
|
|
|
|
|
|
| |
f56043759494dd584c8d82e7890f92fada18e34b deprecated this since the
--drm-device path option was added as a replacement. Drop the card
number selection logic.
|
|
|
|
| |
Easier to keep track of when we do want to remove it.
|
|
|
|
|
|
|
|
|
|
|
| |
A bit different from the OPT_REPLACED/OPT_REMOVED ones in that the
options still possibly do something but they have a deprecation
message. Most of these are old and have no real usage. The only
potentially controversial ones are the removal of --oaffset and
--ovoffset which were deprecated years ago and seemingly have no real
replacement. There's a cryptic message about --audio-delay but who
knows. The less encoding mode code we have, the better so just chuck
it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting
around in the code. This is harmless, but the vast majority of these are
ancient. 26f4f18c0629998a9b91e94722d166866d8b80a3 is the last commit
that touched the majority of these and of course that only changed how
options were declared so all of this stuff was deprecated even before
that. No use in keeping these, so just delete them all. As an aside,
there was actually a cocoa_opts but it had only a single option which
was replaced by something else and empty otherwise. So that entire thing
was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were
added in 0.35 or later were kept as is.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The osd support was originally written with the requirement that we have
actual frames getting delivered to the VO. This isn't always the case
though. If you force a window on a blank audio file for example, then
there will be no frame thus draw_frame did nothing. Since the previous
commit allows us to reliably detect this, we can rearrange the code
around a little bit to make this possible. A key change is to make the
osd_subsurface have wl->surface as the parent. This is seemingly
required otherwise the osd_surface buffers are never visible above the
empty video_surface when we have a black window. Also nuke the desync
call since it's completely pointless. Fixes #12429.
|
|
|
|
|
|
| |
It's useful for some VOs (dmabuf-wayland) to know if the image params
are actually real or fake ones sent by the core for the purpose of
force_window.
|
|
|
|
| |
Need to use correct adjusted dst.
|
|
|
|
|
|
|
|
|