Commit Graph

49711 Commits

Author SHA1 Message Date
Niklas Haas 7a6dc79e29 vo_gpu_next: use correct pixel size when mapping formats
`total_bits` may be less than the true pixel stride (`bpp`) for formats
which contain extra ignored components (e.g. rgb0).
2022-09-12 15:25:56 +02:00
Thomas Weißschuh 38a7562ebe ao_pipewire: listen to hotplug events 2022-09-11 20:24:42 -07:00
Thomas Weißschuh f36eeaf4e8 ao_pipewire: use proper hotplug init APIs 2022-09-11 20:24:42 -07:00
Thomas Weißschuh aa7223cd8c ao_pipewire: create is_sink_node helper 2022-09-11 20:24:42 -07:00
Thomas Weißschuh 235a66bfc8 audio: list devices for all AOs with hotplug_init
Previously we would only call list_devs() on available AOs if an AO
*did not* have a hotplug_init() callback or for the first one that *did*
have it.

This is problematic when multiple fully functional hotplug-capable AOs
are available.

The second one would not be able to contribute discovered devices.

This problem prevents ao_pipewire from introducing full hotplug support
with hotplug_init().
2022-09-11 20:24:42 -07:00
Thomas Weißschuh 013ec877f6 audio: try to use playback AO as hotplug AO first
When a platform has multiple valid AOs that can provide hotplug events
we should try to use the one that also provides playback.

Concretely this will help when introducing hotplug support for
ao_pipewire.

Currently ao_pulse is probed by ao_hotplug_get_device_list() before
ao_pipewire and on the common setups where both AOs could work pulse
will be selected for hotplug handling.
This means that hotplug_init() of ao_pipewire will never be called and
list_devs() has to do its own initialization.
But if ao_pulse is non-functional or not compiled-in suddenly
ao_pipewire *must* implement hotplug_init() for hotplugging events to
work for all.

Also if the hotplug ao_pulse connects to a PulseAudio instance that is
not emulated by the same PipeWire instance as the playback ao_pipewire
the hotplug events are useless.
2022-09-11 20:24:42 -07:00
Thomas Weißschuh a9155c6f97 ta: increase size of names printed
30 characters are not a lot.
Also when the name is calculated from the allocation site the line
number will be the at the end of the name, so truncating it is
especially inconvenient.
2022-09-11 20:24:42 -07:00
Thomas Weißschuh 535cd6f313 ao_pipewire: handle AOCONTROL_UPDATE_MEDIA_ROLE 2022-09-10 12:32:52 -07:00
Thomas Weißschuh 3167a77aa3 audio: add AOCONTROL_UPDATE_MEDIA_ROLE
This is used to notify an AO about the type of media that is being
played.
Either a movie or music.
2022-09-10 12:32:52 -07:00
Thomas Weißschuh 221bf540a1 ao_pipewire: fix indent 2022-09-10 12:32:52 -07:00
Philip Langdale 98f02e33ef repack: add repacker for ccc16x16 formats
I'm adding support in ffmpeg for the XV36 format which will be used
by VAAPI for 12bit 4:4:4 content. It's an undefined-alpha channel
variant of Y412 which is itself a 12bit+4bits padding variant of Y416.

We currently have a repacker for full four channel cccc16, and for
three channel ccc16, but nothing for ccc16x16 with the undefined alpha
channel.

It's simple enough to add one using the existing macros.
2022-09-10 12:31:44 -07:00
Vitaly Zaitsev ca9b00145c mpv.metainfo.xml: add XDG appstream metadata manifest 2022-09-09 19:28:26 +02:00
Cairn a7098a4336 DOCS: Mention "mono" audio channels option 2022-09-09 13:00:58 -04:00
25792431 d433c5d655
DOCS/libmpv: fix typo in linkage section 2022-09-03 12:54:48 -04:00
Thomas Weißschuh 7a7042a4d1 w32: fix typo in F23 mapping 2022-09-03 08:46:42 -04:00
Tillmann Karras 1800891a1d vo_gpu_next: fix typo affecting --target-trc option 2022-09-02 22:03:33 -04:00
Thomas Weißschuh c4db110c8e macos: add support for F13-F20 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh c5e5fba632 w32: add support for F13-F24 keys
Fixes #10595
2022-09-02 14:05:46 +02:00
Thomas Weißschuh 103efdd614 x11: add support for F13-F24 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh 03e8ed450d wayland: add support for F13-F24 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh 5d3680c314 input: add function keys F13-F24 2022-09-02 14:05:46 +02:00
Niklas Haas 9be52e5dd8 ad_lavc: strip non-normalized floats
`opus` codec likes returning denormalized floats in some cases, causing
wacky issues.

