[PATCH spice-gtk v3 4/6] channel-display: Remove playback_sync_drops_seq_len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>

display_handle_stream_data() now has its own mechanism to avoid
dropping frames which does not depend on the playback latency.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 src/channel-display-priv.h  |  2 --
 src/channel-display.c       |  8 --------
 src/channel-playback-priv.h |  1 -
 src/channel-playback.c      |  9 ---------
 src/spice-session-priv.h    |  1 -
 src/spice-session.c         | 15 ---------------
 6 files changed, 36 deletions(-)

diff --git a/src/channel-display-priv.h b/src/channel-display-priv.h
index a1ad3224..5dba669b 100644
--- a/src/channel-display-priv.h
+++ b/src/channel-display-priv.h
@@ -151,8 +151,6 @@ struct display_stream {
     GArray               *drops_seqs_stats_arr;
     uint32_t             num_drops_seqs;
 
-    uint32_t             playback_sync_drops_seq_len;
-
     /* playback quality report to server */
     gboolean report_is_active;
     uint32_t report_id;
diff --git a/src/channel-display.c b/src/channel-display.c
index f57691cd..c0b73c51 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1535,8 +1535,6 @@ static void display_update_stream_report(SpiceDisplayChannel *channel, uint32_t
     }
 }
 
-#define STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT 5
-
 static void display_stream_stats_debug(display_stream *st)
 {
     guint64 drops_duration_total = 0;
@@ -1618,7 +1616,6 @@ static void display_stream_stats_save(display_stream *st,
             st->cur_drops_seq_stats.start_mm_time = frame_mmtime;
         }
         st->cur_drops_seq_stats.len++;
-        st->playback_sync_drops_seq_len++;
         return;
     }
 
@@ -1630,7 +1627,6 @@ static void display_stream_stats_save(display_stream *st,
         memset(&st->cur_drops_seq_stats, 0, sizeof(st->cur_drops_seq_stats));
         st->num_drops_seqs++;
     }
-    st->playback_sync_drops_seq_len = 0;
 }
 
 static SpiceFrame *spice_frame_new(display_stream *st,
@@ -1853,10 +1849,6 @@ static void display_handle_stream_data(SpiceChannel *channel, SpiceMsgIn *in)
     if (c->enable_adaptive_streaming) {
         display_update_stream_report(SPICE_DISPLAY_CHANNEL(channel), op->id,
                                      op->multi_media_time, mmtime_margin);
-        if (st->playback_sync_drops_seq_len >= STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT) {
-            spice_session_sync_playback_latency(spice_channel_get_session(channel));
-            st->playback_sync_drops_seq_len = 0;
-        }
     }
 }
 
diff --git a/src/channel-playback-priv.h b/src/channel-playback-priv.h
index aa33d2c4..dc89e2d8 100644
--- a/src/channel-playback-priv.h
+++ b/src/channel-playback-priv.h
@@ -20,5 +20,4 @@
 
 gboolean spice_playback_channel_is_active(SpicePlaybackChannel *channel);
 guint32 spice_playback_channel_get_latency(SpicePlaybackChannel *channel);
-void spice_playback_channel_sync_latency(SpicePlaybackChannel *channel);
 #endif
diff --git a/src/channel-playback.c b/src/channel-playback.c
index 656a4037..0e439eff 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -495,12 +495,3 @@ guint32 spice_playback_channel_get_latency(SpicePlaybackChannel *channel)
     }
     return channel->priv->latency;
 }
-
-G_GNUC_INTERNAL
-void spice_playback_channel_sync_latency(SpicePlaybackChannel *channel)
-{
-    g_return_if_fail(SPICE_IS_PLAYBACK_CHANNEL(channel));
-    g_return_if_fail(channel->priv->is_active);
-    SPICE_DEBUG("%s: notify latency update %u", __FUNCTION__, channel->priv->min_latency);
-    g_coroutine_object_notify(G_OBJECT(SPICE_CHANNEL(channel)), "min-latency");
-}
diff --git a/src/spice-session-priv.h b/src/spice-session-priv.h
index d88276f1..d0d7be8e 100644
--- a/src/spice-session-priv.h
+++ b/src/spice-session-priv.h
@@ -86,7 +86,6 @@ void spice_session_set_uuid(SpiceSession *session, guint8 uuid[16]);
 void spice_session_set_name(SpiceSession *session, const gchar *name);
 gboolean spice_session_is_playback_active(SpiceSession *session);
 guint32 spice_session_get_playback_latency(SpiceSession *session);
-void spice_session_sync_playback_latency(SpiceSession *session);
 gboolean spice_session_get_audio_enabled(SpiceSession *session);
 gboolean spice_session_get_smartcard_enabled(SpiceSession *session);
 gboolean spice_session_get_usbredir_enabled(SpiceSession *session);
diff --git a/src/spice-session.c b/src/spice-session.c
index e6a96133..04a2da96 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -2660,21 +2660,6 @@ void spice_session_set_name(SpiceSession *session, const gchar *name)
     g_coroutine_object_notify(G_OBJECT(session), "name");
 }
 
-G_GNUC_INTERNAL
-void spice_session_sync_playback_latency(SpiceSession *session)
-{
-    g_return_if_fail(SPICE_IS_SESSION(session));
-
-    SpiceSessionPrivate *s = session->priv;
-
-    if (s->playback_channel &&
-        spice_playback_channel_is_active(s->playback_channel)) {
-        spice_playback_channel_sync_latency(s->playback_channel);
-    } else {
-        SPICE_DEBUG("%s: not implemented when there isn't audio playback", __FUNCTION__);
-    }
-}
-
 G_GNUC_INTERNAL
 gboolean spice_session_is_playback_active(SpiceSession *session)
 {
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]