channel-display: collect and print video stream stats

also prints the number of underflows during a spice-pulse audio playback
spice-pulse: update the playback latency automatically when it changes
channel-playback: provide access to playback properties via the session

Support checking whether an audio playback is active and what its latency
is.
channel-display: video stream quality report

Handle MSG_STREAM_ACTIVIATE_REPORT and send MSGC_STREAM_REPORT
periodically, or when the playback is out of sync.
The patch also updates spice-common submodule.
channel-playback: support SPICE_MSG_PLAYBACK_LATENCY

Add a new property for minimum playback latency. This property is
updated with the value from SPICE_MSG_PLAYBACK_LATENCY.
I also increased the default latency from 100ms to 200ms in order to
be more robust to different bandwidth settings.
The patch also updates spice-common submodule.
spice-pulse: adjust the playback latency when the min-latency property changes

If the current latency is smaller than the new min-latency
value, we cork the playback till the target latency is achieved.

Note: I didn't modify the prebuf configuration and used
pa_stream_prebuf, because pulse updated the prebuf only if
I set both prebuf and tlength to be target_latency*2. Then,
due to the tlength growth, each time the playback latency deviated
from the target latency, an underflow occurred. Since the latency
that is computed by the server is not exact and is based on its
current evaluation of the bit-rate, which is dynamic, it is better not
to change the tlength (in order to avoid unnecessary underflows).
playback: support syncing the playback latency via session
channel-display: trigger re-sync of audio playback latency when there are frequent video frame drops

This was added in order to respond more quickly when the audio and video playback are
not synchronized, and when the latency between the client and the server
is high (i.e., when the server response to the status is delayed).
Fix GNetworkAddress leak when opening spice session
Fix setting of SPICE_{GLIB,GTK}_REQUIRES

Because of a typo (REQUIRED vs REQUIRES), these variables only
contained the last require that was set rather than a concatenation
of all the needed libraries.
option: Allow multiple options in --disable-effects

Commit 82c367 added checks that the value passed to --disable-effects
is valid, but it does not take into account that it's perfectly valid
to pass multiple values separated by commas. This commit splits
the value passed to --disable-effects and checks each component separatey.

Fixes rhbz#955277
usb-device-manager: Avoid needless re-numeration of usb devs under Linux

libusb_get_device_list() is not exactly a cheap call (lots of sysfs and
usbfs accesses), so it is worth to avoid it where possible.

This patch restores the old (pre win32 support addition) of dealing with
libusb-devices under Linux, it keeps the device from the first lookup
in spice_usb_device_manager_add_dev cached and uses that throughout.

This also means that spice_usb_device_manager_device_to_libdev can no
longer fail under Linux, so no need to error check it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-device-manager: Error check spice_usb_device_manager_device_to_libdev calls

Under Windows all calls to spice_usb_device_manager_device_to_libdev may fail,
so error check them all.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-device-manager: Add spice_usb_device_manager_get_devices_with_filter (fdo#63807)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-device-manager: Fix redirect_on_connect_rules mem-leak

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-device-manager: Fix stray '\n'-s in g_warning calls

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-redir-manager: Fix redirect_on_connect string mem leak

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
main: do not send monitor config if monitor state didn't change

Don't send monitor config after spice_main_set_display_enabled() if the
monitor state didn't change.

This solves monitor "flashing", reconfiguring in a loop:
https://bugzilla.redhat.com/show_bug.cgi?id=952327
widget: don't grab mouse when switching to server mode

spice-gtk used to try taking the grab when switching to server mode, so
that the current mouse interaction (for example a drag), isn't
interrupted if the agent dies. However, shutting down a VM will
automatically try taking the grab when there is no tablet input, and
agent exits.

Some users are complaining about it (especially when they don't know the
ungrab combination).

Instead, let's try to keep the grab only if we have currently a mouse
button pressed.

https://bugzilla.redhat.com/show_bug.cgi?id=873272
main: do not send monitors config if some are missing

Spice-gtk does a bit of client-side work by optionnally delaying sending
the monitor configuration to the guest automatically. However, the
client may be slow to set all the monitors, so teach the timer to not
fire the event unless at least the number of monitors set explicitely
enabled or disabled matches the number of display channels.

This avoid some configuration races when connecting to a multi-channel
display server which is slow to set up.