Fixes #10290
2022-09-02 01:27:31 +02:00
Niklas Haas 04062b6f89 vo_gpu_next: display subtitles without video stream
Fixes https://github.com/mpv-player/mpv/issues/10594
2022-08-31 13:33:05 +02:00
sfan5 0421e81965 DOCS/options: update vd-lavc-skiploopfilter, skipidct and related descriptions
Cross-checked the current functionality of these with the FFmpeg source.
2022-08-31 11:29:39 +02:00
Avi Halachmi (:avih) 0f30b0757f DOCS/mpv: remove spaces at EOL, ensure 80 cols
These are fixes for the previous commit.
2022-08-29 16:33:38 +03:00
enly1 92c03a191b DOCS/mpv: added COMMAND INTERFACE refs to INTERACTIVE CONTROL
Added COMMAND INTERFACE references to make it easier for new users.
2022-08-29 16:26:15 +03:00
Thomas Weißschuh 211ce69f74 ao_pipewire: for_each_sink(): report errors 2022-08-28 10:46:54 -07:00
Owen Rafferty 1a32bd37e0 meson: fix condition for enabling vaapi-egl 2022-08-27 10:53:05 -07:00
Niklas Haas 89cab5c32f meson: fix libplacebo check
Missing waf quivalent, and doesn't necessarily output a good error
message. But I might as well submit this rather than sitting on it
unnecessarily.
2022-08-26 02:24:20 +02:00
Philip Langdale ed7717298b audio: fix lack of reinitialization on format change with pull AOs
uau did some investigation and noticed that we do not send a wakeup
event when we encounter end-of-stream in ao_read_data(), in contrast to
the equivalent logic for push AOs in ao_play_data().

Inserting that wakeup fixes the original problem of lack of
reinitialization on a format change without the problems we saw with
the previous attempted fix.

Fixes #10566
2022-08-23 11:01:52 -07:00
Philip Langdale e2e8c21be4 player/audio: remove explicit drain on EOF
We have previously had a problem where pull AOs (such as pipewire)
would not reinitialize on a format change when going between two
audio-only files. In such a situation, playback would stop after the
first file.

We initially attempted to fix this by explicitly draining on EOF, which
solves that problem but introduces a blocking step where we don't
actually want one, breaking gapless audio, and causing dropped frames
at the end of playback for files with video in them too.

So, let's undo these changes and do something better in the next
commit.
2022-08-23 11:01:52 -07:00
Thomas Weißschuh 6c1f01d284 ao_pipewire: make sure not to exceed the available buffer
The error description in #10545 could indicate that we are overflowing
we are corrupting the buffer metadata ourselves through out-of-bound
writes.
This check is also present in pw-cat so it seems to be expected for
b->requested to exceed the actual available buffer space.

Potential fix for #10545
2022-08-21 18:38:53 +02:00
Thomas Weißschuh bf5c19e05b audio: don't try to drain non-existent AO
52aed495cb ("audio: drain ao on EOF") introduced logic to drain an AO
when EOF of the input has been reached.
When no AO however is present this leads to a NULL-dereference.

Fixes #10556
2022-08-21 08:05:13 -07:00
Niklas Haas 37aea112c1 vo_gpu_next: pass GL get_proc_addr pointer to libplacebo
Facing down the multitude of ways to somehow wrangle the get_fn pointer
out of the GL environment and into libplacebo, I decided the easiest is
to just store it inside the GL struct itself.

