summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc/rfb/encodings.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-01-24 12:02:04 +0300
committerDevaev Maxim <[email protected]>2021-01-24 12:02:04 +0300
commit3a2ffca6b767b9732759100158dbe34eb67a4d6c (patch)
treeda1a25030613b79aa93d61ec9239ae5440df41ec /kvmd/apps/vnc/rfb/encodings.py
parentdc87f8d259b1a1e3dd92569c1548b1b5ea3b9738 (diff)
vnc h264
Diffstat (limited to 'kvmd/apps/vnc/rfb/encodings.py')
-rw-r--r--kvmd/apps/vnc/rfb/encodings.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/kvmd/apps/vnc/rfb/encodings.py b/kvmd/apps/vnc/rfb/encodings.py
index ad83f726..6ecfaa76 100644
--- a/kvmd/apps/vnc/rfb/encodings.py
+++ b/kvmd/apps/vnc/rfb/encodings.py
@@ -39,9 +39,11 @@ class RfbEncodings:
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
))
+ H264 = 0xCAFE0101 # Pi-KVM H264 Encoding
+
@dataclasses.dataclass(frozen=True)
-class RfbClientEncodings:
+class RfbClientEncodings: # pylint: disable=too-many-instance-attributes
encodings: FrozenSet[int]
has_resize: bool = dataclasses.field(default=False)
@@ -52,6 +54,8 @@ class RfbClientEncodings:
has_tight: bool = dataclasses.field(default=False)
tight_jpeg_quality: int = dataclasses.field(default=0)
+ has_h264: bool = dataclasses.field(default=False)
+
def __post_init__(self) -> None:
self.__set("has_resize", (RfbEncodings.RESIZE in self.encodings))
self.__set("has_rename", (RfbEncodings.RENAME in self.encodings))
@@ -61,6 +65,8 @@ class RfbClientEncodings:
self.__set("has_tight", (RfbEncodings.TIGHT in self.encodings))
self.__set("tight_jpeg_quality", self.__get_tight_jpeg_quality())
+ self.__set("has_h264", (RfbEncodings.H264 in self.encodings))
+
def __set(self, key: str, value: Any) -> None:
object.__setattr__(self, key, value)