xpra icon
Bug tracker and wiki

Ticket #229: gl-decode-in-UI-thread.patch

File gl-decode-in-UI-thread.patch, 1.5 KB (added by Antoine Martin, 7 years ago)

moves decoding to the UI thread

  • xpra/gl/gl_window_backing.py

     
    147147        self.glarea.window.draw_rgb_image(gc, x, y, width, height, gdk.RGB_DITHER_NONE, img_data, rowstride)
    148148
    149149    def do_video_paint(self, coding, img_data, x, y, w, h, options, callbacks):
     150        gobject.idle_add(self.UI_do_video_paint, coding, img_data, x, y, w, h, options, callbacks)
     151
     152    def UI_do_video_paint(self, coding, img_data, x, y, w, h, options, callbacks):
    150153        debug("do_video_paint: options=%s, decoder=%s", options, type(self._video_decoder))
    151154        err, rowstrides, img_data = self._video_decoder.decompress_image_to_yuv(img_data, options)
    152155        csc_pixel_format = options.get("csc_pixel_format", -1)
     
    156159        if not success:
    157160            log.error("do_video_paint: %s decompression error %s on %s bytes of picture data for %sx%s pixels, options=%s",
    158161                      coding, err, len(img_data), w, h, options)
    159             gobject.idle_add(fire_paint_callbacks, callbacks, False)
     162            fire_paint_callbacks(callbacks, False)
    160163            return
    161         gobject.idle_add(self.do_gl_paint, x, y, w, h, img_data, rowstrides, pixel_format, callbacks)
     164        self.do_gl_paint(x, y, w, h, img_data, rowstrides, pixel_format, callbacks)
    162165
    163166    def do_gl_paint(self, x, y, w, h, img_data, rowstrides, pixel_format, callbacks):
    164167        #this function runs in the UI thread, no video_decoder lock held