def main(): from xpra.platform import init, clean try: init("Loader", "Encoding Info") verbose = "-v" in sys.argv or "--verbose" in sys.argv if verbose: log.enable_debug() load_codecs() print("codecs and csc modules found:") #print("codec_status=%s" % codecs) for name in ALL_CODECS: mod = codecs.get(name, "") f = mod if mod and hasattr(mod, "__file__"): f = mod.__file__ if f.startswith(os.getcwd()): f = f[len(os.getcwd()):] if f.startswith(os.path.sep): f = f[1:] print("* %s : %s" % (name.ljust(20), f)) if mod and verbose: try: if name=="PIL": #special case for PIL which can be used for both encoding and decoding: from xpra.codecs.codec_constants import get_PIL_encodings, get_PIL_decodings e = get_PIL_encodings(mod) print(" ENCODE: %s" % ", ".join(e)) d = get_PIL_decodings(mod) print(" DECODE: %s" % ", ".join(d)) elif name.find("csc")>=0: cs = list(mod.get_input_colorspaces()) for c in list(cs): cs += list(mod.get_output_colorspaces(c)) print(" %s" % ", ".join(list(set(cs)))) elif name.find("enc")>=0 or name.find("dec")>=0: encodings = mod.get_encodings() print(" %s" % ", ".join(encodings)) try: i = mod.get_info() print(" %s" % i) except: pass except Exception as e: print("error getting extra information on %s: %s" % (name, e)) print("") print("codecs versions:") def pver(v): if type(v)==tuple: return ".".join([str(x) for x in v]) elif type(v) in (str, unicode) and v.startswith("v"): return v[1:] return str(v) for name in sorted(codec_versions.keys()): version = codec_versions[name] print("* %s : %s" % (name.ljust(20), pver(version))) finally: #this will wait for input on win32: clean()
def __init__(self, wid, window_alpha, idle_add): load_csc_options() load_video_decoders() self.wid = wid self.idle_add = idle_add self._alpha_enabled = window_alpha self._backing = None self._last_pixmap_data = None self._video_decoder = None self._csc_decoder = None self._decoder_lock = Lock() self._PIL_encodings = get_PIL_decodings(PIL) self.draw_needs_refresh = True self.mmap = None self.mmap_enabled = False
def main(): from xpra.platform import init, clean try: init("Loader", "Encoding Info") verbose = "-v" in sys.argv or "--verbose" in sys.argv if verbose: log.enable_debug() load_codecs() print("codecs and csc modules found:") #print("codec_status=%s" % codecs) for name in ALL_CODECS: mod = codecs.get(name, "") f = mod if mod and hasattr(mod, "__file__"): f = mod.__file__ if f.startswith(os.getcwd()): f = f[len(os.getcwd()):] if f.startswith(os.path.sep): f = f[1:] print("* %s : %s" % (name.ljust(20), f)) if mod and verbose: try: if name == "PIL": #special case for PIL which can be used for both encoding and decoding: from xpra.codecs.codec_constants import get_PIL_encodings, get_PIL_decodings e = get_PIL_encodings(mod) print(" ENCODE: %s" % ", ".join(e)) d = get_PIL_decodings(mod) print(" DECODE: %s" % ", ".join(d)) elif name.find("csc") >= 0: cs = list(mod.get_input_colorspaces()) for c in list(cs): cs += list(mod.get_output_colorspaces(c)) print(" %s" % ", ".join(list(set(cs)))) elif name.find("enc") >= 0 or name.find("dec") >= 0: encodings = mod.get_encodings() print(" %s" % ", ".join(encodings)) except: e = sys.exc_info()[1] print("error getting extra information on %s: %s" % (name, e)) print("") print("codecs versions:") def pver(v): if type(v) == tuple: return ".".join([str(x) for x in v]) elif type(v) in (str, unicode) and v.startswith("v"): return v[1:] return str(v) for name in sorted(codec_versions.keys()): version = codec_versions[name] print("* %s : %s" % (name.ljust(20), pver(version))) finally: #this will wait for input on win32: clean()