Commit Graph

49533 Commits

Author SHA1 Message Date
Leo Izen aa1158569c build: add avcodec jpegxl dependency versions
Add the libavcodec version check for AV_CODEC_ID_JPEGXL to the
build system rather than to any file that references it.
2022-04-28 23:56:50 -04:00
datasone ee62a1a56e demux: add support for r128 replaygain tags 2022-04-28 20:13:36 +00:00
Jakub Wilk 05f0ff304e DOCS/ao: remove only usage of git.io link shortening service
This link was originally shortened in bf0cb27489
to improve manpage formatting, but unfortunately Github is now
taking down this service on the 29th. Thus, the full link is
being reinstated.

ref: https://github.blog/changelog/2022-04-25-git-io-deprecation/
2022-04-28 01:07:11 +03:00
Dudemanguy 8a8580e05c wayland: use wl_surface_damage_buffer
Since 2018, wl_surface_damage_buffer has been explicitly preferred and
recommended over wl_surface_damage*. mpv was still using the old
function in a couple of spots. The only difference is that we need to
pass buffer coordinates instead of surface coordinates. In vo_wlshm,
this is done by using vo->dwidth/vo->dheight since that is always used
whenever wl_buffers are created. In the case of the cursor surfaace, we
actually already passed buffer coordinates to it (img->width/height)
which was probablly technically wrong with wl_surface_damage, but it
doesn't really matter in practice. This requires bumping wl_compositor
to version 4 which is no problem since this dates back to 2015*.

921d054803
3384f69ecf
2022-04-27 20:31:07 +00:00
Leo Izen 6605b6d619 DOCS/options: properly capitalize JPEG XL
The appropriate style for jxl images is JPEG XL,
not Jpeg XL. Update the docs to reflect this.
2022-04-26 12:47:07 -04:00
Leo Izen 1345977f99 video/image_writer: add Jpeg XL screenshots
Add Jpeg XL as a possible output format for screenshots, which
should make it possible to take fast screenshots with much better
quality than JPEG, or take lossless high-bit-depth screenshots
with lower file sizes than PNG.
2022-04-26 16:48:00 +03:00
Cœur bb5b4b1ba6 various: fix typos 2022-04-25 09:07:18 -04:00
Dudemanguy 6407095871 vo_gpu_next: avoid 0x0 resizes
It is possible for vo_gpu_next to attempt a resize before the windowing
backend is fully initialized. In practice, this can happen on wayland
which means libplacebo attempts a 0x0 resize. Depending on the API, a
0x0 resize may be allowed (vulkan or d3d11), but libplacebo just returns
a 0 in this case which mpv doesn't do anything with anyway. In the case
of opengl, this usage is explictly forbidden and will result in a
warning which may confuse users. Solve this by just not trying a resize
if dwidth and dheight in the vo are not available. Fixes #10083.
2022-04-24 22:35:54 +00:00
Dudemanguy 9d133eb00b github/workflows: workaround git permissions error
Recently, git patched a CVE which makes it much more strict about
different users operating on directories they don't own. For us, this
causes breakage with version.sh and version.py since they both run a git
describe command to fetch the commit hash. Currently, this only affects
the tumbleweed container (likely because it was recently changed) and
thus the git describe command always errors out. Workaround this by just
explictly adding the mpv directory as a safe directory for git.
2022-04-21 22:14:27 +03:00
Guido Cella f75701b219 DOCS/options: update the --load-osd-console documentation
- Say built-in which is more common than builtin
- Move "By default" because only the key to open the console is
  customizable, and fix the punctuation and case of the sentence
