diff options
author | Victor Toso <me@victortoso.com> | 2020-03-17 15:28:48 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2020-03-17 15:33:20 +0000 |
commit | 9136c639a23bce9587dc3d0f785a53672933b9c7 (patch) | |
tree | e5df318d516668203b66e9a60a7af5d16517cb54 | |
parent | 734582ed99c5a6dd8ddc60c77f669c82f2e5e266 (diff) |
sound: remove celt support
Follow up of spice-protocol's deprecation of celt mode.
See: https://gitlab.freedesktop.org/spice/spice-protocol/-/merge_requests/15
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | meson.build | 3 | ||||
-rw-r--r-- | meson_options.txt | 5 | ||||
-rw-r--r-- | server/sound.c | 23 |
4 files changed, 6 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am index 78b4dd78..448332b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,6 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = spice-server.pc DISTCHECK_CONFIGURE_FLAGS = \ - --disable-celt051 \ --enable-smartcard \ --with-sasl \ --enable-manual \ diff --git a/meson.build b/meson.build index 293ee12e..1685c077 100644 --- a/meson.build +++ b/meson.build @@ -112,8 +112,7 @@ endif # # Non-mandatory/optional dependencies # -optional_deps = {'celt051' : '>= 0.5.1.1', - 'opus' : '>= 0.9.14'} +optional_deps = {'opus' : '>= 0.9.14'} foreach dep, version : optional_deps d = dependency(dep, required : get_option(dep), version : version) if d.found() diff --git a/meson_options.txt b/meson_options.txt index f8a1e95e..36d39e01 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,11 +13,6 @@ option('sasl', value : true, description : 'Use cyrus SASL authentication') -option('celt051', - type : 'feature', - value : 'disabled', - description: 'Enable celt051 audio codec') - option('opus', type : 'feature', description: 'Enable Opus audio codec') diff --git a/server/sound.c b/server/sound.c index c952ffc5..a1358b1e 100644 --- a/server/sound.c +++ b/server/sound.c @@ -333,12 +333,14 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s static const char* spice_audio_data_mode_to_string(gint mode) { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS static const char * const str[] = { [ SPICE_AUDIO_DATA_MODE_INVALID ] = "invalid", [ SPICE_AUDIO_DATA_MODE_RAW ] = "raw", [ SPICE_AUDIO_DATA_MODE_CELT_0_5_1 ] = "celt", [ SPICE_AUDIO_DATA_MODE_OPUS ] = "opus", }; + G_GNUC_END_IGNORE_DEPRECATIONS if (mode >= 0 && mode < G_N_ELEMENTS(str)) { return str[mode]; } @@ -1014,7 +1016,7 @@ void snd_set_playback_latency(RedClient *client, uint32_t latency) } static int snd_desired_audio_mode(bool playback_compression, int frequency, - bool client_can_celt, bool client_can_opus) + bool client_can_opus) { if (!playback_compression) return SPICE_AUDIO_DATA_MODE_RAW; @@ -1022,9 +1024,6 @@ static int snd_desired_audio_mode(bool playback_compression, int frequency, if (client_can_opus && snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_OPUS, frequency)) return SPICE_AUDIO_DATA_MODE_OPUS; - if (client_can_celt && snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_CELT_0_5_1, frequency)) - return SPICE_AUDIO_DATA_MODE_CELT_0_5_1; - return SPICE_AUDIO_DATA_MODE_RAW; } @@ -1065,14 +1064,11 @@ playback_channel_client_constructed(GObject *object) scc->on_message_done = snd_playback_on_message_done; - bool client_can_celt = red_channel_client_test_remote_cap(rcc, - SPICE_PLAYBACK_CAP_CELT_0_5_1); bool client_can_opus = red_channel_client_test_remote_cap(rcc, SPICE_PLAYBACK_CAP_OPUS); bool playback_compression = reds_config_get_playback_compression(red_channel_get_server(red_channel)); - int desired_mode = snd_desired_audio_mode(playback_compression, channel->frequency, - client_can_celt, client_can_opus); + int desired_mode = snd_desired_audio_mode(playback_compression, channel->frequency, client_can_opus); if (desired_mode != SPICE_AUDIO_DATA_MODE_RAW) { if (snd_codec_create(&playback_client->codec, desired_mode, channel->frequency, SND_CODEC_ENCODE) == SND_CODEC_OK) { @@ -1381,9 +1377,6 @@ playback_channel_constructed(GObject *object) G_OBJECT_CLASS(playback_channel_parent_class)->constructed(object); - if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_CELT_0_5_1, SND_CODEC_ANY_FREQUENCY)) { - red_channel_set_cap(RED_CHANNEL(self), SPICE_PLAYBACK_CAP_CELT_0_5_1); - } red_channel_set_cap(RED_CHANNEL(self), SPICE_PLAYBACK_CAP_VOLUME); add_channel(self); @@ -1430,9 +1423,6 @@ record_channel_constructed(GObject *object) G_OBJECT_CLASS(record_channel_parent_class)->constructed(object); - if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_CELT_0_5_1, SND_CODEC_ANY_FREQUENCY)) { - red_channel_set_cap(RED_CHANNEL(self), SPICE_RECORD_CAP_CELT_0_5_1); - } red_channel_set_cap(RED_CHANNEL(self), SPICE_RECORD_CAP_VOLUME); add_channel(self); @@ -1497,12 +1487,9 @@ void snd_set_playback_compression(bool on) if (type == SPICE_CHANNEL_PLAYBACK && client) { PlaybackChannelClient* playback = PLAYBACK_CHANNEL_CLIENT(client); RedChannelClient *rcc = RED_CHANNEL_CLIENT(playback); - bool client_can_celt = red_channel_client_test_remote_cap(rcc, - SPICE_PLAYBACK_CAP_CELT_0_5_1); bool client_can_opus = red_channel_client_test_remote_cap(rcc, SPICE_PLAYBACK_CAP_OPUS); - int desired_mode = snd_desired_audio_mode(on, now->frequency, - client_can_celt, client_can_opus); + int desired_mode = snd_desired_audio_mode(on, now->frequency, client_can_opus); if (playback->mode != desired_mode) { playback->mode = desired_mode; snd_set_command(client, SND_PLAYBACK_MODE_MASK); |