diff options
author | Devaev Maxim <[email protected]> | 2020-07-13 04:10:26 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-07-14 09:04:52 +0300 |
commit | 77f3dab55c52859490619825ace4620a5d134901 (patch) | |
tree | 90ac48b6cb5108543f9f3bad423c8a05de0e1ace /kvmd/apps/__init__.py | |
parent | 07fb731b215a560bdc0a89a1fd5c199d910034a3 (diff) |
optional quality and resolution
Diffstat (limited to 'kvmd/apps/__init__.py')
-rw-r--r-- | kvmd/apps/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py index b3bc98fc..a4264faf 100644 --- a/kvmd/apps/__init__.py +++ b/kvmd/apps/__init__.py @@ -56,6 +56,7 @@ from ..validators.basic import valid_number from ..validators.basic import valid_int_f1 from ..validators.basic import valid_float_f0 from ..validators.basic import valid_float_f01 +from ..validators.basic import valid_string_list from ..validators.auth import valid_user from ..validators.auth import valid_users_list @@ -74,6 +75,7 @@ from ..validators.net import valid_ssl_ciphers from ..validators.kvm import valid_stream_quality from ..validators.kvm import valid_stream_fps +from ..validators.kvm import valid_stream_resolution from ..validators.kvm import valid_hid_key from ..validators.kvm import valid_hid_mouse_move @@ -259,9 +261,11 @@ def _get_config_scheme() -> Dict: "shutdown_delay": Option(10.0, type=valid_float_f01), "state_poll": Option(1.0, type=valid_float_f01), - "quality": Option(80, type=valid_stream_quality), + "quality": Option(80, type=(lambda arg: (valid_stream_quality(arg) if arg else 0))), # 0 for disabled feature "desired_fps": Option(30, type=valid_stream_fps), "max_fps": Option(60, type=valid_stream_fps), + "resolution": Option("", type=(lambda arg: (valid_stream_resolution(arg) if arg else ""))), + "available_resolutions": Option([], type=(lambda arg: valid_string_list(arg, subval=valid_stream_resolution))), "host": Option("localhost", type=valid_ip_or_host), "port": Option(0, type=valid_port), |