Skip to content

Commit

Permalink
#631: let the server tell the user about which encodings are problema…
Browse files Browse the repository at this point in the history
…tic rather than hard-coding them

git-svn-id: https://xpra.org/svn/Xpra/trunk@7208 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 9, 2014
1 parent 86e780c commit 3b23f17
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/xpra/client/gtk_base/gtk_tray_menu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from xpra.gtk_common.gtk_util import set_tooltip_text, CheckMenuItem, ensure_item_selected, menuitem
from xpra.client.client_base import EXIT_OK
from xpra.client.gtk_base.about import about, close_about
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, ENCODINGS_HELP, ENCODINGS_TO_NAME, HIDDEN_ENCODINGS
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, ENCODINGS_HELP, ENCODINGS_TO_NAME
from xpra.log import Logger
log = Logger("tray")

Expand Down Expand Up @@ -544,7 +544,7 @@ def set_encodingsmenuitem(*args):

def make_encodingssubmenu(self, handshake_complete=True):
all_encodings = [x for x in PREFERED_ENCODING_ORDER if x in self.client.get_encodings()]
encodings = [x for x in all_encodings if x not in HIDDEN_ENCODINGS]
encodings = [x for x in all_encodings if x not in self.client.server_encodings_problematic]
if not encodings:
#all we have, show the "bad" hidden ones then!
encodings = all_encodings
Expand Down
4 changes: 3 additions & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from xpra.platform.features import MMAP_SUPPORTED, SYSTEM_TRAY_SUPPORTED, CLIPBOARD_WANT_TARGETS, CLIPBOARD_GREEDY, CLIPBOARDS
from xpra.platform.gui import init as gui_init, ready as gui_ready, get_native_notifier_classes, get_native_tray_classes, get_native_system_tray_classes, get_native_tray_menu_helper_classes, ClientExtras
from xpra.codecs.codec_constants import get_PIL_decodings
from xpra.codecs.loader import codec_versions, has_codec, get_codec, PREFERED_ENCODING_ORDER, ALL_NEW_ENCODING_NAMES_TO_OLD, OLD_ENCODING_NAMES_TO_NEW
from xpra.codecs.loader import codec_versions, has_codec, get_codec, PREFERED_ENCODING_ORDER, ALL_NEW_ENCODING_NAMES_TO_OLD, OLD_ENCODING_NAMES_TO_NEW, PROBLEMATIC_ENCODINGS
from xpra.codecs.video_helper import getVideoHelper, NO_GFX_CSC_OPTIONS
from xpra.simple_stats import std_unit
from xpra.net import compression, packet_encoding
Expand Down Expand Up @@ -166,6 +166,7 @@ def __init__(self):
self.server_generic_encodings = False
self.server_encodings = []
self.server_core_encodings = []
self.server_encodings_problematic = PROBLEMATIC_ENCODINGS
self.server_encodings_with_speed = ()
self.server_encodings_with_quality = ()
self.server_encodings_with_lossless = ()
Expand Down Expand Up @@ -1200,6 +1201,7 @@ def getenclist(k, default_value=[]):
self.server_generic_encodings = c.boolget("encoding.generic")
self.server_encodings = getenclist("encodings")
self.server_core_encodings = getenclist("encodings.core", self.server_encodings)
self.server_encodings_problematic = getenclist("encodings.problematic", PROBLEMATIC_ENCODINGS) #server is telling us to try to avoid those
self.server_encodings_with_speed = getenclist("encodings.with_speed", ("h264",)) #old servers only supported x264
self.server_encodings_with_quality = getenclist("encodings.with_quality", ("jpeg", "webp", "h264"))
self.server_encodings_with_lossless_mode = getenclist("encodings.with_lossless_mode", ())
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/codecs/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def has_codec(name):

HELP_ORDER = ("h264", "h265", "vp8", "vp9", "png", "png/P", "png/L", "webp", "rgb", "jpeg")

#those are so useless that we don't want the user to select them by mistake
HIDDEN_ENCODINGS = ("h265", "vp9")
#those are currently so useless that we don't want the user to select them by mistake
PROBLEMATIC_ENCODINGS = ("h265", "vp9")


def encodings_help(encodings):
Expand Down
3 changes: 2 additions & 1 deletion src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from xpra.os_util import thread, get_hex_uuid
from xpra.util import typedict, updict, log_screen_sizes, SERVER_EXIT, SERVER_SHUTDOWN, CLIENT_REQUEST, DETACH_REQUEST, NEW_CLIENT, DONE
from xpra.scripts.config import python_platform
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, codec_versions, has_codec, get_codec
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, codec_versions, has_codec, get_codec
from xpra.codecs.codec_constants import get_PIL_encodings
from xpra.codecs.video_helper import getVideoHelper, ALL_VIDEO_ENCODER_OPTIONS, ALL_CSC_MODULE_OPTIONS
if sys.version > '3':
Expand Down Expand Up @@ -1064,6 +1064,7 @@ def get_encoding_info(self):
"core" : self.core_encodings,
"allowed" : self.allowed_encodings,
"lossless" : self.lossless_encodings,
"problematic" : [x for x in self.core_encodings if x in PROBLEMATIC_ENCODINGS],
"with_speed" : [x for x in self.core_encodings if x in ("h264", "vp8", "vp9", "rgb", "png", "png/P", "png/L")],
"with_quality" : [x for x in self.core_encodings if x in ("jpeg", "webp", "h264", "vp8", "vp9")],
"with_lossless_mode" : self.lossless_mode_encodings}
Expand Down

0 comments on commit 3b23f17

Please sign in to comment.