Skip to content

Commit

Permalink
ensure we initialize all encoders before choosing an encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 9, 2023
1 parent 8b3d31c commit dd80894
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ def append_encoder(self, encoding:str, encode_fn:Callable) -> None:
self._encoders[encoding] = encode_fn

def init_encoders(self) -> None:
self.do_init_encoders()
self.parse_csc_modes(self.encoding_options.dictget("full_csc_modes", default=None))
self.update_encoding_selection(self.encoding, init=True)

def do_init_encoders(self) -> None:
self._all_encoders : Dict[str,List[Callable]] = {}
self._encoders : Dict[str,Callable] = {}
picture_encodings = set()
Expand Down
10 changes: 5 additions & 5 deletions xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def init_vars(self) -> None:
self._video_encoder = None
self._last_pipeline_check = 0

def init_encoders(self) -> None:
super().init_encoders()
def do_init_encoders(self) -> None:
super().do_init_encoders()
self._csc_encoder = None
self._video_encoder = None
self._last_pipeline_check = 0
Expand Down Expand Up @@ -240,9 +240,6 @@ def add(enc, encode_fn):
log(f" non video encodings={self.non_video_encodings}")
if "scroll" in self.server_core_encodings:
add("scroll", self.scroll_encode)
self.supports_scrolling = "scroll" in self.common_encodings or (
#for older clients, we check an encoding option:
"scroll" in self.server_core_encodings and self.encoding_options.boolget("scrolling") and not STRICT_MODE)

def do_set_auto_refresh_delay(self, min_delay, delay) -> None:
super().do_set_auto_refresh_delay(min_delay, delay)
Expand Down Expand Up @@ -443,6 +440,9 @@ def update_encoding_selection(self, encoding=None, exclude=None, init=False) ->
log("update_encoding_options: common_video_encodings=%s, csc_encoder=%s, video_encoder=%s",
self.common_video_encodings, self._csc_encoder, self._video_encoder)
super().update_encoding_selection(encoding, exclude, init)
self.supports_scrolling = "scroll" in self.common_encodings or (
#for older clients, we check an encoding option:
"scroll" in self.server_core_encodings and self.encoding_options.boolget("scrolling") and not STRICT_MODE)

def do_set_client_properties(self, properties : typedict) -> None:
#client may restrict csc modes for specific windows
Expand Down

0 comments on commit dd80894

Please sign in to comment.