Skip to content

Commit

Permalink
improve pipeline setup error logging
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@11073 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 28, 2015
1 parent d418813 commit 1790091
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from xpra.server.window.region import merge_all #@UnresolvedImport
from xpra.server.window.video_subregion import VideoSubregion
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, EDGE_ENCODING_ORDER
from xpra.util import updict, parse_scaling_value
from xpra.util import updict, parse_scaling_value, engs
from xpra.log import Logger

log = Logger("video", "encoding")
Expand Down Expand Up @@ -1146,6 +1146,9 @@ def setup_pipeline(self, scores, width, height, src_format):
"""
assert width>0 and height>0, "invalid dimensions: %sx%s" % (width, height)
start = time.time()
if len(scores)==0:
log.error("Error: no video pipeline options found for %s at %ix%i", src_format, width, height)
return False
log("setup_pipeline%s", (scores, width, height, src_format))
for option in scores:
try:
Expand All @@ -1164,7 +1167,11 @@ def setup_pipeline(self, scores, width, height, src_format):
self.do_csc_encoder_clean()
self.do_video_encoder_clean()
end = time.time()
log.error("setup_pipeline(..) failed! took %.2fms", (end-start)*1000.0)
log("setup_pipeline(..) failed! took %.2fms", (end-start)*1000.0)
log.error("Error: failed to setup a video pipeline for %s at %ix%i", src_format, width, height)
log.error(" tried the following option%s", engs(scores))
for option in scores:
log.error(" %s", option)
return False

def setup_pipeline_option(self, width, height, src_format,
Expand Down Expand Up @@ -1266,7 +1273,8 @@ def video_encode(self, encoding, image, options):
log.error(" supported CSC modes: %s", ", ".join(supported_csc_modes))
log.error(" supported encoders: %s", ", ".join(encoder_types))
log.error(" encoders CSC modes: %s", ", ".join(ecsc))
log.error(" force csc: %s, mode: %s", FORCE_CSC, FORCE_CSC_MODE)
if FORCE_CSC:
log.error(" forceed csc mode: %s", FORCE_CSC_MODE)
#find one that is not video:
fallback_encodings = [x for x in PREFERED_ENCODING_ORDER if (x in self.non_video_encodings and x in self._encoders and x!="mmap")]
if not fallback_encodings:
Expand Down

0 comments on commit 1790091

Please sign in to comment.