diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-27 14:55:55 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-31 13:12:04 +0400 |
commit | 8f72ada3fa191fca7a455d1e40d455a6fecf9bcc (patch) | |
tree | d5581c94cd7bc52d52fa17329969da90b117dc26 | |
parent | f84431375a4809b9ca570f3f126a804134488d71 (diff) |
audio: fix deprecation warning
Use a private function to avoid the spice_audio_new() deprecation
warning.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
-rw-r--r-- | src/spice-audio-priv.h | 3 | ||||
-rw-r--r-- | src/spice-audio.c | 39 | ||||
-rw-r--r-- | src/spice-session.c | 4 |
3 files changed, 28 insertions, 18 deletions
diff --git a/src/spice-audio-priv.h b/src/spice-audio-priv.h index f108059..04123f5 100644 --- a/src/spice-audio-priv.h +++ b/src/spice-audio-priv.h @@ -29,6 +29,9 @@ struct _SpiceAudioPrivate { GMainContext *main_context; }; +SpiceAudio *spice_audio_new_priv(SpiceSession *session, GMainContext *context, + const char *name); + void spice_audio_get_playback_volume_info_async(SpiceAudio *audio, GCancellable *cancellable, SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data); gboolean spice_audio_get_playback_volume_info_finish(SpiceAudio *audio, GAsyncResult *res, diff --git a/src/spice-audio.c b/src/spice-audio.c index c514d30..7dc6a24 100644 --- a/src/spice-audio.c +++ b/src/spice-audio.c @@ -232,22 +232,9 @@ gboolean spice_audio_get_record_volume_info_finish(SpiceAudio *audio, res, mute, nchannels, volume, error); } -/** - * spice_audio_new: - * @session: the #SpiceSession to connect to - * @context: (allow-none): a #GMainContext to attach to (or %NULL for - * default). - * @name: (allow-none): a name for the audio channels (or %NULL for - * application name). - * - * Once instantiated, #SpiceAudio will handle the playback and record - * channels to stream to your local audio system. - * - * Returns: a new #SpiceAudio instance or %NULL if no backend or failed. - * Deprecated: 0.8: Use spice_audio_get() instead - **/ -SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context, - const char *name) +G_GNUC_INTERNAL +SpiceAudio *spice_audio_new_priv(SpiceSession *session, GMainContext *context, + const char *name) { SpiceAudio *self = NULL; @@ -272,3 +259,23 @@ SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context, return self; } + +/** + * spice_audio_new: + * @session: the #SpiceSession to connect to + * @context: (allow-none): a #GMainContext to attach to (or %NULL for + * default). + * @name: (allow-none): a name for the audio channels (or %NULL for + * application name). + * + * Once instantiated, #SpiceAudio will handle the playback and record + * channels to stream to your local audio system. + * + * Returns: a new #SpiceAudio instance or %NULL if no backend or failed. + * Deprecated: 0.8: Use spice_audio_get() instead + **/ +SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context, + const char *name) +{ + return spice_audio_new_priv(session, context, name); +} diff --git a/src/spice-session.c b/src/spice-session.c index 3f450d9..66376ff 100644 --- a/src/spice-session.c +++ b/src/spice-session.c @@ -33,7 +33,7 @@ #include "wocky-http-proxy.h" #include "spice-uri-priv.h" #include "channel-playback-priv.h" -#include "spice-audio.h" +#include "spice-audio-priv.h" struct channel { SpiceChannel *channel; @@ -2648,7 +2648,7 @@ SpiceAudio *spice_audio_get(SpiceSession *session, GMainContext *context) g_mutex_lock(&mutex); self = session->priv->audio_manager; if (self == NULL) { - self = spice_audio_new(session, context, NULL); + self = spice_audio_new_priv(session, context, NULL); session->priv->audio_manager = self; } g_mutex_unlock(&mutex); |