From 08848e76d9219a097b8ca4d493ab1df7eb693162 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 23 Nov 2020 13:26:57 -0600 Subject: [PATCH] player: add --screen-name and --fs-screen-name Simple groundwork for adding a couple of user options that allow selecting the screen with a string name. The next two commits implements these options for xorg and wayland. --- DOCS/interface-changes.rst | 3 +++ DOCS/man/options.rst | 12 ++++++++++++ options/options.c | 2 ++ options/options.h | 2 ++ 4 files changed, 19 insertions(+) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 16f570ae13..60109b5aae 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -26,6 +26,9 @@ Interface changes :: + --- mpv 0.34.0 --- + - add `--screen-name` and `--fs-screen-name` flags to allow selecting the + screen by its name instead of the index --- mpv 0.33.0 --- - add `--d3d11-exclusive-fs` flag to enable D3D11 exclusive fullscreen mode when the player enters fullscreen. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 50ff3ec665..5492d1ba4d 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2839,6 +2839,12 @@ Window See also ``--fs-screen``. +``--screen-name=`` + In multi-monitor configurations, this option tells mpv which screen to + display the video on based on the screen name from the video backend. The + same caveats in the ``--screen`` option also apply here. This option is + ignored and does nothing if ``--screen`` is explicitly set. + ``--fullscreen``, ``--fs`` Fullscreen playback. @@ -2859,6 +2865,12 @@ Window See also ``--screen``. +``--fs-screen-name=`` + In multi-monitor configurations, this option tells mpv which screen to go + fullscreen to based on the screen name from the video backend. The same + caveats in the ``--fs-screen`` option also apply here. This option is + ignored and does nothing if ``--fs-screen`` is explicitly set. + ``--keep-open=`` Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and ``--loop`` is not used). diff --git a/options/options.c b/options/options.c index a11c1114b9..8aadc87ab9 100644 --- a/options/options.c +++ b/options/options.c @@ -147,8 +147,10 @@ static const m_option_t mp_vo_opt_list[] = { {"no", 0}, {"yes", 1}, {"downscale-big", 2})}, {"wid", OPT_INT64(WinID)}, {"screen", OPT_CHOICE(screen_id, {"default", -1}), M_RANGE(0, 32)}, + {"screen-name", OPT_STRING(screen_name)}, {"fs-screen", OPT_CHOICE(fsscreen_id, {"all", -2}, {"current", -1}), M_RANGE(0, 32)}, + {"fs-screen-name", OPT_STRING(fsscreen_name)}, {"keepaspect", OPT_FLAG(keepaspect)}, {"keepaspect-window", OPT_FLAG(keepaspect_window)}, {"hidpi-window-scale", OPT_FLAG(hidpi_window_scale)}, diff --git a/options/options.h b/options/options.h index b865ff8896..f28c054500 100644 --- a/options/options.h +++ b/options/options.h @@ -22,7 +22,9 @@ typedef struct mp_vo_opts { bool focus_on_open; int screen_id; + char *screen_name; int fsscreen_id; + char *fsscreen_name; char *winname; char *appid; int x11_netwm;