Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various: define builtin options and key bindings for images #15346

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guidocella
Copy link
Contributor

This makes mpv a good image viewer out of the box, as it is currently hard to setup.

It adds a builtin image conditional profile that users can extend in mpv.conf. It is written to not restore and reapply the options on each image change, because that is slow for certain options (e.g. --d3d11-flip=no restarts the VO), and causes visible flicker when options like gamma are unapplied before changing image and reapplied on the next image. But it still restores the previous options after switching to a video or audio file.

etc/image-input.conf defines default key bindings for image, and ~/.config/mpv/image-input.conf can override them.

Files called image-input.conf are added to an input section called image, and builtin.conf enables it for images and disables it for non-images. Because enable-section and disable-section are only called in builtin.conf, they can be replaced with a different mechanism when deprecated input sections are removed without a breaking change.

Alternative to #15344, gives proper builtin support to image-input.conf instead of adding a new command to let user handle it. Input sections are only really useful for images, and it is fine to remove them if we support different image key bindings out of the box, and later disable them with a different mechanism, e.g. delete key bindings whose location contains image-input.conf. We already have many mechanisms to add key bindings anyway, input.conf, load-input-conf, mp.add_key_binding, the keybind command.

If this approach is considered good we can then actually decide the bindings and options.

This makes mpv a good image viewer out of the box, as it is currently
hard to setup.

It adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

etc/image-input.conf defines default key bindings for image, and
~/.config/mpv/image-input.conf can override them.

Files called image-input.conf are added to an input section called
image, and builtin.conf enables it for images and disables it for
non-images. Because enable-section and disable-section are only called
in builtin.conf, they can be replaced with a different mechanism when
deprecated input sections are removed without a breaking change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant