summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-11-23 13:26:57 -0600
committerDudemanguy <random342@airmail.cc>2020-12-06 17:36:43 +0000
commit08848e76d9219a097b8ca4d493ab1df7eb693162 (patch)
tree49a91858a0e636ade6bbbf8cbcc3256457a94ec0
parentd479dfd67de910d2a8abf876cd2d99cc2e62c2ea (diff)
downloadmpv-08848e76d9219a097b8ca4d493ab1df7eb693162.tar.bz2
mpv-08848e76d9219a097b8ca4d493ab1df7eb693162.tar.xz
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.
-rw-r--r--DOCS/interface-changes.rst3
-rw-r--r--DOCS/man/options.rst12
-rw-r--r--options/options.c2
-rw-r--r--options/options.h2
4 files changed, 19 insertions, 0 deletions
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=<string>``
+ 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=<string>``
+ 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=<yes|no|always>``
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;