[Spice-commits] server/gstreamer-encoder.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 12 09:10:36 UTC 2019


 server/gstreamer-encoder.c |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 476f19a3c8f1c2428cb0c6ae82896d74518b3328
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue May 21 02:31:03 2019 +0200

    gstreamer-encoder: Document get_maximum_frame_size()
    
    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 5f39ed87..6416b688 100644
--- a/server/gstreamer-encoder.c
+++ b/server/gstreamer-encoder.c
@@ -404,6 +404,13 @@ static uint32_t get_average_frame_size(const SpiceGstEncoder *encoder)
     return encoder->stat_size_sum / count;
 }
 
+/* Look for the largest frame and store it in stat_size_max to reduce how
+ * often we have to scan the history for the largest frame.
+ * Then all we need to keep things consistent is to:
+ * - Update stat_size_max when adding a larger frame to the history.
+ * - Reset stat_size_max to zero when the largest frame falls out of
+ *   the history.
+ */
 static uint32_t get_maximum_frame_size(SpiceGstEncoder *encoder)
 {
     if (encoder->stat_size_max == 0) {


More information about the Spice-commits mailing list