- ` opens the console, not ´
- Remove the sentences that explains which user script console.lua is
  based on since it's no longer relevant now that the console has been
  part of mpv for over 2 years.
2022-04-21 17:07:47 +00:00
Guido Cella c8125119fa DOCS/input: update the ASS tags documentation URL
The current one hasn't worked in years.
2022-04-21 16:53:46 +00:00
Guido Cella ccff82e610 options: make --cover-art-auto=exact the default
Now that a separate --cover-art-whitelist option exists, files like
cover.jpg are loaded even without setting --cover-art-auto to fuzzy, so
only load files that have exactly the media filename by default, since
fuzzy loading is probably more likely to load unwanted images than to
load cover art that the user intended to display, especially if you play
audio files with a short filename like a.mp3.
2022-04-21 16:42:27 +00:00
Guido Cella 9d2a6dc302 player: add cover-art-whitelist option
This allows more fine grained control over which cover art to load. With
--cover-art-auto=exact and --cover-art-whitelist=yes, you can now load
cover art with the exact media filename and the whitelisted filenames,
but not cover art that contains the media filename
(--cover-art-auto=fuzzy).
2022-04-21 16:42:27 +00:00
hooke007 c317abbb63 DOCS: fix the typo of --sub-justify 2022-04-21 16:04:50 +00:00
hooke007 7b5c6dfd57 DOCS: correct --sub-shadow-color 2022-04-21 16:04:50 +00:00
Guido Cella 120989f56a DOCS/{mpv,options}: document the watch later functionality
This adds a section to the documentation to explain how resuming
playback works, and in particular it explains how it affects which
playlist entry mpv starts playing from, since this feature was only
implied in the --playlist-start documentation.

It also groups the documentation of the watch later options together to
make them easier to find.
2022-04-21 15:07:56 +00:00
Dudemanguy cd1b04411f vo_wlshm: use draw_frame instead of draw_image
draw_image is an old API that was deprecated long ago. However when
wlshm was originally added, it used draw_image. There's no particular
reason for this and it can trivially be switched to draw_frame instead.
This has some real advantages (notably --vo=wlshm --idle --force-window
actually works).
2022-04-21 14:47:43 +00:00
Dudemanguy 8d0c1c8be0 mpv.desktop: add japanese translation 2022-04-21 14:47:24 +00:00
Mia Herkt a2d86333f4
ci: switch Tumbleweed build to openSUSE container registry 2022-04-19 05:19:31 +02:00
Jan Ekström 305332f8a0 vd_lavc: fixup unchecked usage of AV_CODEC_EXPORT_DATA_FILM_GRAIN
This fixes build failures with avcodec 58.113.100 or before,
matching FFmpeg release versions 4.0 to 4.3.

This flag was added in between avcodec 58.113.100 and 58.114.100
during the FFmpeg 4.4 development cycle. It lacks its own version bump,
so instead a check for the define is utilized instead.

Additionally, warn the user if they request GPU film grain with
too old of an FFmpeg.

Fixes #10088
2022-04-13 00:52:08 +03:00
Jan Ekström 1a597ea987 vd_lavc: fix decoder initialization when no VO is available
The VO is available during decoder initialization mostly for direct
rendering purposes, so if f.ex. a complex filter chain is utilized,
there is no video renderer information available via
mp_filter_find_stream_info during creation of the decoder filter.

Thus, check for whether the VO is available before attempting to
check the capabilities flag from it.

Additionally - to simplify logic - makes explicitly requesting GPU
film grain to always disable decoder film grain functionality. The
warning is still shown if the VO is available and no support for
film grain application is available.

Fixes #10079
2022-04-11 23:54:22 +03:00
Jan Ekström eddc0bfe25 vd_lavc: remove duplicate vd_ffmpeg_ctx pointer from init_avctx
Seems like in some functions this was called p and in others ctx,
and thus it was added as the `p` pointer was not available.
2022-04-11 23:54:22 +03:00
Dudemanguy 5774ce759a wayland: use wl_output v4 for --fs-screen-name
In wayland 1.20.0, a couple of new events, name and description, were
added to the interface. Description is not particularly useful, but name
returns back nice names for the output like "DP-1" and so on. It makes
sense to use these for fs-screen-name and prefer them over the model
name (old way of doing it) if they are available. The only problem is
that 1.20.0 is pretty new so old distros aren't going to have it anytime
soon. Deal with this by adding some defines.
2022-04-11 18:21:14 +00:00
Dudemanguy 6158bb5be2 x11: avoid wasteful rendering when possible
Because wayland is a special snowflake, mpv wound up incorporating a lot
of logic into its render loop where visibilty checks are performed
before rendering anything (in the name of efficiency of course). Only
wayland actually uses this, but there's no reason why other backends
(x11 in this commit) can't be smarter. It's far easier on xorg since we
can just query _NET_WM_STATE_HIDDEN directly and not have to do silly
callback dances.

The function, vo_x11_check_net_wm_state_change, already tracks net wm
changes, including _NET_WM_STATE_HIDDEN. There is an already existing
window_hidden variable but that is actually just for checking if the
window was mapped and has nothing to do with this particular atom. mpv
also currently assumes that a _NET_WM_STATE_HIDDEN is exactly the same
as being minimized but according to the spec, that's not neccesarily
true (in practice, it's likely that these are the same though). Anyways,
just keep track of this state in a new variable (hidden) and use that
for determing if mpv should render or not.

There is one catch though: this cannot work if a display sync mode is
used. This is why the previous commit is needed. The display sync modes
in mpv require a blocking vsync implementation since its render loop is
directly driven by vsync. In xorg, if nothing is actually rendered, then
there's nothing for eglSwapBuffers (or FIFO for vulkan) to block on so
it returns immediately. This, of course, results in completely broken
video. We just need to check to make sure that we aren't in a display
sync mode before trying to be smart about rendering. Display sync is
power inefficient anyways, so no one is really being hurt here. As an
aside, this happens to work in wayland because there's basically a
custom (and ugly) vsync blocking function + timeout but that's off
topic.
2022-04-11 18:14:22 +00:00
Dudemanguy fe6d9b6962 player: rearrange video sync opts/enums/defines
The video sync logic for mpv lies completely within its core at
essentially the highest layer of abstraction. The problem with this is
that it is impossible for VOs to know what video sync mode mpv is
currently using since it has no access to the opts. Because different
video sync modes completely changes how mpv's render loop operates, it's
reasonable that a VO may want to change how it renders based on the
current mode (see the next commit for an example).

Let's just move the video sync option to mp_vo_opts. MPContext, of
course, can still access the value of the option so it only requires
minor changes in player/video.c. Additionally, move the VS_IS_DISP
define from to player/core.h to common/common.h. All VOs already have
access to common/common.h, and there's no need for them to gain access
to everything that's in player/core.h.
2022-04-11 18:14:22 +00:00
Dudemanguy 2c2a856f25 wayland: unify visibility checking code
A bit of a personal pet peeve. vulkan, opengl, and wlshm all had
different methods for doing wayland's "check for visibility before
drawing" thing. The specific backend doesn't matter in this case and the
logic should all be shared. Additionally, the external swapchain that
the opengl code on wayland uses is done away with and it instead copies
vulkan by using a param. This keeps things looking more uniform across
backends and also makes it easier to extend to other platforms (see the
next couple of commits).
2022-04-11 18:14:22 +00:00
Jan Ekström 5edc49adc9 vo_gpu/d3d11: add message ID based log level mapping
This lets us remap various messages which might now be happening at
each frame onto the trace level, thus unaffecting the initial debug
log level.

Additionally - thanks to this ability - the previously globally denied
message queue abandonment messages can now be handled and mapped to
trace log level, as on that log level they may be of use.

Recommended by rossy and based on his libplacebo commit
6d72f6445566eddb0493447d0bda72d98a99d40c .
2022-04-11 17:56:02 +03:00
Jan Ekström 4b8e3f20bc vo_gpu/d3d11: mimic libplacebo backbuffer usage
Instead of always having the reference outside of calling resize,
request a backbuffer at start and relieve the backbuffer at
submission for presentation.
2022-04-11 17:56:02 +03:00
Jan Ekström 6102d2bd78 vo_gpu/d3d11: enable receival of color depth without active backbuffer
Query the description of the swap chain, which should in all theory
contain the format of the backbuffer. Then utilize a newly added
ra_d3d11 function to map the format to an ra_format. After that,
utilize the depth of the first plane of the format, as previously.
2022-04-11 17:56:02 +03:00
Jan Ekström b5b5098d48 vo_gpu/d3d11: add helper function to get ra_format from DXGI_FORMAT 2022-04-11 17:56:02 +03:00
Niklas Haas 26a3a06861 vo_gpu_next: switch to unpooled hwdec mapping
This makes use of the new frame acquire/release callbacks to hold on to
hwdec images only as long as necessary. This should greatly improve the
smoothness/efficiency of hwdec interop, by not holding on to them for
longer than needed.

This also avoids the need to pool hwdec mappers altogether.

Should fix #10067 as well, since frames are now only mapped when we
actually use them.
2022-04-11 15:43:51 +02:00
Dudemanguy 2cafe5137f x11: fix screen-name option
9a7b2015e1 added the --screen-name option
for x11, but it was unfortunately broken. The commit does correctly
handle vo_x11_update_screeninfo and select the correct screen. However,
vo_x11_sizehint was missed. Specifically, the force_pos bool was always
false because it only took into account --screen being set and not
--screen-name. To fix this, just add an extra condition to the force_pos
bool so it becomes true if there's a string in --screen_name. Fixes
issue #9877.
2022-04-08 19:34:53 +00:00
Oğuz Ersen 3a934da1c7 mpv.desktop: add turkish translation 2022-04-08 19:34:30 +00:00
Guido Cella 4d12dfb75a options.lua: remove unused function
val2str isn't used anywhere. Its only use was removed in dd3e52fe68,
when it was still part of osc.lua.
2022-04-08 19:20:49 +03:00
Guido Cella d6affda0a7 options: add osd-playing-msg-duration 2022-04-07 22:13:50 +00:00
Olivier Perret 86dfdf083b egl_helpers: request at least 8 alpha bits if necessary
Previously on wayland, it would result in an egl config with only 2 alpha
bits, which technically matches what was requested, but is not very useful.
Fixes #9862
2022-04-07 16:56:36 +00:00
Guido Cella 4930667784 DOCS/input: mark chapter-list as writable 2022-04-07 16:21:22 +00:00
Philip Langdale 73a06ffae6 drm: context_drm_egl: add support for enabling VRR
Variable Refresh Rate (VRR), aka Freesync or Adaptive Sync can be used
with DRM by setting the VRR_ENABLED property on a crtc if the
connector reports that it is VRR_CAPABLE. This is a useful feature
for us as it is common to play 24/25/50 fps content on displays that
are nominally locked to 60Hz. VRR can allow this content to play at
native framerates.

This is a simple change as we just need to check the capability
and set the enabled property if requested by the user. I've defaulted
it to disabled for now, but it might make sense to default to auto
in the long term.
2022-04-05 20:56:36 -07:00
Lynne f61eda0f5e vd_lavc: add vo caps and option to set GPU film grain application 2022-04-05 15:02:18 +02:00
Lynne 4149cc2ce3 vo_gpu_next: apply film grain if such metadata is present 2022-04-05 15:02:18 +02:00
Lynne 7230550191 vf_format: support forwarding/stripping film grain metadata 2022-04-05 15:02:18 +02:00
Lynne 3194ed4b58 mp_image: support film grain parameters 2022-04-05 15:02:18 +02:00
Jan Ekström 083ae8e736 vd_lavc: hide a deprecation warning in already handled compatible code
The field has been deprecated, yet the upcoming new default is not yet
the default. Thus, until lavc major hits 60 and the default behavior
finally gets changed, we have to explicitly set the field's value.

The deprecation had already been handled by adding the required
version limitation for this code in bbbf3571ed ,
this change merely just removes the warning which would otherwise
appear until lavc major version gets bumped to 60.
2022-04-03 00:23:58 +03:00
Aman Karmani fb7b66ecf1 sub/osd: use atomic for osd_state.force_video_pts
this field is used only in a special vo draining edge case.

switching to an atomic reduces osd->lock contention
between the mpv core (in write_video) and vo threads
which are managing osd rendering manually (such as vo_rpi).

Signed-off-by: Aman Karmani <aman@tmm1.net>
2022-04-02 21:41:58 +03:00
Aman Karmani 76b9254b8b osdep/atomic: add mp_atomic_double
Signed-off-by: Aman Karmani <aman@tmm1.net>
2022-04-02 21:41:58 +03:00
Niklas Haas a76b1f4abd Revert "vo_gpu_next: remove unnecessary dependency"
This reverts commit 1c2dde91d3.

Fixes #10037
2022-04-01 23:43:47 +02:00
Thomas Weißschuh deedc3d418 ao_pipewire: Do not hold thread lock during loop stop
Stopping the thread is done using pw_thread_loop_stop(),
*which must be called without the lock held.*

Fixes #10033
2022-03-31 14:40:21 -07:00
Thomas Weißschuh 84dc9b1a02 ao_pipewire: fix resource lifetimes
We have to destroy the core before destroying the loop.
Also we have to lock the mainloop for operations on its objects.

Fixes #10003
2022-03-30 13:06:33 -07:00
Niklas Haas 1c2dde91d3 vo_gpu_next: remove unnecessary dependency
Pulling in <libplacebo/utils/libav.h> in particular triggers the
notorious _av_vkfmt_from_pixfmt linking issue when FFmpeg is built
without Vulkan support.
2022-03-29 15:42:09 +02:00
sfan5 84821dbcb6 lua: use correct chunkname when loading script files
This was brought up in #10007 and it turned out mpv did not follow Lua conventions.
2022-03-23 21:09:53 +01:00