Accepting request 1077110 from multimedia:libs

- Update to version 0.4.14:
  * Additions
    - Add support for managing Bluetooth-MIDI, complementing the
      parts that were merged in PipeWire recently.
    - Add a default volume configuration option for streams whose
      volume has never been saved before; that allows starting new
      streams at a lower volume than 100% by default, if desired.
    - Add support for managing link errors and propagating them to
      the client(s) involved. This allows better error handling on
      the application side in case a format cannot be negotiated -
      useful in video streams.
    - snd_aloop devices are now described as being "Loopback"
      devices.
    - ALSA nodes in the pro audio profile now get increased graph
      priority, so that they are more likely to become the driver
      in the graph.
    - Add support for disabling libcamera nodes & devices with
      node.disabled and device.disabled, like it works for ALSA
      and V4L2.
- Drop reduce-meson-required-version.patch: openSUSE Leap 15.3 is
  no longer supported.
- Drop patches already included upstream:
  * 0001-alsa-monitor-handle-snd_aloop-devices-better.patch
  * 0001-spa-json-make-sure-we-only-add-encoded-string-data.patch
  * 0001-m-lua-scripting-ignore-string-integer-table-keys-when-constructing-a-JSON-Array-Object.patch

OBS-URL: https://build.opensuse.org/request/show/1077110
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/wireplumber?expand=0&rev=22
This commit is contained in:
Dominique Leuenberger 2023-04-06 13:55:40 +00:00 committed by Git OBS Bridge
commit 8cb8500f3c
10 changed files with 41 additions and 386 deletions

View File

@ -1,32 +0,0 @@
From f6dc1b3347967948cf876c62fa597b803052cb3b Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Tue, 13 Dec 2022 15:19:06 +0100
Subject: [PATCH] alsa-monitor: handle snd_aloop devices better
Place Loopback as the device description for snd_aloop devices.
Fixes pipewire#2214
---
src/scripts/monitors/alsa.lua | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua
index 195c0916..b959a4a2 100644
--- a/src/scripts/monitors/alsa.lua
+++ b/src/scripts/monitors/alsa.lua
@@ -228,8 +228,11 @@ function prepareDevice(parent, id, obj_type, factory, properties)
local d = nil
local f = properties["device.form-factor"]
local c = properties["device.class"]
+ local n = properties["api.alsa.card.name"]
- if f == "internal" then
+ if n == "Loopback" then
+ d = I18n.gettext("Loopback")
+ elseif f == "internal" then
d = I18n.gettext("Built-in Audio")
elseif c == "modem" then
d = I18n.gettext("Modem")
--
GitLab

View File

