<div dir="ltr">Hi<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 14, 2015 at 2:18 PM, Victor Toso <span dir="ltr"><<a href="mailto:victortoso@redhat.com" target="_blank">victortoso@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In case of volume-sync between client and guest, we request volume-info<br>
from the availables streams and if the stream is not available we rely<br>
on ext-stream-restore.<br>
<br>
By using ext-stream-restore we can get the last stream data of the<br>
application that is stored by PulseAudio.<br>
<br>
Related: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1012868" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1012868</a><br>
---<br>
 gtk/spice-pulse.c | 412 ++++++++++++++++++++++++++++++++++++++++++++++++++++--<br>
 1 file changed, 403 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c<br>
index c583032..811449d 100644<br>
--- a/gtk/spice-pulse.c<br>
+++ b/gtk/spice-pulse.c<br>
@@ -25,18 +25,31 @@<br>
<br>
 #include <pulse/glib-mainloop.h><br>
 #include <pulse/pulseaudio.h><br>
+#include <pulse/ext-stream-restore.h><br>
<br>
 #define SPICE_PULSE_GET_PRIVATE(obj)                                  \<br>
     (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_PULSE, SpicePulsePrivate))<br>
<br>
+struct async_task {<br>
+    SpicePulse                 *pulse;<br>
+    SpiceMainChannel           *main_channel;<br>
+    GSimpleAsyncResult         *res;<br>
+    GAsyncReadyCallback        callback;<br>
+    gpointer                   user_data;<br>
+    gboolean                   is_playback;<br></blockquote><div><br></div><div>You should track and cancel associated pa_operation when cancelling tasks<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+};<br>
+<br>
 struct stream {<br>
-    pa_sample_spec          spec;<br>
-    pa_stream               *stream;<br>
-    int                     state;<br>
-    pa_operation            *uncork_op;<br>
-    pa_operation            *cork_op;<br>
-    gboolean                started;<br>
-    guint                   num_underflow;<br>
+    pa_sample_spec             spec;<br>
+    pa_stream                  *stream;<br>
+    int                        state;<br>
+    pa_operation               *uncork_op;<br>
+    pa_operation               *cork_op;<br>
+    gboolean                   started;<br>
+    guint                      num_underflow;<br>
+    gboolean                   changed;<br></blockquote><div><br></div><div>It took me a while to understand "changed", perhaps rename it "info_updated" ?<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+    gchar                      *name;<br>
+    pa_ext_stream_restore_info info;<br>
 };<br>
