Skip to content

Commit

Permalink
add "proxy-video-encoders" so we can more easily configure which vide…
Browse files Browse the repository at this point in the history
…o-encoders will be claimed by the proxy server (defaults to none)

git-svn-id: https://xpra.org/svn/Xpra/trunk@13861 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 25, 2016
1 parent 875ce71 commit a2d2ee1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
7 changes: 7 additions & 0 deletions src/etc/xpra/conf.d/65_proxy.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@

# Can the proxy start new sessions on demand?
proxy-start-sessions = True

# The video encoders that the proxy will claim:
# (so the video encoding will happen in the proxy process
# for these encoders)
#proxy-video-encoders = nvenc7
#proxy-video-encoders = all
proxy-video-encoders =
2 changes: 2 additions & 0 deletions src/xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def read_xpra_defaults():
"socket-dirs" : list,
"remote-xpra" : list,
"encodings" : list,
"proxy-video-encoders" : list,
"video-encoders" : list,
"csc-modules" : list,
"video-decoders" : list,
Expand Down Expand Up @@ -720,6 +721,7 @@ def addtrailingslash(v):
"socket-dirs" : [],
"remote-xpra" : get_remote_run_xpra_scripts(),
"encodings" : ["all"],
"proxy-video-encoders" : [],
"video-encoders" : ["all"],
"csc-modules" : ["all"],
"video-decoders" : ["all"],
Expand Down
19 changes: 10 additions & 9 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ def do_parse_cmdline(cmdline, defaults):
usage="\n" + "".join(command_options))
hidden_options = {
"display" : defaults.display,
"wm_name" : defaults.wm_name,
"download_path" : defaults.download_path,
"wm-name" : defaults.wm_name,
"download-path" : defaults.download_path,
}
def replace_option(oldoption, newoption):
do_replace_option(cmdline, oldoption, newoption)
Expand Down Expand Up @@ -378,11 +378,11 @@ def ignore(defaults):
ignore({"lpadmin" : defaults.lpadmin,
"lpinfo" : defaults.lpinfo})
#options without command line equivallents:
hidden_options["pdf_printer"] = defaults.pdf_printer
hidden_options["postscript_printer"] = defaults.postscript_printer
hidden_options["file_size_limit"] = defaults.file_size_limit
hidden_options["open_command"] = defaults.open_command
hidden_options["open_files"] = defaults.open_files
hidden_options["pdf-printer"] = defaults.pdf_printer
hidden_options["postscript-printer"] = defaults.postscript_printer
hidden_options["file-size-limit"] = defaults.file_size_limit
hidden_options["open-command"] = defaults.open_command
hidden_options["open-files"] = defaults.open_files

legacy_bool_parse("exit-with-client")
if (supports_server or supports_shadow):
Expand Down Expand Up @@ -597,6 +597,7 @@ def ignore(defaults):
help="Specify which video encoders to enable, to get a list of all the options specify 'help'")
else:
ignore({"video-encoders" : []})
hidden_options["proxy-video-encoders"] = defaults.proxy_video_encoders
group.add_option("--csc-modules", action="store",
dest="csc_modules", default=defaults.csc_modules,
help="Specify which colourspace conversion modules to enable, to get a list of all the options specify 'help'. Default: %default.")
Expand Down Expand Up @@ -693,7 +694,7 @@ def ignore(defaults):
# adds "--no-tray" for platforms that support it
add_client_options(cmdline, group, defaults)
hidden_options["tray"] = True
hidden_options["delay_tray"] = False
hidden_options["delay-tray"] = False
group.add_option("--tray-icon", action="store",
dest="tray_icon", default=defaults.tray_icon,
help="Path to the image which will be used as icon for the system-tray or dock")
Expand Down Expand Up @@ -874,7 +875,7 @@ def ignore(defaults):
#some options are not shown to the user:
for k,v in hidden_options.items():
if not hasattr(options, k):
setattr(options, k, v)
setattr(options, k.replace("-", "_"), v)

#deal with boolean fields by converting them to a boolean value:
for k,t in OPTION_TYPES.items():
Expand Down
8 changes: 4 additions & 4 deletions src/xpra/server/proxy/proxy_instance_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from xpra.codecs.image_wrapper import ImageWrapper
from xpra.codecs.video_helper import getVideoHelper, PREFERRED_ENCODER_ORDER
from xpra.os_util import Queue, SIGNAMES, strtobytes
from xpra.util import flatten_dict, typedict, updict, repr_ellipsized, xor, std, envint, envbool, \
from xpra.util import flatten_dict, typedict, updict, repr_ellipsized, xor, std, envint, envbool, csv, \
LOGIN_TIMEOUT, CONTROL_COMMAND_ERROR, AUTHENTICATION_ERROR, CLIENT_EXIT_TIMEOUT, SERVER_SHUTDOWN
from xpra.version_util import local_version
from xpra.make_thread import start_thread
Expand Down Expand Up @@ -80,8 +80,8 @@ def __init__(self, uid, gid, env_options, session_options, socket_dir,
self.caps = caps
log("ProxyProcess%s", (uid, gid, env_options, session_options, socket_dir,
video_encoder_modules, csc_modules,
client_conn, client_state, cipher, encryption_key, server_conn,
"%s: %s.." % (type(caps), repr_ellipsized(caps)), message_queue))
client_conn, repr_ellipsized(str(client_state)), cipher, encryption_key, server_conn,
"%s: %s.." % (type(caps), repr_ellipsized(str(caps))), message_queue))
self.client_protocol = None
self.server_protocol = None
self.exit = False
Expand Down Expand Up @@ -229,7 +229,7 @@ def run(self):
def video_init(self):
enclog("video_init() loading codecs")
load_codecs(decoders=False)
enclog("video_init() will try video encoders: %s", self.video_encoder_modules)
enclog("video_init() will try video encoders: %s", csv(self.video_encoder_modules) or "none")
self.video_helper = getVideoHelper()
#only use video encoders (no CSC supported in proxy)
self.video_helper.set_modules(video_encoders=self.video_encoder_modules)
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/server/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self):

def init(self, opts):
log("ProxyServer.init(%s)", opts)
self.video_encoders = opts.video_encoders
self.video_encoders = opts.proxy_video_encoders
self.csc_modules = opts.csc_modules
self._start_sessions = opts.proxy_start_sessions
ServerCore.init(self, opts)
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def repr_ellipsized(obj, limit=100):
s = binascii.hexlify(obj)
if len(s)<=limit or limit<=6:
return s
return s[:limit//2-2]+" .. "+s[-limit//2-2:]
return s[:limit//2-2]+" .. "+s[2-limit//2:]
else:
return repr(obj)

Expand Down

0 comments on commit a2d2ee1

Please sign in to comment.