@ -1,176 +0,0 @@
From 6b761c03e18b89c5121e4f48ce7df471504801fd Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Wed, 4 Jan 2023 11:20:14 -0500
Subject: [PATCH] m-lua-scripting: ignore string/integer table keys when
constructing a JSON Array/Object
---
modules/module-lua-scripting/api/json.c | 97 +++++++++++++------------
tests/wplua/scripts/json.lua | 26 +++++++
2 files changed, 77 insertions(+), 46 deletions(-)
diff --git a/modules/module-lua-scripting/api/json.c b/modules/module-lua-scripting/api/json.c
index be12ea38..cae96af8 100644
--- a/modules/module-lua-scripting/api/json.c
+++ b/modules/module-lua-scripting/api/json.c
@@ -242,31 +242,33 @@ spa_json_array_new (lua_State *L)
luaL_checktype (L, 1, LUA_TTABLE);
lua_pushnil (L);
- while (lua_next (L, 1)) {
- switch (lua_type (L, -1)) {
- case LUA_TBOOLEAN:
- wp_spa_json_builder_add_boolean (builder, lua_toboolean (L, -1));
- break;
- case LUA_TNUMBER:
- if (lua_isinteger (L, -1))
- wp_spa_json_builder_add_int (builder, lua_tointeger (L, -1));
- else
- wp_spa_json_builder_add_float (builder, lua_tonumber (L, -1));
- break;
- case LUA_TSTRING:
- wp_spa_json_builder_add_string (builder, lua_tostring (L, -1));
- break;
- case LUA_TUSERDATA: {
- WpSpaJson *json = wplua_checkboxed (L, -1, WP_TYPE_SPA_JSON);
- wp_spa_json_builder_add_json (builder, json);
- break;
+ while (lua_next (L, -2)) {
+ /* We only add table values with integer keys */
+ if (lua_isinteger (L, -2)) {
+ switch (lua_type (L, -1)) {
+ case LUA_TBOOLEAN:
+ wp_spa_json_builder_add_boolean (builder, lua_toboolean (L, -1));
+ break;
+ case LUA_TNUMBER:
+ if (lua_isinteger (L, -1))
+ wp_spa_json_builder_add_int (builder, lua_tointeger (L, -1));
+ else
+ wp_spa_json_builder_add_float (builder, lua_tonumber (L, -1));
+ break;
+ case LUA_TSTRING:
+ wp_spa_json_builder_add_string (builder, lua_tostring (L, -1));
+ break;
+ case LUA_TUSERDATA: {
+ WpSpaJson *json = wplua_checkboxed (L, -1, WP_TYPE_SPA_JSON);
+ wp_spa_json_builder_add_json (builder, json);
+ break;
+ }
+ default:
+ luaL_error (L, "Json does not support lua type ",
+ lua_typename(L, lua_type(L, -1)));
+ break;
}
- default:
- luaL_error (L, "Json does not support lua type ",
- lua_typename(L, lua_type(L, -1)));
- break;
}
-
lua_pop (L, 1);
}
@@ -285,30 +287,33 @@ spa_json_object_new (lua_State *L)
lua_pushnil (L);
while (lua_next (L, -2)) {
- wp_spa_json_builder_add_property (builder, lua_tostring (L, -2));
-
- switch (lua_type (L, -1)) {
- case LUA_TBOOLEAN:
- wp_spa_json_builder_add_boolean (builder, lua_toboolean (L, -1));
- break;
- case LUA_TNUMBER:
- if (lua_isinteger (L, -1))
- wp_spa_json_builder_add_int (builder, lua_tointeger (L, -1));
- else
- wp_spa_json_builder_add_float (builder, lua_tonumber (L, -1));
- break;
- case LUA_TSTRING:
- wp_spa_json_builder_add_string (builder, lua_tostring (L, -1));
- break;
- case LUA_TUSERDATA: {
- WpSpaJson *json = wplua_checkboxed (L, -1, WP_TYPE_SPA_JSON);
- wp_spa_json_builder_add_json (builder, json);
- break;
+ /* We only add table values with string keys */
+ if (lua_type (L, -2) == LUA_TSTRING) {
+ wp_spa_json_builder_add_property (builder, lua_tostring (L, -2));
+
+ switch (lua_type (L, -1)) {
+ case LUA_TBOOLEAN:
+ wp_spa_json_builder_add_boolean (builder, lua_toboolean (L, -1));
+ break;
+ case LUA_TNUMBER:
+ if (lua_isinteger (L, -1))
+ wp_spa_json_builder_add_int (builder, lua_tointeger (L, -1));
+ else
+ wp_spa_json_builder_add_float (builder, lua_tonumber (L, -1));
+ break;
+ case LUA_TSTRING:
+ wp_spa_json_builder_add_string (builder, lua_tostring (L, -1));
+ break;
+ case LUA_TUSERDATA: {
+ WpSpaJson *json = wplua_checkboxed (L, -1, WP_TYPE_SPA_JSON);
+ wp_spa_json_builder_add_json (builder, json);
+ break;
+ }
+ default:
+ luaL_error (L, "Json does not support lua type ",
+ lua_typename(L, lua_type(L, -1)));
+ break;
}
- default:
- luaL_error (L, "Json does not support lua type ",
- lua_typename(L, lua_type(L, -1)));
- break;
}
lua_pop (L, 1);
diff --git a/tests/wplua/scripts/json.lua b/tests/wplua/scripts/json.lua
index e01d7f6f..3671a698 100644
--- a/tests/wplua/scripts/json.lua
+++ b/tests/wplua/scripts/json.lua
@@ -102,6 +102,19 @@ assert (json:is_array())
assert (json:get_data() == "[[{\"key1\":1}, {\"key2\":2}]]")
assert (json:get_data() == json:to_string())
+table = {}
+table[1] = 1
+table[2] = 2
+table[3] = 3
+table["4"] = 4
+json = Json.Array (table)
+assert (json:is_array())
+val = json:parse ()
+assert (val[1] == 1)
+assert (val[2] == 2)
+assert (val[3] == 3)
+assert (val["4"] == nil)
+
-- Object
json = Json.Object {
key1 = Json.Null(),
@@ -134,6 +147,19 @@ assert (val.key7.key_nested3[2])
assert (not val.key7.key_nested3[3])
assert (val.key7["Key with spaces and (special % characters)"] == 50.0)
+table = {}
+table["1"] = 1
+table["2"] = 2
+table["3"] = 3
+table[4] = 4
+json = Json.Object (table)
+assert (json:is_object())
+val = json:parse ()
+assert (val["1"] == 1)
+assert (val["2"] == 2)
+assert (val["3"] == 3)
+assert (val[4] == nil)
+
-- Raw
json = Json.Raw ("[\"foo\", \"bar\"]")
assert (json:is_array())
--
GitLab

View File

@ -1,75 +0,0 @@
From 10f85549a42cd33daaa7a0c4eb1329c5f8067b7d Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Wed, 4 Jan 2023 10:07:36 -0500
Subject: [PATCH] spa-json: make sure we only add encoded string data
The spa_json_encode_string() API does not add a null terminator character. We
need to use the return value to know the size of the encoded string when adding
it to the builder.
---
lib/wp/spa-json.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/lib/wp/spa-json.c b/lib/wp/spa-json.c
index 1649f64b..6c797cf9 100644
--- a/lib/wp/spa-json.c
+++ b/lib/wp/spa-json.c
@@ -391,9 +391,8 @@ wp_spa_json_new_string (const gchar *value)
{
size_t size = (strlen (value) * 4) + 2;
gchar dst[size];
- spa_json_encode_string (dst, sizeof(dst), value);
- return wp_spa_json_new_from_builder (
- wp_spa_json_builder_new_formatted ("%s", dst));
+ gint enc_size = spa_json_encode_string (dst, sizeof(dst), value);
+ return wp_spa_json_new_from_builder (wp_spa_json_builder_new (dst, enc_size));
}
/* Args is not a pointer in some architectures, so this needs to be a macro to
@@ -970,6 +969,14 @@ builder_add_formatted (WpSpaJsonBuilder *self, const gchar *fmt, ...)
self->size += s;
}
+static void
+builder_add (WpSpaJsonBuilder *self, const gchar *data, size_t size)
+{
+ g_return_if_fail (self->max_size - self->size >= size + 1);
+ snprintf (self->data + self->size, size + 1, "%s", data);
+ self->size += size;
+}
+
static void
builder_add_json (WpSpaJsonBuilder *self, WpSpaJson *json)
{
@@ -990,10 +997,12 @@ wp_spa_json_builder_add_property (WpSpaJsonBuilder *self, const gchar *key)
{
size_t size = (strlen (key) * 4) + 3;
gchar dst[size];
+ gint enc_size;
ensure_separator (self, TRUE);
ensure_allocated_max_size (self, size);
- spa_json_encode_string (dst, sizeof(dst), key);
- builder_add_formatted (self, "%s:", dst);
+ enc_size = spa_json_encode_string (dst, sizeof(dst), key);
+ builder_add (self, dst, enc_size);
+ builder_add (self, ":", 1);
}
/*!
@@ -1067,10 +1076,11 @@ wp_spa_json_builder_add_string (WpSpaJsonBuilder *self, const gchar *value)
{
size_t size = (strlen (value) * 4) + 2;
gchar dst[size];
+ gint enc_size;
ensure_separator (self, FALSE);
ensure_allocated_max_size (self, size);
- spa_json_encode_string (dst, sizeof(dst), value);
- builder_add_formatted (self, "%s", dst);
+ enc_size = spa_json_encode_string (dst, sizeof(dst), value);
+ builder_add (self, dst, enc_size);
}
/*!
--
GitLab

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<services>
<service name="obs_scm" mode="disabled">
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
<param name="revision">0.4.13</param>
<param name="revision">refs/tags/0.4.14</param>
<param name="versionformat">@PARENT_TAG@</param>
<!--
<param name="revision">master</param>
@ -15,5 +15,5 @@
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled" />
<service name="set_version" mode="manual" />
</services>

View File

@ -1,73 +0,0 @@
From: Antonio Larrosa <alarrosa@suse.com>
Subject: Reduce the minimum required meson version
With this, we can build wireplumber in SLE 15 SP3/Leap 15.3
which only have meson 0.54
Index: wireplumber-0.4.13/meson.build
===================================================================
--- wireplumber-0.4.13.orig/meson.build
+++ wireplumber-0.4.13/meson.build
@@ -1,7 +1,7 @@
project('wireplumber', ['c'],
version : '0.4.13',
license : 'MIT',
- meson_version : '>= 0.59.0',
+ meson_version : '>= 0.54.0',
default_options : [
'warning_level=1',
'buildtype=debugoptimized',
@@ -52,7 +52,17 @@ spa_dep = dependency('libspa-0.2', versi
pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.3.52')
mathlib = cc.find_library('m')
threads_dep = dependency('threads')
-libintl_dep = dependency('intl')
+
+
+if meson.version().version_compare('>= 0.59')
+ libintl_dep = dependency('intl')
+else
+ libintl_dep = dependency('', required: false)
+
+ if not cc.has_function('ngettext')
+ libintl_dep = cc.find_library('intl')
+ endif
+endif
if build_modules
system_lua = get_option('system-lua')
@@ -145,8 +155,13 @@ if get_option('tests')
subdir('tests')
endif
-builddir = meson.project_build_root()
-srcdir = meson.project_source_root()
+if meson.version().version_compare('>= 0.56')
+ builddir = meson.project_build_root()
+ srcdir = meson.project_source_root()
+else
+ builddir = meson.build_root()
+ srcdir = meson.source_root()
+endif
conf_uninstalled = configuration_data()
conf_uninstalled.set('MESON', '')
@@ -166,10 +181,12 @@ wireplumber_uninstalled = custom_target(
command : ['cp', '@INPUT@', '@OUTPUT@'],
)
-devenv = environment({
- 'WIREPLUMBER_MODULE_DIR': builddir / 'modules',
- 'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config',
- 'WIREPLUMBER_DATA_DIR': srcdir / 'src',
-})
+if meson.version().version_compare('>= 0.58')
+ devenv = environment({
+ 'WIREPLUMBER_MODULE_DIR': builddir / 'modules',
+ 'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config',
+ 'WIREPLUMBER_DATA_DIR': srcdir / 'src',
+ })
-meson.add_devenv(devenv)
+ meson.add_devenv(devenv)
+endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b9eb85c2f3aee2be7850d603f2c55953db048268f30f60a79fa751dd6f3135de
size 2150412

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa55cb18cba94f03f4d13032f9b243cd63fc5d3c08d145db0ab60c2053c03fc1
size 2165772

View File

@ -1,3 +1,32 @@
-------------------------------------------------------------------
Fri Mar 10 23:20:12 UTC 2023 - Alexei Sorokin <sor.alexei@meowr.ru>
- Update to version 0.4.14:
* Additions
- Add support for managing Bluetooth-MIDI, complementing the
parts that were merged in PipeWire recently.
- Add a default volume configuration option for streams whose
volume has never been saved before; that allows starting new
streams at a lower volume than 100% by default, if desired.
- Add support for managing link errors and propagating them to
the client(s) involved. This allows better error handling on
the application side in case a format cannot be negotiated -
useful in video streams.
- snd_aloop devices are now described as being "Loopback"
devices.
- ALSA nodes in the pro audio profile now get increased graph
priority, so that they are more likely to become the driver
in the graph.
- Add support for disabling libcamera nodes & devices with
node.disabled and device.disabled, like it works for ALSA
and V4L2.
- Drop reduce-meson-required-version.patch: openSUSE Leap 15.3 is
no longer supported.
- Drop patches already included upstream:
* 0001-alsa-monitor-handle-snd_aloop-devices-better.patch
* 0001-spa-json-make-sure-we-only-add-encoded-string-data.patch
* 0001-m-lua-scripting-ignore-string-integer-table-keys-when-constructing-a-JSON-Array-Object.patch
-------------------------------------------------------------------
Fri Jan 13 10:51:07 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -1,4 +1,4 @@
name: wireplumber
version: 0.4.13
mtime: 1670924354
commit: 7cb1b8b92e96ebd1b7e632cda32715fed713d333
version: 0.4.14
mtime: 1678376262
commit: 6d0c7f7b7f484b3cd2aaf2e2b3cc902c095b4946

View File

@ -22,7 +22,7 @@
%define sover 0
%define libwireplumber libwireplumber-%{apiver_str}-%{sover}
Name: wireplumber
Version: 0.4.13
Version: 0.4.14
Release: 0
Summary: Session / policy manager implementation for PipeWire
License: MIT
@ -30,26 +30,13 @@ Group: Development/Libraries/C and C++
URL: https://gitlab.freedesktop.org/pipewire/wireplumber
Source0: wireplumber-%{version}.tar.xz
Source1: split-config-file.py
# PATCH-FIX-OPENSUSE reduce-meson-required-version.patch
Patch0: reduce-meson-required-version.patch
# PATCH-FIX-UPSTREAM 0001-alsa-monitor-handle-snd_aloop-devices-better.patch
Patch1: 0001-alsa-monitor-handle-snd_aloop-devices-better.patch
# PATCH-FIX-UPSTREAM 0001-spa-json-make-sure-we-only-add-encoded-string-data.patch
Patch2: 0001-spa-json-make-sure-we-only-add-encoded-string-data.patch
# PATCH-FIX-UPSTREAM 0001-m-lua-scripting-ignore-string-integer-table-keys-when-constructing-a-JSON-Array-Object.patch
Patch3: 0001-m-lua-scripting-ignore-string-integer-table-keys-when-constructing-a-JSON-Array-Object.patch
# docs
BuildRequires: doxygen
BuildRequires: graphviz
# /docs
BuildRequires: cmake
BuildRequires: fdupes
%if 0%{?sle_version} <= 150300
BuildRequires: meson >= 0.54.0
%else
BuildRequires: meson >= 0.59.0
%endif
BuildRequires: pipewire >= %{pipewire_minimum_version}
BuildRequires: pipewire-spa-plugins-0_2 >= %{pipewire_minimum_version}
BuildRequires: pkgconfig
@ -145,13 +132,7 @@ This package provides the GObject Introspection bindings for
the wireplumber shared library.
%prep
%autosetup -N
%if 0%{?suse_version} <= 1500 && 0%{?sle_version} <= 150300
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%autosetup -p1
pushd src/config/main.lua.d
python3 %{SOURCE1}
@ -161,6 +142,7 @@ popd
%build
%if %{pkg_vcmp gcc < 8}
export CC=gcc-9
export CXX=g++-9
%endif
%meson -Ddoc=disabled \
-Dsystem-lua=true \