<br>
 struct _SpicePulsePrivate {<br>
@@ -50,6 +63,8 @@ struct _SpicePulsePrivate {<br>
     struct stream           record;<br>
     guint                   last_delay;<br>
     guint                   target_delay;<br>
+    gboolean                restore_stream_info;<br>
+    GList                   *results;<br>
 };<br>
<br>
 G_DEFINE_TYPE(SpicePulse, spice_pulse, SPICE_TYPE_AUDIO)<br>
@@ -77,6 +92,18 @@ static const char *context_state_names[] = {<br>
 static void stream_stop(SpicePulse *pulse, struct stream *s);<br>
 static gboolean connect_channel(SpiceAudio *audio, SpiceChannel *channel);<br>
 static void channel_weak_notified(gpointer data, GObject *where_the_object_was);<br>
+static void pulse_stream_restore_info_async_complete(SpicePulse *pulse,<br>
+        struct async_task *task, const gchar *err_msg);<br></blockquote><div><br></div><div>I would use split it in 2 functions:<br><br>spice_pulse_complete_async_task<br>spice_pulse_complete_all_async_tasks<br><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+static void spice_pulse_get_playback_volume_info_async(SpiceAudio *audio, GCancellable *cancellable,<br>
+        SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data);<br>
+static gboolean spice_pulse_get_playback_volume_info_finish(SpiceAudio *audio, GAsyncResult *res,<br>
+        gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error);<br>
+static void spice_pulse_get_record_volume_info_async(SpiceAudio *audio, GCancellable *cancellable,<br>
+        SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data);<br>
+static gboolean spice_pulse_get_record_volume_info_finish(SpiceAudio *audio,GAsyncResult *res,<br>
+        gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error);<br>
+static void stream_restore_read_cb(pa_context *context,<br>
+        const pa_ext_stream_restore_info *info, int eol, void *userdata);<br>
<br>
 static void spice_pulse_finalize(GObject *obj)<br>
 {<br>
@@ -118,6 +145,15 @@ static void spice_pulse_dispose(GObject *obj)<br>
         pa_operation_unref(p->record.cork_op);<br>
     p->record.cork_op = NULL;<br>
<br>
+    if (p->results != NULL)<br>
+        pulse_stream_restore_info_async_complete(pulse, NULL, "PulseAudio is being dispose");<br>
+<br>
+    if (p-><a href="http://playback.name" target="_blank">playback.name</a>)<br>
+        g_free(p-><a href="http://playback.name" target="_blank">playback.name</a>);<br>
+<br>
+    if (p-><a href="http://record.name" target="_blank">record.name</a>)<br>
+        g_free(p-><a href="http://record.name" target="_blank">record.name</a>);<br>
+<br>
     if (p->pchannel)<br>
         g_object_weak_unref(G_OBJECT(p->pchannel), channel_weak_notified, pulse);<br>
     p->pchannel = NULL;<br>
@@ -140,6 +176,10 @@ static void spice_pulse_class_init(SpicePulseClass *klass)<br>
     SpiceAudioClass *audio_class = SPICE_AUDIO_CLASS(klass);<br>
<br>
     audio_class->connect_channel = connect_channel;<br>
+    audio_class->get_playback_volume_info_async = spice_pulse_get_playback_volume_info_async;<br>
+    audio_class->get_playback_volume_info_finish = spice_pulse_get_playback_volume_info_finish;<br>
+    audio_class->get_record_volume_info_async = spice_pulse_get_record_volume_info_async;<br>
+    audio_class->get_record_volume_info_finish = spice_pulse_get_record_volume_info_finish;<br>
<br>
     gobject_class->finalize = spice_pulse_finalize;<br>
     gobject_class->dispose = spice_pulse_dispose;<br>
@@ -812,18 +852,39 @@ static void context_state_callback(pa_context *c, void *userdata)<br>
<br>
         if (!p->playback.stream && p->playback.started)<br>
             create_playback(SPICE_PULSE(userdata));<br>
+<br>
+        if (p->restore_stream_info == TRUE) {<br>
+            pa_operation *op = pa_ext_stream_restore_read(p->context,<br>
+                                                          stream_restore_read_cb,<br>
+                                                          pulse);<br>
+            if (!op) {<br>
+                pulse_stream_restore_info_async_complete(pulse, NULL,<br>
+                        pa_strerror(pa_context_errno(p->context)));<br>
+            } else {<br>
+                pa_operation_unref(op);<br>
+            }<br>
+        }<br>
         break;<br>
     }<br>
<br>
     case PA_CONTEXT_FAILED:<br>
         g_warning("PulseAudio context failed %s",<br>
                   pa_strerror(pa_context_errno(p->context)));<br>
-        break;<br>
+        goto context_fail;<br>
<br>
     case PA_CONTEXT_TERMINATED:<br>
     default:<br>
         SPICE_DEBUG("PulseAudio context terminated");<br>
-        break;<br>
+        goto context_fail;<br>
+    }<br>
+<br>
+    return;<br>
+<br>
+context_fail:<br>
+    if (p->restore_stream_info == TRUE) {<br>
+        const gchar *errmsg = pa_strerror(pa_context_errno(p->context));<br>
+        errmsg = (errmsg != NULL) ? errmsg : "PulseAudio context terminated";<br>
+        pulse_stream_restore_info_async_complete(pulse, NULL, errmsg);<br>
     }<br>
 }<br>
<br>
@@ -849,9 +910,342 @@ SpicePulse *spice_pulse_new(SpiceSession *session, GMainContext *context,<br>
         goto error;<br>
     }<br>
