Skip to content

Commit

Permalink
#631: try harder to prevent people choosing h265 or vp9
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@7207 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 9, 2014
1 parent 0c94949 commit 86e780c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 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
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, ENCODINGS_HELP, ENCODINGS_TO_NAME, HIDDEN_ENCODINGS
from xpra.log import Logger
log = Logger("tray")

Expand Down Expand Up @@ -543,7 +543,11 @@ def set_encodingsmenuitem(*args):
return encodings

def make_encodingssubmenu(self, handshake_complete=True):
encodings = [x for x in PREFERED_ENCODING_ORDER if x in self.client.get_encodings()]
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]
if not encodings:
#all we have, show the "bad" hidden ones then!
encodings = all_encodings
encodings_submenu = make_encodingsmenu(self.get_current_encoding, self.set_current_encoding, encodings, self.client.server_encodings)
self.popup_menu_workaround(encodings_submenu)
return encodings_submenu
Expand Down
6 changes: 5 additions & 1 deletion src/xpra/codecs/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def has_codec(name):

ENCODINGS_HELP = {
"h264" : "H.264 video codec",
"h265" : "H.265 (HEVC) video codec (slow)",
"h265" : "H.265 (HEVC) video codec (slow and buggy - do not use!)",
"vp8" : "VP8 video codec",
"vp9" : "VP9 video codec (very slow - do not use!)",
"png" : "Portable Network Graphics (lossless, 24bpp or 32bpp for transparency)",
Expand All @@ -204,6 +204,10 @@ 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")


def encodings_help(encodings):
h = []
for e in HELP_ORDER:
Expand Down

0 comments on commit 86e780c

Please sign in to comment.