[Spice-devel] [spice] gstreamer-encoder: Document get_maximum_frame_size()

Frediano Ziglio fziglio at redhat.com
Wed Jun 12 09:18:29 UTC 2019


> 
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>

Acked

> ---
>  server/gstreamer-encoder.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
> index bccbe0660..110d12981 100644
> --- a/server/gstreamer-encoder.c
> +++ b/server/gstreamer-encoder.c
> @@ -404,6 +404,13 @@ static uint32_t get_average_frame_size(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-devel mailing list