[Spice-devel] [PATCH spice-gtk v2 3/5] RecordChannel: Fix introspection method bindings

Matthew Francis mjay.francis at gmail.com
Tue Sep 19 14:33:59 UTC 2017


Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
---
 doc/reference/spice-gtk-sections.txt |  1 +
 src/channel-record.c                 | 19 +++++++++++++++++++
 src/channel-record.h                 |  6 ++++++
 src/map-file                         |  1 +
 src/spice-glib-sym-file              |  1 +
 src/spice-gstaudio.c                 |  2 +-
 src/spice-pulse.c                    |  8 ++++----
 7 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index ffaf00e..538e07c 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -216,6 +216,7 @@ SpiceRecordChannel
 SpiceRecordChannelClass
 <SUBSECTION>
 spice_record_send_data
+spice_record_channel_send_data
 <SUBSECTION Standard>
 SPICE_RECORD_CHANNEL
 SPICE_IS_RECORD_CHANNEL
diff --git a/src/channel-record.c b/src/channel-record.c
index 9834e85..88bdb5c 100644
--- a/src/channel-record.c
+++ b/src/channel-record.c
@@ -312,10 +312,29 @@ static void spice_record_start_mark(SpiceRecordChannel *channel, uint32_t time)
  * @time: stream timestamp
  *
  * Send recorded PCM data to the guest.
+ *
+ * Deprecated: 0.35: use spice_record_channel_send_data() instead.
  **/
 void spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
                             gsize bytes, uint32_t time)
 {
+    spice_record_channel_send_data(channel, data, bytes, time);
+}
+
+/**
+ * spice_record_channel_send_data:
+ * @channel: a #SpiceRecordChannel
+ * @data: PCM data
+ * @bytes: size of @data
+ * @time: stream timestamp
+ *
+ * Send recorded PCM data to the guest.
+ *
+ * Since: 0.35
+ **/
+void spice_record_channel_send_data(SpiceRecordChannel *channel, gpointer data,
+                                    gsize bytes, uint32_t time)
+{
     SpiceRecordChannelPrivate *rc;
     SpiceMsgcRecordPacket p = {0, };
 
diff --git a/src/channel-record.h b/src/channel-record.h
index c851421..5702f40 100644
--- a/src/channel-record.h
+++ b/src/channel-record.h
@@ -73,8 +73,14 @@ struct _SpiceRecordChannelClass {
 };
 
 GType	        spice_record_channel_get_type(void);
+void            spice_record_channel_send_data(SpiceRecordChannel *channel, gpointer data,
+                                               gsize bytes, guint32 time);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_record_channel_send_data)
 void            spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
                                        gsize bytes, guint32 time);
+#endif
 
 G_END_DECLS
 
diff --git a/src/map-file b/src/map-file
index 8635e92..23bcaa5 100644
--- a/src/map-file
+++ b/src/map-file
@@ -99,6 +99,7 @@ spice_port_event;
 spice_port_write_async;
 spice_port_write_finish;
 spice_record_channel_get_type;
+spice_record_channel_send_data;
 spice_record_send_data;
 spice_session_connect;
 spice_session_disconnect;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index d996dbf..10cc245 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -78,6 +78,7 @@ spice_port_event
 spice_port_write_async
 spice_port_write_finish
 spice_record_channel_get_type
+spice_record_channel_send_data
 spice_record_send_data
 spice_session_connect
 spice_session_disconnect
diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
index 715f824..97546b6 100644
--- a/src/spice-gstaudio.c
+++ b/src/spice-gstaudio.c
@@ -175,7 +175,7 @@ static gboolean record_bus_cb(GstBus *bus, GstMessage *msg, gpointer data)
             return TRUE;
         }
 
-        spice_record_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
+        spice_record_channel_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
                                /* FIXME: server side doesn't care about ts?
                                   what is the unit? ms apparently */
                                mapping.data, mapping.size, 0);
diff --git a/src/spice-pulse.c b/src/spice-pulse.c
index 9868251..dcfa71f 100644
--- a/src/spice-pulse.c
+++ b/src/spice-pulse.c
@@ -503,10 +503,10 @@ static void stream_read_callback(pa_stream *s, size_t length, void *data)
         g_return_if_fail(length > 0);
 
         if (p->rchannel != NULL)
-            spice_record_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
-                                   /* FIXME: server side doesn't care about ts?
-                                      what is the unit? ms apparently */
-                                   (gpointer)snddata, length, 0);
+            spice_record_channel_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
+                                           /* FIXME: server side doesn't care about ts?
+                                           what is the unit? ms apparently */
+                                           (gpointer)snddata, length, 0);
 
         if (pa_stream_drop(s) < 0) {
             g_warning("pa_stream_drop() failed: %s",
-- 
2.7.4



More information about the Spice-devel mailing list