[Spice-devel] RFC spice: Should the input-fps be refreshed regularly?

2015-06-09 Thread Francois Gouget

Spice provides an estimate of the input video fps to the video streaming 
backends. This is done by red_stream_input_fps_timer_cb() in 
red_worker.c which is called 5 seconds after the streaming starts.

That callback contains code so it can be called again:

stream-num_input_frames = 0;
stream-input_fps_timer_start = now;

However the corresponding timer is not rearmed so it is in fact called 
only once. Is that the correct behavior or do we want the input_fps 
field to be refreshed regularly?

For video the framerate tends to be pretty constant so calculating it 
once could be sufficient. But maybe there are other cases where we would 
want more up to date information. Games maybe?


-- 
Francois Gouget fgou...@codeweavers.com
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] RFC spice: Should the input-fps be refreshed regularly?

2015-06-09 Thread Marc-André Lureau
Hi

- Original Message -
 
 Spice provides an estimate of the input video fps to the video streaming
 backends. This is done by red_stream_input_fps_timer_cb() in
 red_worker.c which is called 5 seconds after the streaming starts.
 
 That callback contains code so it can be called again:
 
 stream-num_input_frames = 0;
 stream-input_fps_timer_start = now;
 
 However the corresponding timer is not rearmed so it is in fact called
 only once. Is that the correct behavior or do we want the input_fps
 field to be refreshed regularly?
 
 For video the framerate tends to be pretty constant so calculating it
 once could be sufficient. But maybe there are other cases where we would
 want more up to date information. Games maybe?

I think it should compute it regularly. Also, there is no need for a timer for 
that,
it could just check after each update, and update the average over time, or 
check
after N seconds have passed how many frames went in the stream (without timers).
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel