[Spice-commits] 3 commits - server/gstreamer-encoder.c server/mjpeg-encoder.c server/reds.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 16 07:32:16 UTC 2019


 server/gstreamer-encoder.c |    4 ++--
 server/mjpeg-encoder.c     |    1 -
 server/reds.c              |    5 +++++
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 5ee001a5b060fe693e68f1306ba9404ffa57421a
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu May 16 01:10:32 2019 +0200

    gstreamer-encoder: Include encoding time in get_min_playback_delay()
    
    This way all the minimum delay calculation is in one place and this
    makes gstreamer's implementation closer to the mjpeg one.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
index e319eea2..0ff1201a 100644
--- a/server/gstreamer-encoder.c
+++ b/server/gstreamer-encoder.c
@@ -526,13 +526,13 @@ static uint32_t get_min_playback_delay(SpiceGstEncoder *encoder)
     /* Also factor in the network latency with a margin for jitter. */
     uint32_t net_latency = get_network_latency(encoder) * (1.0 + SPICE_GST_LATENCY_MARGIN);
 
-    return send_time + net_latency;
+    return send_time + net_latency + get_average_encoding_time(encoder) / NSEC_PER_MILLISEC;
 }
 
 static void update_client_playback_delay(SpiceGstEncoder *encoder)
 {
     if (encoder->cbs.update_client_playback_delay) {
-        uint32_t min_delay = get_min_playback_delay(encoder) + get_average_encoding_time(encoder) / NSEC_PER_MILLISEC;
+        uint32_t min_delay = get_min_playback_delay(encoder);
         encoder->cbs.update_client_playback_delay(encoder->cbs.opaque, min_delay);
     }
 }
commit a9c5bb974a12124e1bb263454af17b0222ba2965
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu May 16 01:11:07 2019 +0200

    mjpeg: Remove the unused MJPEG_LOW_FPS_RATE_TH constant
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/mjpeg-encoder.c b/server/mjpeg-encoder.c
index b373e8b7..1400519b 100644
--- a/server/mjpeg-encoder.c
+++ b/server/mjpeg-encoder.c
@@ -38,7 +38,6 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40,
 #define MJPEG_AVERAGE_SIZE_WINDOW 3
 
 #define MJPEG_BIT_RATE_EVAL_MIN_NUM_FRAMES 3
-#define MJPEG_LOW_FPS_RATE_TH 3
 
 #define MJPEG_SERVER_STATUS_EVAL_FPS_INTERVAL 1
 #define MJPEG_SERVER_STATUS_DOWNGRADE_DROP_FACTOR_TH 0.1
commit d09c9b43e0c6df4cab5f673492df8d15ccd79963
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu May 16 01:11:56 2019 +0200

    reds: Enable mm_time adjustments on startup
    
    This reinstates the reds_enable_mm_time() call in do_spice_init()
    that was removed by commit c541d7e29dc0.
    
    We send mm_time adjustments to the client whenever there is no audio
    playback. There is no audio playback on startup. Therefore
    mm_time_enabled must be true on startup. QED.
    
    This fixes adjusting the client mm_time whenever playing a silent
    video (or full desktop stream) when no sound has been played before
    such as when using Xspice, booting an OS with no startup or login
    jingle, or possibly when migrating a VM (per commit 1c154ea5ecc3).
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index d658103e..792e9838 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3570,6 +3570,11 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
     if (!(reds->mig_timer = reds->core.timer_add(&reds->core, migrate_timeout, reds))) {
         spice_error("migration timer create failed");
     }
+    /* Note that this will not actually send the mm_time to the client because
+     * the main channel is not connected yet. This would have been redundant
+     * with the RED_PIPE_ITEM_TYPE_MAIN_INIT message anyway.
+     */
+    reds_enable_mm_time(reds);
 
     if (reds_init_net(reds) < 0) {
         spice_warning("Failed to open SPICE sockets");


More information about the Spice-commits mailing list