[Spice-commits] 5 commits - gtk/channel-playback.c gtk/spice-channel.c gtk/spice-channel.h gtk/spice-channel-priv.h gtk/spice-gstaudio.c gtk/spice-util.h gtk/spice-widget.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Mon Jun 11 09:11:47 PDT 2012


 gtk/channel-playback.c   |    2 +-
 gtk/spice-channel-priv.h |    8 ++++++--
 gtk/spice-channel.c      |   14 ++++++++------
 gtk/spice-channel.h      |    4 ++++
 gtk/spice-gstaudio.c     |    5 ++++-
 gtk/spice-util.h         |    5 +++--
 gtk/spice-widget.c       |    3 ++-
 7 files changed, 28 insertions(+), 13 deletions(-)

New commits:
commit f15d0fdda1ff74e088db3001532a813ef2a973fa
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Mon Jun 11 18:07:22 2012 +0200

    misc: use g_value_dup_object

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 2ae76d8..d559273 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -219,7 +219,8 @@ static void spice_display_set_property(GObject      *object,
 
     switch (prop_id) {
     case PROP_SESSION:
-        d->session = g_object_ref(g_value_get_object(value));
+        g_warn_if_fail(d->session == NULL);
+        d->session = g_value_dup_object(value);
         d->gtk_session = spice_gtk_session_get(d->session);
         break;
     case PROP_CHANNEL_ID:
commit 2f45d3656ad851aaa784d750578cc4759f593588
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jun 8 11:53:37 2012 +0200

    Fix incorrect format string

diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c
index 1485267..61501c8 100644
--- a/gtk/channel-playback.c
+++ b/gtk/channel-playback.c
@@ -509,7 +509,7 @@ void spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 del
 
     g_return_if_fail(SPICE_IS_PLAYBACK_CHANNEL(channel));
 
-    SPICE_DEBUG("playback set_delay %d ms", delay_ms);
+    SPICE_DEBUG("playback set_delay %u ms", delay_ms);
 
     c = channel->priv;
     spice_session_set_mm_time(spice_channel_get_session(SPICE_CHANNEL(channel)),
commit a8842c3ae4cdc10432ff422932a565fdb41f87b9
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jun 8 11:51:47 2012 +0200

    Fix video playback with GStreamer backend
    
    The playback audio delay is not correctly adjusted, we should take
    min_latency, set by gst_bin_do_latency_func ().

diff --git a/gtk/spice-gstaudio.c b/gtk/spice-gstaudio.c
index 080169b..6dd250e 100644
--- a/gtk/spice-gstaudio.c
+++ b/gtk/spice-gstaudio.c
@@ -279,7 +279,10 @@ static gboolean update_mmtime_timeout_cb(gpointer data)
         gboolean live;
         GstClockTime minlat, maxlat;
         gst_query_parse_latency(q, &live, &minlat, &maxlat);
-        spice_playback_channel_set_delay(SPICE_PLAYBACK_CHANNEL(p->pchannel), GST_TIME_AS_MSECONDS(maxlat));
+        SPICE_DEBUG("got min latency %" GST_TIME_FORMAT ", max latency %"
+                    GST_TIME_FORMAT ", live %d", GST_TIME_ARGS (minlat),
+                    GST_TIME_ARGS (maxlat), live);
+        spice_playback_channel_set_delay(SPICE_PLAYBACK_CHANNEL(p->pchannel), GST_TIME_AS_MSECONDS(minlat));
     }
     gst_query_unref (q);
 
commit ea33f1613057186431c3a552a35cbf7eb12a4d98
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Jun 7 12:17:47 2012 +0200

    Deprecate spice_channel_set_capability()
    
    This was initially public to eventually let a derived class
    implement more capabilities. Even though it is technically
    doable to derive and tweak exisiting channels, there is a
    lack of support in spice-gtk for doing that.

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 56c6e0a..793e36f 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2542,9 +2542,9 @@ static void set_capability(GArray *caps, guint32 cap)
  * @cap: a capability
  *
  * Enable specific channel-kind capability.
+ * Deprecated: 0.13: this function has been removed
  **/
 #undef spice_channel_set_capability
-/* FIXME: we may want to make caps read only from outside */
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap)
 {
     SpiceChannelPrivate *c;
diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h
index 982b73b..30ff1ba 100644
--- a/gtk/spice-channel.h
+++ b/gtk/spice-channel.h
@@ -108,7 +108,11 @@ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd);
 void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent reason);
 gboolean spice_channel_test_capability(SpiceChannel *channel, guint32 cap);
 gboolean spice_channel_test_common_capability(SpiceChannel *channel, guint32 cap);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+SPICE_DEPRECATED
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);
+#endif
 
 const gchar* spice_channel_type_to_string(gint type);
 
