diff --git a/src/xpra/client/window_backing_base.py b/src/xpra/client/window_backing_base.py index 8a7e2cf3d8..8d4d8fdaa4 100644 --- a/src/xpra/client/window_backing_base.py +++ b/src/xpra/client/window_backing_base.py @@ -277,8 +277,7 @@ def make_csc(self, src_width, src_height, src_format, continue for spec in specs: if spec.min_w>src_width or spec.min_w>dst_width or \ - spec.max_w=width and self.max_h>=height \ - and self.min_w<=width and self.min_h<=height \ - and self.max_pixels>(width*height) - def __str__(self): return "codec_spec(%s)" % self.__dict__ diff --git a/src/xpra/codecs/enc_x264/encoder.pyx b/src/xpra/codecs/enc_x264/encoder.pyx index 934fbb053c..eac3198da4 100644 --- a/src/xpra/codecs/enc_x264/encoder.pyx +++ b/src/xpra/codecs/enc_x264/encoder.pyx @@ -189,7 +189,7 @@ def get_colorspaces(): def get_spec(encoding, colorspace): assert encoding in get_encodings(), "invalid encoding: %s (must be one of %s" % (encoding, get_encodings()) assert colorspace in COLORSPACES, "invalid colorspace: %s (must be one of %s)" % (colorspace, COLORSPACES.keys()) - #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h, max_pixels + #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h #we can handle high quality and any speed #setup cost is moderate (about 10ms) return codec_spec(Encoder, codec_type=get_type(), encoding=encoding, speed=0, setup_cost=50, width_mask=0xFFFE, height_mask=0xFFFE) diff --git a/src/xpra/codecs/nvenc/encoder.pyx b/src/xpra/codecs/nvenc/encoder.pyx index 82aee97ce2..d91bba94ad 100644 --- a/src/xpra/codecs/nvenc/encoder.pyx +++ b/src/xpra/codecs/nvenc/encoder.pyx @@ -1177,7 +1177,7 @@ def get_runtime_factor(): def get_spec(encoding, colorspace): assert encoding in get_encodings(), "invalid format: %s (must be one of %s" % (format, get_encodings()) assert colorspace in COLORSPACES, "invalid colorspace: %s (must be one of %s)" % (colorspace, COLORSPACES) - #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h, max_pixels + #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h cs = codec_spec(Encoder, codec_type=get_type(), encoding=encoding, quality=80, speed=100, setup_cost=80, cpu_cost=10, gpu_cost=100, #using a hardware encoder for something this small is silly: diff --git a/src/xpra/codecs/vpx/decoder.pyx b/src/xpra/codecs/vpx/decoder.pyx index f73d7d2449..1a03271c72 100644 --- a/src/xpra/codecs/vpx/decoder.pyx +++ b/src/xpra/codecs/vpx/decoder.pyx @@ -100,7 +100,6 @@ def get_colorspaces(): def get_spec(colorspace): assert colorspace in COLORSPACES, "invalid colorspace: %s (must be one of %s)" % (colorspace, COLORSPACES) - #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h, max_pixels #quality: we only handle YUV420P but this is already accounted for by get_colorspaces() based score calculations #setup cost is reasonable (usually about 5ms) return codec_spec(Decoder, codec_type="vp8", setup_cost=40) diff --git a/src/xpra/codecs/vpx/encoder.pyx b/src/xpra/codecs/vpx/encoder.pyx index 81ca6d2c9c..473441d261 100644 --- a/src/xpra/codecs/vpx/encoder.pyx +++ b/src/xpra/codecs/vpx/encoder.pyx @@ -116,7 +116,6 @@ def get_colorspaces(): def get_spec(encoding, colorspace): assert encoding in get_encodings(), "invalid encoding: %s (must be one of %s" % (encoding, get_encodings()) assert colorspace in COLORSPACES, "invalid colorspace: %s (must be one of %s)" % (colorspace, COLORSPACES) - #ratings: quality, speed, setup cost, cpu cost, gpu cost, latency, max_w, max_h, max_pixels #quality: we only handle YUV420P but this is already accounted for by get_colorspaces() based score calculations #setup cost is reasonable (usually about 5ms) return codec_spec(Encoder, codec_type=get_type(), encoding=encoding, setup_cost=40) diff --git a/src/xpra/server/window_video_source.py b/src/xpra/server/window_video_source.py index 6dba030331..ae08371c68 100644 --- a/src/xpra/server/window_video_source.py +++ b/src/xpra/server/window_video_source.py @@ -11,8 +11,12 @@ from xpra.net.protocol import Compressed from xpra.codecs.codec_constants import get_avutil_enum_from_colorspace, get_subsampling_divs, TransientCodecException from xpra.codecs.video_helper import getVideoHelper -from xpra.server.window_source import WindowSource, debug, log +from xpra.server.window_source import WindowSource, log from xpra.server.background_worker import add_work_item +from xpra.log import debug_if_env + +debug = debug_if_env(log, "XPRA_VIDEO_DEBUG") + def envint(name, d): try: @@ -160,7 +164,7 @@ def set_client_properties(self, properties): self.video_scaling = properties.get("encoding.video_scaling", self.video_scaling) self.uses_swscale = properties.get("encoding.uses_swscale", self.uses_swscale) WindowSource.set_client_properties(self, properties) - log("set_client_properties(%s) csc_modes=%s, video_scaling=%s, uses_swscale=%s", properties, self.csc_modes, self.video_scaling, self.uses_swscale) + debug("set_client_properties(%s) csc_modes=%s, video_scaling=%s, uses_swscale=%s", properties, self.csc_modes, self.video_scaling, self.uses_swscale) def unmap(self): WindowSource.cancel_damage(self) @@ -408,11 +412,6 @@ def get_score(self, csc_format, csc_spec, encoder_spec, width, height): cost" will be lower for pipelines that share components with the current one. """ - #first discard if we cannot handle this size: - if csc_spec and not csc_spec.can_handle(width, height): - return -1 - if not encoder_spec.can_handle(width, height): - return -1 if self._video_encoder is not None and not self.video_reinit \ and self._video_encoder.get_encoding()==encoder_spec.encoding \ and self._video_encoder.get_type()!=encoder_spec.codec_type: @@ -485,8 +484,6 @@ def get_encoder_dimensions(self, csc_spec, encoder_spec, width, height, scaling= v, u = scaling enc_width = int(width * v / u) & encoder_spec.width_mask enc_height = int(height * v / u) & encoder_spec.height_mask - if not encoder_spec.can_handle(enc_width, enc_height): - return width, height return enc_width, enc_height def calculate_scaling(self, width, height, max_w=4096, max_h=4096):