From bdf1fb16783f98c472f7393546b2ab1b8dd495c0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 26 Jul 2023 14:14:36 +0200 Subject: [PATCH] #3750 don't enable gstreamer encoder by default --- fs/etc/xpra/conf.d/30_picture.conf.in | 2 +- xpra/codecs/video_helper.py | 24 ++++++++++++++++-------- xpra/scripts/config.py | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/etc/xpra/conf.d/30_picture.conf.in b/fs/etc/xpra/conf.d/30_picture.conf.in index a546c1cdb8..874ddf3908 100644 --- a/fs/etc/xpra/conf.d/30_picture.conf.in +++ b/fs/etc/xpra/conf.d/30_picture.conf.in @@ -23,7 +23,7 @@ encoding = auto # video-encoders = none # video-encoders = all # video-encoders = all,-x265 -video-encoders = all +video-encoders = all,-gstreamer # Used by both the client and server for colourspace conversion: # csc-modules = swscale, cython, libyuv diff --git a/xpra/codecs/video_helper.py b/xpra/codecs/video_helper.py index 536e702da0..a5054246d0 100755 --- a/xpra/codecs/video_helper.py +++ b/xpra/codecs/video_helper.py @@ -63,6 +63,7 @@ def try_import_modules(prefix:str, *codec_names) -> List[str]: names.append(codec_name) return names + #all the codecs we know about: ALL_VIDEO_ENCODER_OPTIONS : Tuple[str,...] = ("x264", "openh264", "vpx", "x265", "nvenc", "ffmpeg", "nvjpeg", "jpeg", "webp", "gstreamer") HARDWARE_ENCODER_OPTIONS : Tuple[str,...] = ("nvenc", "nvjpeg") @@ -108,23 +109,30 @@ def get_hardware_encoders(names=HARDWARE_ENCODER_OPTIONS): def filt(prefix, name, inlist, all_fn, all_list): #log("filt%s", (prefix, name, inlist, all_fn, all_list)) def ap(v): + if v.startswith("-"): + return "-"+autoprefix(prefix, v[1:]) return autoprefix(prefix, v) def apl(l): return [ap(v) for v in l] - inlist = csvstrl(inlist or ()).split(",") - if "all" in inlist: - inlist = all_fn() - exclist = [x[1:] for x in inlist if x and x.startswith("-")] - inclist = [x for x in inlist if x and not x.startswith("-")] + inlist = [x for x in csvstrl(inlist or ()).split(",") if x.strip()] + while "all" in inlist: + i = inlist.index("all") + inlist = inlist[:i]+all_fn()+inlist[i+1:] + exclist = apl(x[1:] for x in inlist if x and x.startswith("-")) + inclist = apl(x for x in inlist if x and not x.startswith("-")) + if not inclist and exclist: + inclist = apl(all_fn()) lists = exclist + inclist all_list = apl(all_list) unknown = tuple(x for x in lists if ap(x) not in CODEC_TO_MODULE and x.lower()!="none") if unknown: - log.warn("Warning: ignoring unknown %s: %s", name, csv(unknown)) + log.warn(f"Warning: ignoring unknown {name}: "+csv(unknown)) notfound = tuple(x for x in lists if (x and ap(x) not in all_list and x not in unknown and x!="none")) if notfound: - log.warn("Warning: %s not found: %s", name, csv(notfound)) - return apl(x for x in inclist if x not in exclist and x!="none") + log.warn(f"Warning: {name} not found: "+csv(notfound)) + r = apl(x for x in inclist if x not in exclist and x!="none") + #log("filt%s=%s", (prefix, name, inlist, all_fn, all_list), r) + return r VDictEntry = Dict[str,List[str]] diff --git a/xpra/scripts/config.py b/xpra/scripts/config.py index 3023031352..84594631a7 100755 --- a/xpra/scripts/config.py +++ b/xpra/scripts/config.py @@ -1096,7 +1096,7 @@ def get_defaults(): "remote-xpra" : get_remote_run_xpra_scripts(), "encodings" : ["all"], "proxy-video-encoders" : ["none"], - "video-encoders" : ["all"], + "video-encoders" : ["all", "-gstreamer"], "csc-modules" : ["all"], "video-decoders" : ["all"], "speaker-codec" : [],