[Spice-devel] [spice-gtk PATCH v2 6/7] session: get main channel from spice-session

Victor Toso victortoso at redhat.com
Mon Mar 23 06:26:30 PDT 2015


This is necessary in order to use the main-channel in other channels
for instance to playback and record channels to comunicate with the
agent.
---
 gtk/spice-session-priv.h | 1 +
 gtk/spice-session.c      | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/gtk/spice-session-priv.h b/gtk/spice-session-priv.h
index 049973a..de79c51 100644
--- a/gtk/spice-session-priv.h
+++ b/gtk/spice-session-priv.h
@@ -99,6 +99,7 @@ guint spice_session_get_n_display_channels(SpiceSession *session);
 void spice_session_set_main_channel(SpiceSession *session, SpiceChannel *channel);
 gboolean spice_session_set_migration_session(SpiceSession *session, SpiceSession *mig_session);
 SpiceAudio *spice_audio_get(SpiceSession *session, GMainContext *context);
+SpiceChannel *spice_session_get_main_channel(SpiceSession *session);
 G_END_DECLS
 
 #endif /* __SPICE_CLIENT_SESSION_PRIV_H__ */
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 1a68d7d..ec68101 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -2721,3 +2721,10 @@ gboolean spice_session_set_migration_session(SpiceSession *session, SpiceSession
 
     return TRUE;
 }
+
+G_GNUC_INTERNAL
+SpiceChannel *spice_session_get_main_channel(SpiceSession *session)
+{
+    g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE);
+    return session->priv->cmain;
+}
-- 
2.1.0



More information about the Spice-devel mailing list