diff --git a/gtk/spice-util.h b/gtk/spice-util.h
index 7a617f4..271f3be 100644
--- a/gtk/spice-util.h
+++ b/gtk/spice-util.h
@@ -40,10 +40,11 @@ gulong spice_g_signal_connect_object(gpointer instance,
 #define SPICE_RESERVED_PADDING (10 * sizeof(void*))
 
 #ifndef SPICE_NO_DEPRECATED
-#define SPICE_DEPRECATED_FOR(f) \
-    G_GNUC_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED_FOR(f)  G_GNUC_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED  G_GNUC_DEPRECATED
 #else
 #define SPICE_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED
 #endif
 
 G_END_DECLS
commit 4b8d5813a8d7285509b71739518426f6c5267859
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Jun 7 12:14:19 2012 +0200

    Allow to disable specific capabilities at runtime
    
    Capability BAR for channel FOO can be disabled at runtime by setting
    the SPICE_FOO_CAP_BAR environment variable to '0'
    Disabling capabilities is useful for testing purpose.

diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h
index ac8bece..4f094d8 100644
--- a/gtk/spice-channel-priv.h
+++ b/gtk/spice-channel-priv.h
@@ -174,11 +174,15 @@ void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in);
 gint spice_channel_get_channel_id(SpiceChannel *channel);
 gint spice_channel_get_channel_type(SpiceChannel *channel);
 void spice_channel_swap(SpiceChannel *channel, SpiceChannel *swap);
-void spice_channel_set_common_capability(SpiceChannel *channel, guint32 cap);
 gboolean spice_channel_get_read_only(SpiceChannel *channel);
-
 void spice_channel_reset(SpiceChannel *channel, gboolean migrating);
 
+void spice_caps_set(GArray *caps, guint32 cap, const gchar *desc);
+#define spice_channel_set_common_capability(channel, cap)               \
+    spice_caps_set(SPICE_CHANNEL(channel)->priv->common_caps, cap, #cap)
+#define spice_channel_set_capability(channel, cap)                      \
+    spice_caps_set(SPICE_CHANNEL(channel)->priv->caps, cap, #cap)
+
 /* coroutine context */
 #define emit_main_context(object, event, args...)                       \
     G_STMT_START {                                                      \
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 851fc23..56c6e0a 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2543,6 +2543,7 @@ static void set_capability(GArray *caps, guint32 cap)
  *
  * Enable specific channel-kind capability.
  **/
+#undef spice_channel_set_capability
 /* FIXME: we may want to make caps read only from outside */
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap)
 {
@@ -2555,14 +2556,15 @@ void spice_channel_set_capability(SpiceChannel *channel, guint32 cap)
 }
 
 G_GNUC_INTERNAL
-void spice_channel_set_common_capability(SpiceChannel *channel, guint32 cap)
+void spice_caps_set(GArray *caps, guint32 cap, const gchar *desc)
 {
-    SpiceChannelPrivate *c;
+    g_return_if_fail(caps != NULL);
+    g_return_if_fail(desc != NULL);
 
-    g_return_if_fail(SPICE_IS_CHANNEL(channel));
+    if (g_strcmp0(g_getenv(desc), "0") == 0)
+        return;
 
-    c = channel->priv;
-    set_capability(c->common_caps, cap);
+    set_capability(caps, cap);
 }
 
 G_GNUC_INTERNAL


More information about the Spice-commits mailing list