Skip to content

Commit

Permalink
#4330 add no-gstreamer switch
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Aug 15, 2024
1 parent 0e445bb commit a9a6dc7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions xpra/client/gui/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

display = True
windows = True
gstreamer = True
webcam = True
audio = True
clipboard = True
Expand Down
5 changes: 4 additions & 1 deletion xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ def may_create_user_config(xpra_conf_filename: str = DEFAULT_XPRA_CONF_FILENAME)
"websocket-upgrade" : bool,
"ssh-upgrade" : bool,
"splash" : bool,
"gstreamer" : bool,
# arrays of strings:
"pulseaudio-configure-commands" : list,
"socket-dirs" : list,
Expand Down Expand Up @@ -776,7 +777,7 @@ def may_create_user_config(xpra_conf_filename: str = DEFAULT_XPRA_CONF_FILENAME)
# keep track of the options added since v5,
# so we can generate command lines that work with older supported versions:
OPTIONS_ADDED_SINCE_V5: list[str] = [
"minimal", "dbus",
"minimal", "dbus", "gstreamer",
]
OPTIONS_COMPAT_NAMES: dict[str, str] = {
"--compression_level=": "-z"
Expand Down Expand Up @@ -852,6 +853,7 @@ def may_create_user_config(xpra_conf_filename: str = DEFAULT_XPRA_CONF_FILENAME)
"forward-xdg-open", "modal-windows", "bandwidth-detection",
"ssh-upgrade",
"splash",
"gstreamer",
"printing", "file-transfer", "open-command", "open-files", "open-url", "start-new-commands",
"mmap", "mmap-group", "mdns",
"auth", "vsock-auth", "tcp-auth", "ws-auth", "wss-auth", "ssl-auth", "ssh-auth", "rfb-auth", "quic-auth",
Expand Down Expand Up @@ -1173,6 +1175,7 @@ def get_defaults() -> dict[str, Any]:
"websocket-upgrade" : True,
"ssh-upgrade" : True,
"splash" : None,
"gstreamer" : True,
"pulseaudio-configure-commands" : [" ".join(x) for x in DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS],
"socket-dirs" : unexpand_all(get_socket_dirs()),
"client-socket-dirs" : unexpand_all(get_client_socket_dirs()),
Expand Down
4 changes: 3 additions & 1 deletion xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,8 @@ def impcheck(*modules) -> bool:
from xpra.client.gui import features
features.display = opts.windows
features.windows = opts.windows
features.audio = b(opts.audio) and (bo(opts.speaker) or bo(opts.microphone)) and impcheck("audio")
features.gstreamer = opts.gstreamer
features.audio = features.gstreamer and b(opts.audio) and (bo(opts.speaker) or bo(opts.microphone)) and impcheck("audio")
features.webcam = bo(opts.webcam) and impcheck("codecs")
features.clipboard = b(opts.clipboard) and impcheck("clipboard")
features.notifications = opts.notifications and impcheck("notifications")
Expand All @@ -2015,6 +2016,7 @@ def enforce_client_features() -> None:
enforce_features(features, {
"display": "xpra.client.mixins.display",
"windows": "xpra.client.mixins.windows",
"gstreamer": "gi.repository.Gst,xpra.gstreamer,xpra.codecs.gstreamer",
"webcam": "xpra.client.mixins.webcam",
"audio": "xpra.audio,xpra.client.mixins.audio",
"clipboard": "xpra.clipboard,xpra.client.mixins.clipboard",
Expand Down
6 changes: 6 additions & 0 deletions xpra/scripts/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ def do_parse_cmdline(cmdline, defaults):
defaults.compression_level = 0
defaults.forward_xdg_open = False
defaults.file_transfer = defaults.open_files = defaults.open_url = defaults.printing = "no"
defaults.gstreamer = False
defaults.dbus = False
defaults.dbus_control = "no"
defaults.bandwidth_limit = 0
Expand Down Expand Up @@ -1746,6 +1747,11 @@ def dcsv(v):
dest="backend", default=defaults.backend,
help="Which backend to use for accessing the display."
" Default: '%default'.")
legacy_bool_parse("gstreamer")
group.add_option("--gstreamer", action="store",
dest="gstreamer", default=defaults.gstreamer,
help="Enable GStreamer audio and video support."
" Default: '%default'.")
group.add_option("--env", action="append",
dest="env", default=list(defaults.env or []),
help="Define environment variables which will apply to this process and all subprocesses,"
Expand Down
4 changes: 3 additions & 1 deletion xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def impcheck(*modules) -> bool:
features.notifications = opts.notifications and impcheck("notifications")
features.webcam = b(opts.webcam) and impcheck("codecs")
features.clipboard = b(opts.clipboard) and impcheck("clipboard")
features.audio = b(opts.audio) and impcheck("audio")
features.gstreamer = b(opts.gstreamer) and impcheck("gstreamer")
features.audio = features.gstreamer and b(opts.audio) and impcheck("audio")
features.av_sync = features.audio and b(opts.av_sync)
features.fileprint = b(opts.printing) or b(opts.file_transfer)
features.mmap = b(opts.mmap)
Expand Down Expand Up @@ -341,6 +342,7 @@ def enforce_server_features() -> None:
"mmap": "xpra.net.mmap,xpra.server.mixins.mmap,xpra.server.source.mmap",
"input_devices": "xpra.server.mixins.input,xpra.server.source.input",
"commands": "xpra.server.control_command",
"gstreamer": "gi.repository.Gst,xpra.gstreamer,xpra.codecs.gstreamer",
"dbus": "xpra.dbus,xpra.server.dbus,xpra.server.source.dbus",
"encoding": "xpra.server.mixins.encoding,xpra.server.source.encodings",
"logging": "xpra.server.mixins.logging",
Expand Down
1 change: 1 addition & 0 deletions xpra/server/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
mmap = True
input_devices = True
commands = True
gstreamer = True
dbus = True
encoding = True
logging = True
Expand Down

0 comments on commit a9a6dc7

Please sign in to comment.