summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-01-26 06:28:30 +0300
committerDevaev Maxim <[email protected]>2021-01-26 06:28:40 +0300
commit4c32ce01ad97e9b8b8b9ceb298f93ffd065e0ece (patch)
tree870d8a054ccd84f8380f18bb78b5e29ee68e08dd /kvmd/apps/vnc/__init__.py
parenta0ae387a6c24daec8ccef208a724035914d6c428 (diff)
many fixes for h264 chain
Diffstat (limited to 'kvmd/apps/vnc/__init__.py')
-rw-r--r--kvmd/apps/vnc/__init__.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/kvmd/apps/vnc/__init__.py b/kvmd/apps/vnc/__init__.py
index 07be2abd..7aeb283e 100644
--- a/kvmd/apps/vnc/__init__.py
+++ b/kvmd/apps/vnc/__init__.py
@@ -24,8 +24,10 @@ from typing import List
from typing import Optional
from ...clients.kvmd import KvmdClient
-from ...clients.streamer import StreamerHttpClient
-from ...clients.streamer import StreamerMemsinkClient
+from ...clients.streamer import StreamFormats
+from ...clients.streamer import BaseStreamerClient
+from ...clients.streamer import HttpStreamerClient
+from ...clients.streamer import MemsinkStreamerClient
from ... import htclient
@@ -46,11 +48,17 @@ def main(argv: Optional[List[str]]=None) -> None:
user_agent = htclient.make_user_agent("KVMD-VNC")
- def make_memsink(name: str) -> Optional[StreamerMemsinkClient]:
+ def make_memsink_streamer(name: str, fmt: int) -> Optional[MemsinkStreamerClient]:
if getattr(config.memsink, name).sink:
- return StreamerMemsinkClient(name=name, **getattr(config.memsink, name)._unpack())
+ return MemsinkStreamerClient(name.upper(), fmt, **getattr(config.memsink, name)._unpack())
return None
+ streamers: List[BaseStreamerClient] = list(filter(None, [
+ make_memsink_streamer("h264", StreamFormats.H264),
+ make_memsink_streamer("jpeg", StreamFormats.JPEG),
+ HttpStreamerClient(name="JPEG", user_agent=user_agent, **config.streamer._unpack()),
+ ]))
+
VncServer(
host=config.server.host,
port=config.server.port,
@@ -65,11 +73,7 @@ def main(argv: Optional[List[str]]=None) -> None:
keymap_path=config.keymap,
kvmd=KvmdClient(user_agent=user_agent, **config.kvmd._unpack()),
- streamers=list(filter(None, [
- make_memsink("h264"),
- make_memsink("jpeg"),
- StreamerHttpClient(name="jpeg", user_agent=user_agent, **config.streamer._unpack()),
- ])),
+ streamers=streamers,
vnc_auth_manager=VncAuthManager(**config.auth.vncauth._unpack()),
**config.server.keepalive._unpack(),