Skip to content

Commit

Permalink
we have to use video if that's all we have (no non video encodings), …
Browse files Browse the repository at this point in the history
…in 8-bit grayscale mode choose 'png/L', make it easier to distinguish why we went to video_fallback()

git-svn-id: https://xpra.org/svn/Xpra/trunk@26896 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 6, 2020
1 parent f06a56e commit 29ca614
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def check_pipeline_score(self, force_reload):
if self._mmap and self._mmap_size>0:
scorelog("cannot score: mmap enabled")
return
if self.content_type=="text":
if self.content_type=="text" and self.non_video_encodings:
scorelog("no pipelines for 'text' content-type")
return
elapsed = monotonic_time()-self._last_pipeline_check
Expand Down Expand Up @@ -2064,7 +2064,10 @@ def video_fallback(self, image, options, order=None, warn=False):
if warn:
videolog.warn("using non-video fallback encoding")
if self.image_depth==8:
encoding = "png/P"
if self.encoding_is_grayscale():
encoding = "png/L"
else:
encoding = "png/P"
else:
encoding = self.get_video_fallback_encoding(order)
if not encoding:
Expand Down Expand Up @@ -2124,9 +2127,12 @@ def do_video_encode(self, encoding, image, options):
#scroll encoding has dealt with this image
return None

if not self.common_video_encodings or self.image_depth not in (24, 32):
if not self.common_video_encodings:
#we have to send using a non-video encoding as that's all we have!
return self.video_fallback(image, options)
if self.image_depth not in (24, 32):
#this image depth is not supported for video
return self.video_fallback(image, options)

if self.encoding=="grayscale":
from xpra.codecs.csc_libyuv.colorspace_converter import argb_to_gray #@UnresolvedImport
Expand Down

0 comments on commit 29ca614

Please sign in to comment.