Skip to content

Commit

Permalink
remove vp9 from the "problematic" list of encodings
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@9275 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 6, 2015
1 parent c9e03cc commit 5923012
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
7 changes: 5 additions & 2 deletions src/xpra/codecs/loader.py
Expand Up @@ -185,6 +185,9 @@ def has_codec(name):
#note: this is just for defining the order of encodings,
#so we have both core encodings (rgb24/rgb32) and regular encodings (rgb) in here:
PREFERED_ENCODING_ORDER = ["h264", "vp8", "png", "png/P", "png/L", "webp", "rgb", "rgb24", "rgb32", "jpeg", "h265", "vp9"]
#now that vp9 is usable, move it up the list, but only on the server,
#(don't make the clients request vp9 since they could be connecting to an old server..)
PREFERED_SERVER_ENCODING_ORDER = ["h264", "vp9", "vp8", "png", "png/P", "png/L", "webp", "rgb", "rgb24", "rgb32", "jpeg", "h265"]

from xpra.net import compression
RGB_COMP_OPTIONS = ["Raw RGB"]
Expand All @@ -208,7 +211,7 @@ def has_codec(name):
"h264" : "H.264 video codec",
"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!)",
"vp9" : "VP9 video codec",
"png" : "Portable Network Graphics (lossless, 24bpp or 32bpp for transparency)",
"png/P" : "Portable Network Graphics (lossy, 8bpp colour)",
"png/L" : "Portable Network Graphics (lossy, 8bpp grayscale)",
Expand All @@ -220,7 +223,7 @@ def has_codec(name):
HELP_ORDER = ("h264", "h265", "vp8", "vp9", "png", "png/P", "png/L", "webp", "rgb", "jpeg")

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


def encodings_help(encodings):
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/server/server_base.py
Expand Up @@ -31,7 +31,7 @@
from xpra.child_reaper import reaper_cleanup
from xpra.scripts.config import python_platform, parse_bool_or_int
from xpra.scripts.main import sound_option
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, load_codecs, codec_versions, has_codec, get_codec
from xpra.codecs.loader import PREFERED_SERVER_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, load_codecs, 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 @@ -289,7 +289,7 @@ def add_encodings(encodings):
self.encodings = encs
self.core_encodings = core_encs
self.lossless_encodings = [x for x in self.core_encodings if (x.startswith("png") or x.startswith("rgb") or x=="webp")]
pref = [x for x in PREFERED_ENCODING_ORDER if x in self.encodings]
pref = [x for x in PREFERED_SERVER_ENCODING_ORDER if x in self.encodings]
if pref:
self.default_encoding = pref[0]
else:
Expand Down
4 changes: 4 additions & 0 deletions src/xpra/server/source.py
Expand Up @@ -883,6 +883,10 @@ def fadeout():
elif action=="new-sequence":
self.sound_source_sequence = int(args[0])
return "new sequence is %s" % self.sound_source_sequence
elif action=="sync":
self.sound_sync = int(args[0])
log.info("sound sync set to %s", self.sound_sync)
return "sound sync set to %s" % self.sound_sync
#elif action=="quality":
# assert self.sound_source
# quality = args[0]
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/server/window_source.py
Expand Up @@ -45,7 +45,7 @@
from xpra.server.region import rectangle, add_rectangle, remove_rectangle #@UnresolvedImport
from xpra.codecs.xor.cyxor import xor_str #@UnresolvedImport
from xpra.server.picture_encode import webp_encode, rgb_encode, PIL_encode, mmap_encode, mmap_send
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, get_codec
from xpra.codecs.loader import PREFERED_SERVER_ENCODING_ORDER, get_codec
from xpra.codecs.codec_constants import LOSSY_PIXEL_FORMATS, get_PIL_encodings
from xpra.net import compression

Expand Down Expand Up @@ -553,7 +553,7 @@ def update_encoding_selection(self, encoding=None):
common_encodings.append("rgb")
if self.webp_leaks and "webp" in common_encodings:
common_encodings.remove("webp")
self.common_encodings = [x for x in PREFERED_ENCODING_ORDER if x in common_encodings]
self.common_encodings = [x for x in PREFERED_SERVER_ENCODING_ORDER if x in common_encodings]
if not self.common_encodings:
raise Exception("no common encodings found (server: %s vs client: %s)" % (", ".join(self._encoders.keys()), ", ".join(self.core_encodings)))
#ensure the encoding chosen is supported by this source:
Expand Down
8 changes: 4 additions & 4 deletions src/xpra/server/window_video_source.py
Expand Up @@ -13,7 +13,7 @@
TransientCodecException, RGB_FORMATS, PIXEL_SUBSAMPLING, LOSSY_PIXEL_FORMATS
from xpra.server.window_source import WindowSource, STRICT_MODE, AUTO_REFRESH_SPEED, AUTO_REFRESH_QUALITY
from xpra.server.video_subregion import VideoSubregion
from xpra.codecs.loader import PREFERED_ENCODING_ORDER
from xpra.codecs.loader import PREFERED_SERVER_ENCODING_ORDER
from xpra.util import updict
from xpra.log import Logger

Expand Down Expand Up @@ -87,7 +87,7 @@ def init_encoders(self):
#these are used for non-video areas, ensure "jpeg" is used if available
#as we may be dealing with large areas still, and we want speed:
nv_common = (set(self.server_core_encodings) & set(self.core_encodings)) - set(self.video_encodings)
self.non_video_encodings = [x for x in PREFERED_ENCODING_ORDER if x in nv_common]
self.non_video_encodings = [x for x in PREFERED_SERVER_ENCODING_ORDER if x in nv_common]

#those two instances should only ever be modified or accessed from the encode thread:
self._csc_encoder = None
Expand Down Expand Up @@ -285,7 +285,7 @@ def do_set_client_properties(self, properties):
WindowSource.do_set_client_properties(self, properties)
#encodings may have changed, so redo this:
nv_common = (set(self.server_core_encodings) & set(self.core_encodings)) - set(self.video_encodings)
self.non_video_encodings = [x for x in PREFERED_ENCODING_ORDER if x in nv_common]
self.non_video_encodings = [x for x in PREFERED_SERVER_ENCODING_ORDER if x in nv_common]
log("do_set_client_properties(%s) csc_modes=%s, full_csc_modes=%s, video_scaling=%s, video_subregion=%s, uses_swscale=%s, non_video_encodings=%s, scaling_control=%s", properties, self.csc_modes, self.full_csc_modes, self.supports_video_scaling, self.supports_video_subregion, self.uses_swscale, self.non_video_encodings, self.scaling_control)

def get_best_encoding_impl_default(self):
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def video_encode(self, encoding, image, options):
fallback_encodings = set(self._encoders.keys()) - set(self.video_encodings) - set(["mmap"])
log.error("BUG: failed to setup a video pipeline for %s encoding with source format %s, will fallback to: %s", encoding, src_format, ", ".join(list(fallback_encodings)))
assert len(fallback_encodings)>0
fallback_encoding = [x for x in PREFERED_ENCODING_ORDER if x in fallback_encodings][0]
fallback_encoding = [x for x in PREFERED_SERVER_ENCODING_ORDER if x in fallback_encodings][0]
return self._encoders[fallback_encoding](fallback_encoding, image, options)
assert self._video_encoder

Expand Down

0 comments on commit 5923012

Please sign in to comment.