<br>
+    p-><a href="http://playback.name" target="_blank">playback.name</a> = g_strconcat("sink-input-by-application-name:",<br>
+                                   g_get_application_name(), NULL);<br>
+    p-><a href="http://record.name" target="_blank">record.name</a> = g_strconcat("source-output-by-application-name:",<br>
+                                 g_get_application_name(), NULL);<br>
     return pulse;<br>
<br>
 error:<br>
     g_object_unref(pulse);<br>
     return  NULL;<br>
 }<br>
+<br>
+static void free_async_task(struct async_task *task)<br>
+{<br>
+    if (task == NULL)<br>
+        return;<br>
+<br>
+    if (task->pulse)<br>
+        g_object_unref(task->pulse);<br>
+<br>
+    if (task->res)<br>
+        g_object_unref(task->res);<br>
+<br>
+    if (task->main_channel)<br>
+        g_object_unref(task->main_channel);<br>
+<br>
+    g_free(task);<br>
+}<br>
+<br>
+static void complete_task(SpicePulse *pulse, struct async_task *task, const gchar *err_msg)<br>
+{<br>
+    SpicePulsePrivate *p = pulse->priv;<br>
+<br>
+    /* If we do have any err_msg, we failed */<br>
+    if (err_msg != NULL) {<br>
+        g_simple_async_result_set_op_res_gboolean(task->res, FALSE);<br>
+        g_simple_async_result_set_error(task->res,<br>
+                                        SPICE_CLIENT_ERROR,<br>
+                                        SPICE_CLIENT_ERROR_FAILED,<br>
+                                        "restore-info failed due %s",<br>
+                                        err_msg);<br>
+    /* Volume-info does not change if stream is not found */<br>
+    } else if ((task->is_playback == TRUE && p->playback.changed == FALSE) ||<br>
+               (task->is_playback == FALSE && p->record.changed == FALSE)) {<br>
+        g_simple_async_result_set_op_res_gboolean(task->res, FALSE);<br>
+        g_simple_async_result_set_error(task->res,<br>
+                                        SPICE_CLIENT_ERROR,<br>
+                                        SPICE_CLIENT_ERROR_FAILED,<br>
+                                        "Stream not found by pulse");<br>
+    } else {<br>
+        g_simple_async_result_set_op_res_gboolean(task->res, TRUE);<br>
+    }<br>
+<br>
+    /* As all async calls to PulseAudio are done with glib mainloop, it is<br>
+     * safe to complete the operation synchronously here. */<br>
+    g_simple_async_result_complete(task->res);<br>
+}<br>
+<br>
+static void pulse_stream_restore_info_async_complete(SpicePulse *pulse,<br>
+                                                     struct async_task *task,<br>
+                                                     const gchar *err_msg)<br>
+{<br>
+    SpicePulsePrivate *p = pulse->priv;<br>
+    GList *it;<br>
+<br>
+    /* Only complete this task */<br>
+    if (task != NULL) {<br>
+        complete_task(pulse, task, err_msg);<br>
+        if (p->results != NULL) {<br>
+            p->results = g_list_remove(p->results, task);<br>
+            SPICE_DEBUG("%s Number of async task is %d",<br>
+                        __func__, g_list_length(p->results));<br>
+        }<br>
+        free_async_task(task);<br>
+        return;<br>
+    }<br>
+<br>
+    /* Complete all tasks in list */<br>
+    for(it = p->results; it != NULL; it = it->next) {<br>
+        struct async_task *task = it->data;<br>
+        complete_task(pulse, task, err_msg);<br>
+        free_async_task(task);<br>
+    }<br>
+    g_list_free(p->results);<br>
+    p->results = NULL;<br>
+    p->restore_stream_info = FALSE;<br>
+    SPICE_DEBUG("%s Number of async task is %d", __func__, g_list_length(p->results));<br></blockquote><div><br></div><div>You are using __func__ in many places, I think G_STRFUNC could be better? SPICE_DEBUG() already has G_STRLOC so perhaps not really needed<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+}<br>
+<br>
+static void stream_restore_read_cb(pa_context *context,<br>
+                                   const pa_ext_stream_restore_info *info,<br>
+                                   int eol,<br>
+                                   void *userdata)<br>
+{<br>
+    SpicePulsePrivate *p = SPICE_PULSE(userdata)->priv;<br>
+    struct stream *pstream = NULL;<br>
+<br>
+    if (eol) {<br>
+        pulse_stream_restore_info_async_complete(SPICE_PULSE(userdata), NULL, NULL);<br>
+        return;<br>
+    }<br>
+<br>
+    if (g_strcmp0(info->name, p-><a href="http://playback.name" target="_blank">playback.name</a>) == 0) {<br>
+        pstream = &p->playback;<br>
+    } else if (g_strcmp0(info->name, p-><a href="http://record.name" target="_blank">record.name</a>) == 0) {<br>
+        pstream = &p->record;<br>
+    } else {<br>
+        /* This is not the stream you are looking for. */<br></blockquote><div><br></div><div>g_warn_if_reached() ?<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+        return;<br>
+    }<br>
+<br>
+    if (info->channel_map.channels == 0) {<br>
+        SPICE_DEBUG("%s - Number of channels stored is zero. Ignore. (%s)", __func__, info->name);<br>
+        return;<br>
+    </blockquote><div><br></div><div>What if there is already a playing stream, is this going to reset it to restore value?<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">}<br>
+<br>
+    pstream->changed = TRUE;<br>
+    pstream-><a href="http://info.name" target="_blank">info.name</a> = pstream->name;<br>
+    pstream->info.mute = info->mute;<br>
+    memcpy(&pstream->info.channel_map, &info->channel_map, sizeof(pa_channel_map));<br></blockquote><div><br></div><div>No need for memcpy please: <br>pstream->info.channel_map = info->channel_map;<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+    memcpy(&pstream->info.volume, &info->volume, sizeof(pa_cvolume));<br>
+}<br>
+<br>
+static void source_output_info_cb(pa_context *context,<br>
+                                  const pa_source_output_info *info,<br>
+                                  int eol,<br>
+                                  void *userdata)<br>
+{<br>
+    struct async_task *task = userdata;<br>
+    SpicePulsePrivate *p = task->pulse->priv;<br>
+    struct stream *pstream = &p->record;<br>
+<br>
+    if (eol) {<br>
+        pulse_stream_restore_info_async_complete(task->pulse, task, NULL);<br>
+        return;<br>
+    }<br>
+<br>
+    pstream->changed = TRUE;<br>
+    pstream-><a href="http://info.name" target="_blank">info.name</a> = pstream->name;<br>
+    pstream->info.mute = info->mute;<br>
+    memcpy(&pstream->info.channel_map, &info->channel_map, sizeof(pa_channel_map));<br>
+    memcpy(&pstream->info.volume, &info->volume, sizeof(pa_cvolume));<br>
+}<br>
+<br>
+static void sink_input_info_cb(pa_context *context,<br>
+                               const pa_sink_input_info *info,<br>
+                               int eol,<br>
+                               void *userdata)<br>
+{<br>
+    struct async_task *task = userdata;<br>
+    SpicePulsePrivate *p = task->pulse->priv;<br>
+    struct stream *pstream = &p->playback;<br>
+<br>
+    if (eol) {<br>
+        struct async_task *task = userdata;<br></blockquote><div><br></div><div>already declared above<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+        pulse_stream_restore_info_async_complete(task->pulse, task, NULL);<br>
+        return;<br>
+    }<br>
+<br>
+    pstream->changed = TRUE;<br>
+    pstream-><a href="http://info.name" target="_blank">info.name</a> = pstream->name;<br>
+    pstream->info.mute = info->mute;<br>
+    memcpy(&pstream->info.channel_map, &info->channel_map, sizeof(pa_channel_map));<br>
+    memcpy(&pstream->info.volume, &info->volume, sizeof(pa_cvolume));<br>
+}<br>
+<br>
+/* to avoid code duplication */<br>
+static void pulse_stream_restore_info_async(gboolean is_playback,<br>
+                                            SpiceAudio *audio,<br>
+                                            GCancellable *cancellable,<br>
+                                            SpiceMainChannel *main_channel,<br>
+                                            GAsyncReadyCallback callback,<br>
+                                            gpointer user_data)<br>
+{<br>
+    SpicePulsePrivate *p = SPICE_PULSE(audio)->priv;<br>
+    GSimpleAsyncResult *simple;<br>
+    struct async_task *task = g_malloc(sizeof(struct async_task));<br>
+    pa_operation *op = NULL;<br>
+<br>
+    simple = g_simple_async_result_new(G_OBJECT(audio),<br>
+                                       callback,<br>
+                                       user_data,<br>
+                                       pulse_stream_restore_info_async);<br>
+    g_simple_async_result_set_check_cancellable (simple, cancellable);<br>
+<br>
+    task->res = simple;<br>
+    task->pulse = g_object_ref(audio);<br>
+    task->callback = callback;<br>
+    task->user_data = user_data;<br>
+    task->is_playback = is_playback;<br>
+    task->main_channel = g_object_ref(main_channel);<br>
+<br>
+    /* If Playback/Record stream is created we use pulse API to get volume-info<br>
+     * from those streams directly. If the stream is not created, retrieve last<br>
+     * volume/mute values from Pulse database using the application name; */<br>
+<br>
+    if (is_playback == TRUE &&<br>
+            p->playback.stream != NULL &&<br>
+            pa_stream_get_index(p->playback.stream) != PA_INVALID_INDEX) {<br>
+        SPICE_DEBUG("%s - Playback stream is created - get-sink-input-info", __func__);<br>
+        p->playback.changed = FALSE;<br>
+        op = pa_context_get_sink_input_info(p->context,<br>
+                                            pa_stream_get_index(p->playback.stream),<br>
+                                            sink_input_info_cb,<br>
+                                            task);<br>
+        if (!op)<br>
+            goto fail;<br>
+        pa_operation_unref(op);<br>
+<br>
+    } else if (is_playback == FALSE &&<br>
+            p->record.stream != NULL &&<br>
+            pa_stream_get_index(p->record.stream) != PA_INVALID_INDEX) {<br>
+        SPICE_DEBUG("%s - Record stream is created - get-source-output-info", __func__);<br>
+        p->record.changed = FALSE;<br>
+        op = pa_context_get_source_output_info(p->context,<br>
+                                               pa_stream_get_index(p->record.stream),<br>
+                                               source_output_info_cb,<br>
+                                               task);<br>
+        if (!op)<br>
+            goto fail;<br>
+        pa_operation_unref(op);<br>
+<br>
+    } else if (p->results == NULL) {<br>
+        SPICE_DEBUG("%s - Streams are not created - ext-stream-restore", __func__);<br>
+        p->playback.changed = FALSE;<br>
+        p->record.changed = FALSE;<br>
+        if (p-><a href="http://playback.info.name" target="_blank">playback.info.name</a> != NULL ||<br>
+                p-><a href="http://record.info.name" target="_blank">record.info.name</a> != NULL ||<br>
+                pa_context_get_state(p->context) == PA_CONTEXT_READY) {<br>
+<br>
+            /* Stream is not created. Restore value from pulse db */<br>
+            op = pa_ext_stream_restore_read(p->context, stream_restore_read_cb, audio);<br>
+            if (!op)<br>
+                goto fail;<br>
+            pa_operation_unref(op);<br>
+        } else {<br>
+            /* It is possible that we want to get volume-info before the<br>
+             * context is in READY state. In this case, we wait for the<br>
+             * context state change to READY. */<br>
+            p->restore_stream_info = TRUE;<br>
+        }<br>
+    }<br></blockquote><div><br></div><div>else ? adding a useless task? (if there is already a playback info request, the record will be ignored?)<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+    p->results = g_list_append(p->results, task);<br>
+    SPICE_DEBUG ("%s Number of async task is %d", __func__, g_list_length(p->results));<br>
+    return;<br>
+<br>
+fail:<br>
+    if (!op) {<br>
+        g_simple_async_report_error_in_idle(G_OBJECT(audio),<br>
+                                            callback,<br>
+                                            user_data,<br>
+                                            SPICE_CLIENT_ERROR,<br>
+                                            SPICE_CLIENT_ERROR_FAILED,<br>
+                                            "Volume-Info failed: %s",<br>
+                                            pa_strerror(pa_context_errno(p->context)));<br>
+        free_async_task(task);<br>
+    }<br>
+}<br>
+<br>
+/* to avoid code duplication */<br>
+static gboolean pulse_stream_restore_info_finish(gboolean is_playback,<br>
+                                                 SpiceAudio *audio,<br>
+                                                 GAsyncResult *res,<br>
+                                                 gboolean *mute,<br>
+                                                 guint8 *nchannels,<br>
+                                                 guint16 **volume,<br>
+                                                 GError **error)<br>
+{<br>
+    SpicePulsePrivate *p = SPICE_PULSE(audio)->priv;<br>
+    struct stream *pstream = (is_playback) ? &p->playback : &p->record;<br>
+    GSimpleAsyncResult *simple = (GSimpleAsyncResult *) res;<br>
+<br>
+    g_return_val_if_fail(g_simple_async_result_is_valid(res,<br>
+        G_OBJECT(audio), pulse_stream_restore_info_async), FALSE);<br>
+<br>
+    if (g_simple_async_result_propagate_error(simple, error)) {<br>
+        return FALSE;<br>
+    }<br>
+<br>
+    if (mute != NULL) {<br>
+        *mute = (pstream->info.mute) ? TRUE : FALSE;<br>
+    }<br>
+<br>
+    if (nchannels != NULL) {<br>
+        *nchannels = pstream->info.channel_map.channels;<br>
+    }<br>
+<br>
+    if (volume != NULL) {<br>
+        gint i;<br>
+        *volume = g_new(guint16, pstream->info.channel_map.channels);<br>
+        for (i = 0; i < pstream->info.channel_map.channels; i++) {<br>
+            (*volume)[i] = MIN(pstream->info.volume.values[i], G_MAXUINT16);<br>
+            SPICE_DEBUG("%s (%s) volume at channel %d is %u", __func__,<br>
+                        (is_playback) ? "playback" : "record", i, (*volume)[i]);<br>
+        }<br>
+    }<br>
+<br>
+    return g_simple_async_result_get_op_res_gboolean(simple);<br>
+}<br>
+<br>
+static void spice_pulse_get_playback_volume_info_async(SpiceAudio *audio,<br>
+                                                       GCancellable *cancellable,<br>
+                                                       SpiceMainChannel *main_channel,<br>
+                                                       GAsyncReadyCallback callback,<br>
+                                                       gpointer user_data)<br>
+{<br>
+    pulse_stream_restore_info_async(TRUE, audio, cancellable, main_channel, callback, user_data);<br>
+}<br>
+<br>
+static gboolean spice_pulse_get_playback_volume_info_finish(SpiceAudio *audio,<br>
+                                                            GAsyncResult *res,<br>
+                                                            gboolean *mute,<br>
+                                                            guint8 *nchannels,<br>
+                                                            guint16 **volume,<br>
+                                                            GError **error)<br>
+{<br>
+    return pulse_stream_restore_info_finish(TRUE, audio, res, mute,<br>
+                                            nchannels, volume, error);<br>
+}<br>
+<br>
+static void spice_pulse_get_record_volume_info_async(SpiceAudio *audio,<br>
+                                                     GCancellable *cancellable,<br>
+                                                     SpiceMainChannel *main_channel,<br>
+                                                     GAsyncReadyCallback callback,<br>
+                                                     gpointer user_data)<br>
+{<br>
+    pulse_stream_restore_info_async(FALSE, audio, cancellable, main_channel, callback, user_data);<br>
+}<br>
+<br>
+static gboolean spice_pulse_get_record_volume_info_finish(SpiceAudio *audio,<br>
+                                                          GAsyncResult *res,<br>
+                                                          gboolean *mute,<br>
+                                                          guint8 *nchannels,<br>
+                                                          guint16 **volume,<br>
+                                                          GError **error)<br>
+{<br>
+    return pulse_stream_restore_info_finish(FALSE, audio, res, mute,<br>
+                                            nchannels, volume, error);<br>
+}<br>
<span><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Marc-André Lureau</div>
</div></div>