[Spice-commits] Branch 'meson_dist' - 5 commits - build-aux/meson-dist Makefile.am meson.build server/sound.cpp subprojects/spice-common
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jun 14 10:36:27 UTC 2021
Rebased ref, commits from common ancestor:
commit ee6c01a235bb81617077b70d0090e4a411368c86
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Sun Jun 13 19:44:19 2021 +0100
build: Remove some useless file from Meson distribution
Remove:
- internal documentation;
- CI files.
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/build-aux/meson-dist b/build-aux/meson-dist
index 80d534fe..7146ad1e 100755
--- a/build-aux/meson-dist
+++ b/build-aux/meson-dist
@@ -14,3 +14,23 @@ fi
# generate tarball version
echo "$1" > "$MESON_DIST_ROOT/.tarball-version"
+
+# remove useless files
+pushd "$MESON_DIST_ROOT"
+find . -name .gitignore -delete
+rm -rf \
+build-aux/useless-if-before-free \
+build-aux/vc-list-files \
+cfg.mk \
+docs/how_to_release.md \
+docs/manual/images/pepper.png \
+docs/Spice_user_manual.odt \
+GNUmakefile \
+.mailmap \
+maint.mk \
+README.Windows.md \
+server/tests/autobahn-check-report \
+server/tests/fuzzingclient.json \
+TODO.multiclient \
+.travis.yml \
+uncrustify_cfg
commit 0219bea62e93b0fd583daca56e028719d696e039
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Sun Jun 13 19:20:57 2021 +0100
build: Improve Meson distribution file
Generate .tarball-version file.
Code from spice-gtk.
Meson 0.49 is required for multiple parameters to meson.add_dist_script.
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/build-aux/meson-dist b/build-aux/meson-dist
new file mode 100755
index 00000000..80d534fe
--- /dev/null
+++ b/build-aux/meson-dist
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+set -o pipefail
+
+if test "$1" = ""; then
+ echo "Version not provided" >&2
+ exit 1
+fi
+if ! test -d "$2"; then
+ echo "Source directory not provided" >&2
+ exit 1
+fi
+
+# generate tarball version
+echo "$1" > "$MESON_DIST_ROOT/.tarball-version"
diff --git a/meson.build b/meson.build
index fa3cfe5b..36e6337a 100644
--- a/meson.build
+++ b/meson.build
@@ -4,10 +4,12 @@
project('spice', 'c', 'cpp',
version : run_command('build-aux/git-version-gen', meson.source_root() + '/.tarball-version', check : true).stdout().strip(),
license : 'LGPLv2.1',
- meson_version : '>= 0.48',
+ meson_version : '>= 0.49',
default_options : ['buildtype=debugoptimized',
'warning_level=2'])
+meson.add_dist_script('build-aux/meson-dist', meson.project_version(), meson.source_root())
+
message('Updating submodules')
run_command('build-aux/meson/check-spice-common', check : true)
commit 6534d72a1e6a39904d4a1ff0f8bdcfbdbcbd7276
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Mon Jun 14 07:21:35 2021 +0100
Update spice-common submodule
This brings in the following changes:
Frediano Ziglio (1):
build: Update Meson requirement to 0.49
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/subprojects/spice-common b/subprojects/spice-common
index bac2aa4e..de79bac8 160000
--- a/subprojects/spice-common
+++ b/subprojects/spice-common
@@ -1 +1 @@
-Subproject commit bac2aa4e2de8535b6f688a0278fba5f618b32a24
+Subproject commit de79bac8e94ce84f4c88719729d59a6f5e3d6bf3
commit cf729077e7f7471669efd30052838e9cc865754e
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Sun Jun 13 19:44:04 2021 +0100
build: Add missing file to Autoconf distribution
Add doxygen.cfg, required to build Doxygen documentation.
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/Makefile.am b/Makefile.am
index f2eb87d5..ec593b5b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,6 +24,7 @@ EXTRA_DIST = \
build-aux/meson/check-spice-common \
CHANGELOG.md \
doxygen.sh \
+ doxygen.cfg \
.version \
$(NULL)
commit cc4d6559b2cedc7cd83e8b7d9389f17ceee9428e
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Mon Jun 14 07:19:42 2021 +0100
sound: Use SpiceAudioDataMode type for audio mode
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau at redhat.com>
diff --git a/server/sound.cpp b/server/sound.cpp
index d976992e..ef6e69d5 100644
--- a/server/sound.cpp
+++ b/server/sound.cpp
@@ -152,7 +152,7 @@ public:
AudioFrame *free_frames = nullptr;
AudioFrame *in_progress = nullptr; /* Frame being sent to the client */
AudioFrame *pending_frame = nullptr; /* Next frame to send to the client */
- uint32_t mode = SPICE_AUDIO_DATA_MODE_RAW;
+ SpiceAudioDataMode mode = SPICE_AUDIO_DATA_MODE_RAW;
uint32_t latency = 0;
SndCodec codec = nullptr;
uint8_t encode_buf[SND_CODEC_MAX_COMPRESSED_BYTES];
@@ -211,7 +211,7 @@ public:
uint32_t samples[RECORD_SAMPLES_SIZE];
uint32_t write_pos = 0;
uint32_t read_pos = 0;
- uint32_t mode = SPICE_AUDIO_DATA_MODE_RAW;
+ SpiceAudioDataMode mode = SPICE_AUDIO_DATA_MODE_RAW;
uint32_t mode_time = 0;
uint32_t start_time = 0;
SndCodec codec = nullptr;
@@ -310,21 +310,23 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
return true;
}
-static
-const char* spice_audio_data_mode_to_string(gint mode)
+static const char*
+spice_audio_data_mode_to_string(SpiceAudioDataMode mode)
{
+ switch (mode) {
+ case SPICE_AUDIO_DATA_MODE_INVALID:
+ return "invalid";
+ case SPICE_AUDIO_DATA_MODE_RAW:
+ return "raw";
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",
- };
+ case SPICE_AUDIO_DATA_MODE_CELT_0_5_1:
+ return "celt";
G_GNUC_END_IGNORE_DEPRECATIONS
- if (mode >= 0 && mode < G_N_ELEMENTS(str)) {
- return str[mode];
+ case SPICE_AUDIO_DATA_MODE_OPUS:
+ return "opus";
+ case SPICE_AUDIO_DATA_MODE_ENUM_END:
+ break;
}
-
return "unknown audio codec";
}
@@ -339,23 +341,23 @@ bool RecordChannelClient::handle_message(uint16_t type, uint32_t size, void *mes
auto msg_mode = (SpiceMsgcRecordMode *)message;
SndChannel *channel = get_channel();
mode_time = msg_mode->time;
- if (msg_mode->mode != SPICE_AUDIO_DATA_MODE_RAW) {
- if (snd_codec_is_capable((SpiceAudioDataMode) msg_mode->mode, channel->frequency)) {
- if (snd_codec_create(&codec, (SpiceAudioDataMode) msg_mode->mode,
+ auto new_mode = static_cast<SpiceAudioDataMode>(msg_mode->mode);
+ if (new_mode != SPICE_AUDIO_DATA_MODE_RAW) {
+ if (snd_codec_is_capable(new_mode, channel->frequency)) {
+ if (snd_codec_create(&codec, new_mode,
channel->frequency, SND_CODEC_DECODE) == SND_CODEC_OK) {
- mode = msg_mode->mode;
+ mode = new_mode;
} else {
red_channel_warning(channel, "create decoder failed");
return false;
}
- }
- else {
+ } else {
red_channel_warning(channel, "unsupported mode %d", mode);
return false;
}
+ } else {
+ mode = new_mode;
}
- else
- mode = msg_mode->mode;
spice_debug("record client %p using mode %s", this,
spice_audio_data_mode_to_string(mode));
@@ -961,8 +963,8 @@ void snd_set_playback_latency(RedClient *client, uint32_t latency)
}
}
-static int snd_desired_audio_mode(bool playback_compression, int frequency,
- bool client_can_opus)
+static SpiceAudioDataMode
+snd_desired_audio_mode(bool playback_compression, int frequency, bool client_can_opus)
{
if (!playback_compression)
return SPICE_AUDIO_DATA_MODE_RAW;
@@ -1002,7 +1004,8 @@ PlaybackChannelClient::PlaybackChannelClient(PlaybackChannel *channel,
bool client_can_opus = test_remote_cap(SPICE_PLAYBACK_CAP_OPUS);
bool playback_compression =
reds_config_get_playback_compression(channel->get_server());
- int desired_mode = snd_desired_audio_mode(playback_compression, channel->frequency, client_can_opus);
+ auto 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(&codec, (SpiceAudioDataMode) desired_mode, channel->frequency,
SND_CODEC_ENCODE) == SND_CODEC_OK) {
@@ -1283,7 +1286,7 @@ void snd_set_playback_compression(bool on)
PlaybackChannelClient* playback = PLAYBACK_CHANNEL_CLIENT(client);
RedChannelClient *rcc = playback;
bool client_can_opus = rcc->test_remote_cap(SPICE_PLAYBACK_CAP_OPUS);
- int desired_mode = snd_desired_audio_mode(on, now->frequency, client_can_opus);
+ auto 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);
More information about the Spice-commits
mailing list