[Spice-devel] [PATCH 1/3] Spice-session: Add preferred-compression property.
Javier Celaya
javier.celaya at flexvm.es
Fri Apr 17 03:40:23 PDT 2015
Also, depend on the spice-common commit that introduces the
SpiceImageCompress enum.
---
gtk/spice-session.c | 26 ++++++++++++++++++++++++++
spice-common | 2 +-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 020a70e..c83d239 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -117,6 +117,7 @@ struct _SpiceSessionPrivate {
uint32_t n_display_channels;
guint8 uuid[16];
gchar *name;
+ int preferred_compression;
/* associated objects */
SpiceAudio *audio_manager;
@@ -203,6 +204,7 @@ enum {
PROP_SHARE_DIR_RO,
PROP_USERNAME,
PROP_UNIX_PATH,
+ PROP_PREF_COMPRESS,
};
/* signals */
@@ -658,6 +660,9 @@ static void spice_session_get_property(GObject *gobject,
case PROP_SHARE_DIR_RO:
g_value_set_boolean(value, s->share_dir_ro);
break;
+ case PROP_PREF_COMPRESS:
+ g_value_set_int(value, s->preferred_compression);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);
break;
@@ -794,6 +799,9 @@ static void spice_session_set_property(GObject *gobject,
case PROP_SHARE_DIR_RO:
s->share_dir_ro = g_value_get_boolean(value);
break;
+ case PROP_PREF_COMPRESS:
+ s->preferred_compression = g_value_get_int(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);
break;
@@ -1403,6 +1411,24 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:preferred-compression:
+ *
+ * The image compression algorithm the client prefers to use. It is
+ * reported to the server.
+ *
+ * Since: 0.29
+ **/
+ g_object_class_install_property
+ (gobject_class, PROP_PREF_COMPRESS,
+ g_param_spec_int("preferred-compression",
+ "Preferred image compression algorithm",
+ "Preferred image compression algorithm",
+ SPICE_IMAGE_COMPRESS_INVALID, SPICE_IMAGE_COMPRESS_ENUM_END - 1,
+ SPICE_IMAGE_COMPRESS_INVALID,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
g_type_class_add_private(klass, sizeof(SpiceSessionPrivate));
}
diff --git a/spice-common b/spice-common
index 3aad79d..fd0830d 160000
--- a/spice-common
+++ b/spice-common
@@ -1 +1 @@
-Subproject commit 3aad79d9c64e85bc2b474df427ccbedbf6840591
+Subproject commit fd0830d7e9983c04d199f11602e849ae6fc9fde5
--
1.9.3
More information about the Spice-devel
mailing list