The lifetime of this get_fn function is a bit murky, since it's not
clear on whether or not it survives the VO init call (especially in the
case of the GL render API, which explicitly states that parameters do
not need to survive the call they're passed to), so just add a
disclaimer.

(It's fine for us to use like this because `gpu_ctx_create` is still
part of VO init)

Closes https://code.videolan.org/videolan/libplacebo/-/issues/216
2022-08-19 13:54:50 +02:00
Thomas Weißschuh 891c9c869f ao_pipewire: test on FreeBSD 2022-08-18 09:16:52 -07:00
The-head-obamid d5b0f5648d mpv.desktop: add RIST protocol to desktop entry 2022-08-18 11:33:50 +02:00
The-head-obamid 4c431c8ad6 osxbundle: add RIST protocol support to app metadata 2022-08-18 11:33:50 +02:00
The-head-obamid f344d481a5 stream_lavf: enable RIST protocol support via ffmpeg 2022-08-18 11:33:50 +02:00
Thomas Weißschuh e735f7f61a ao_pipewire: restructure logic a bit 2022-08-17 15:48:12 -07:00
Thomas Weißschuh dbfee1be3d ao_pipewire: only try to read requested data 2022-08-17 15:48:12 -07:00
Thomas Weißschuh 0638a91ff4 ao_pipewire: report all available info about chunk
This allows the audio server better to make sense of the data instead of
having to use heuristics.
2022-08-17 15:48:12 -07:00
Christoph Heinrich 08dd30fde8 ytdl_hook: improve track detection
Every format that was not detected as a video format was added to the
audio tracks. This resulted in e.g. YouTube storyboards from ending up
in the list of audio tracks.

Now formats that are already known to be neither video formats nor audio
formats, will also not end up in any track list.

Formats where it is unknown if they are video or audio get added to
tracks if `force_all_formats` is used, otherwise only
formats that are known to contain video or audio become video or audio
tracks respectively.

https://github.com/yt-dlp/yt-dlp/issues/4373#issuecomment-1186637357
2022-08-17 20:04:00 +00:00
Leo Izen 52e7269ea6 misc/random: add xoshiro random number implementation
Add xoshiro as a PRNG implementation instead of relying
on srand() and rand() from the C standard library. This,
in particular, lets us avoid platform-defined behavior with
respect to threading.
2022-08-17 10:21:55 -04:00
Dudemanguy 813164cc07 meson: fix the build-date option
Rewrites are hard.
2022-08-16 11:41:52 -05:00
Dudemanguy 8e9c5b7b66 meson: fix building without gl
This needs to be unconditionally added.
2022-08-15 11:30:11 -05:00
Dudemanguy 1835dfc05c meson: consistently use feature['foo']
Since the previous commit introduced the notion of a features dictionary
that conveniently tells us whether or not to use a feature in a simple
yes/no, we can make use of this everywhere in the build. Instead of
doing something like 'if foo.()', change it to 'if feature['foo']
instead. This enforces a consistent standard instead of having a lot of
different possible combinations of booleans that may or may not do
something.
2022-08-15 14:14:44 +00:00
Dudemanguy f295d39f5c meson: refactor generating config.h
mpv has a ton of defines that are generated during building. Previously,
the meson build just had this as a big giant wall of text that manually
set each one but we can do this smarter. Instead, change the "features"
object to a dictionary and have it hold the name of the feature and its
value (true/false on whether it is enabled). Then at the end, just loop
through it and reformat the name of the feature so it becomes
HAVE_FEATURE. A side effect of this is that a lot of extra defines are
generated that aren't actually used in the code, but the waf build
worked like this for years anyway. A nice result of this is that the use
of foo['use'] internally can be completely eliminated and replaced with
feature['foo'] instead when needed.
2022-08-15 14:14:44 +00:00
Dudemanguy 7c4f03e82a meson: disable dvdnav by default
It turns out that this is disabled in waf. Go ahead and copy this in
meson for consistency.
2022-08-15 14:14:44 +00:00
Dudemanguy 686027f9b2 meson: reduce dictionary usage
The build was a bit overzealous with using dictionaries. These are fine
for when the feature checking is more complicated, but there's no point
in having them for the simplier things. This also eliminates the usage
of the 'name' key completely.
2022-08-15 14:14:44 +00:00
Dudemanguy 484f1d7adc meson: add comment clarifying windows-internal-pthreads 2022-08-15 14:14:44 +00:00