[Spice-commits] src/channel-display-mjpeg.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 1 10:49:14 UTC 2018


 src/channel-display-mjpeg.c |   25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

New commits:
commit 6c06904b576667bbd8cbfa23433ea07e7daad8c9
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Oct 31 16:27:08 2018 +0000

    mjpeg_decoder_schedule: Remove support for SPICE protocol version 1
    
    Support for protocol version 1 was dropped in commit f77a1d50.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c
index 6f7ded6..83cd391 100644
--- a/src/channel-display-mjpeg.c
+++ b/src/channel-display-mjpeg.c
@@ -92,7 +92,6 @@ static void mjpeg_decoder_schedule(MJpegDecoder *decoder);
 static gboolean mjpeg_decoder_decode_frame(gpointer video_decoder)
 {
     MJpegDecoder *decoder = (MJpegDecoder*)video_decoder;
-    gboolean back_compat = decoder->base.stream->channel->priv->peer_hdr.major_version == 1;
     JDIMENSION width, height;
     uint8_t *dest;
     uint8_t *lines[4];
@@ -109,10 +108,7 @@ static gboolean mjpeg_decoder_decode_frame(gpointer video_decoder)
 
 #ifdef JCS_EXTENSIONS
     // requires jpeg-turbo
-    if (back_compat)
-        decoder->mjpeg_cinfo.out_color_space = JCS_EXT_RGBX;
-    else
-        decoder->mjpeg_cinfo.out_color_space = JCS_EXT_BGRX;
+    decoder->mjpeg_cinfo.out_color_space = JCS_EXT_BGRX;
 #else
 #warning "You should consider building with libjpeg-turbo"
     decoder->mjpeg_cinfo.out_color_space = JCS_RGB;
@@ -153,20 +149,11 @@ static gboolean mjpeg_decoder_decode_frame(gpointer video_decoder)
             uint8_t *s = lines[0];
             uint32_t *d = SPICE_ALIGNED_CAST(uint32_t *, s);
 
-            if (back_compat) {
-                for (unsigned int j = lines_read * width; j > 0; ) {
-                    j -= 1; // reverse order, bad for cache?
-                    d[j] = s[j * 3 + 0] |
-                        s[j * 3 + 1] << 8 |
-                        s[j * 3 + 2] << 16;
-                }
-            } else {
-                for (unsigned int j = lines_read * width; j > 0; ) {
-                    j -= 1; // reverse order, bad for cache?
-                    d[j] = s[j * 3 + 0] << 16 |
-                        s[j * 3 + 1] << 8 |
-                        s[j * 3 + 2];
-                }
+            for (unsigned int j = lines_read * width; j > 0; ) {
+                j -= 1; // reverse order, bad for cache?
+                d[j] = s[j * 3 + 0] << 16 |
+                    s[j * 3 + 1] << 8 |
+                    s[j * 3 + 2];
             }
         }
 #endif


More information about the Spice-commits mailing list