diff -Nru gupnp-tools-0.10.3/config.h.meson gupnp-tools-0.12.0/config.h.meson --- gupnp-tools-0.10.3/config.h.meson 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/config.h.meson 2022-10-11 21:00:49.000000000 +0000 @@ -5,3 +5,5 @@ #mesondefine DATA_DIR #mesondefine GETTEXT_PACKAGE #mesondefine LOCALEDIR +#mesondefine GLIB_VERSION_MIN_REQUIRED +#mesondefine GLIB_VERSION_MAX_ALLOWED diff -Nru gupnp-tools-0.10.3/debian/changelog gupnp-tools-0.12.0/debian/changelog --- gupnp-tools-0.10.3/debian/changelog 2022-05-20 17:10:34.000000000 +0000 +++ gupnp-tools-0.12.0/debian/changelog 2022-10-30 14:06:57.000000000 +0000 @@ -1,3 +1,18 @@ +gupnp-tools (0.12.0-2) unstable; urgency=medium + + * Team upload. + * Upload to unstable. (See #1022003) + + -- Andreas Henriksson Sun, 30 Oct 2022 15:06:57 +0100 + +gupnp-tools (0.12.0-1) experimental; urgency=medium + + * Team upload. + * New upstream release + * Bump build-deps GLib 2.68, GUPnP 1.6, Libsoup 3.0 + + -- Andreas Henriksson Tue, 18 Oct 2022 20:41:11 +0200 + gupnp-tools (0.10.3-1) unstable; urgency=medium [ Jeremy Bicha ] diff -Nru gupnp-tools-0.10.3/debian/control gupnp-tools-0.12.0/debian/control --- gupnp-tools-0.10.3/debian/control 2022-05-20 17:10:34.000000000 +0000 +++ gupnp-tools-0.12.0/debian/control 2022-10-30 14:06:57.000000000 +0000 @@ -10,11 +10,11 @@ Build-Depends: debhelper-compat (= 13), dh-sequence-gnome, gettext (>= 0.19.7), - libglib2.0-dev (>= 2.16), - libgssdp-1.2-dev, - libgupnp-1.2-dev, + libglib2.0-dev (>= 2.68), + libgssdp-1.6-dev, + libgupnp-1.6-dev, libgupnp-av-1.0-dev (>= 0.5.5), - libsoup2.4-dev (>= 2.42), + libsoup-3.0-dev, libxml2-dev (>= 2.0), libgtk-3-dev (>= 3.10), libgtksourceview-4-dev (>= 3.2.0), diff -Nru gupnp-tools-0.10.3/debian/control.in gupnp-tools-0.12.0/debian/control.in --- gupnp-tools-0.10.3/debian/control.in 2022-05-20 17:10:34.000000000 +0000 +++ gupnp-tools-0.12.0/debian/control.in 2022-10-28 20:59:24.000000000 +0000 @@ -6,11 +6,11 @@ Build-Depends: debhelper-compat (= 13), dh-sequence-gnome, gettext (>= 0.19.7), - libglib2.0-dev (>= 2.16), - libgssdp-1.2-dev, - libgupnp-1.2-dev, + libglib2.0-dev (>= 2.68), + libgssdp-1.6-dev, + libgupnp-1.6-dev, libgupnp-av-1.0-dev (>= 0.5.5), - libsoup2.4-dev (>= 2.42), + libsoup-3.0-dev, libxml2-dev (>= 2.0), libgtk-3-dev (>= 3.10), libgtksourceview-4-dev (>= 3.2.0), diff -Nru gupnp-tools-0.10.3/.gitlab-ci.yml gupnp-tools-0.12.0/.gitlab-ci.yml --- gupnp-tools-0.10.3/.gitlab-ci.yml 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/.gitlab-ci.yml 2022-10-11 21:00:49.000000000 +0000 @@ -1,6 +1,6 @@ include: - - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ci-fairy.yml" - - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/fedora.yml' + - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/0c312d9c7255f46e741d43bcd1930f09cd12efe7/templates/ci-fairy.yml" + - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/0c312d9c7255f46e741d43bcd1930f09cd12efe7/templates/fedora.yml' variables: MESON_TEST_TIMEOUT_MULTIPLIER: 3 @@ -61,23 +61,23 @@ .gupnp_tools.fedora@common: variables: - BASE_TAG: '2021-06-19.0' + BASE_TAG: '2022-05-20.0' FDO_UPSTREAM_REPO: GNOME/gupnp-tools - FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip xmlto gobject-introspection-devel gtk-doc libsoup-devel libuuid-devel libxml2-devel vala ninja-build gtk3-devel gtksourceview4-devel' + FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip xmlto gobject-introspection-devel gtk-doc libsoup3-devel libuuid-devel libxml2-devel vala ninja-build gtk3-devel gtksourceview4-devel' FDO_DISTRIBUTION_EXEC: | dnf clean all && pip3 install meson -.gupnp_tools.fedora:34@x86_64: +.gupnp_tools.fedora:36@x86_64: extends: .gupnp_tools.fedora@common variables: - FDO_DISTRIBUTION_VERSION: 34 + FDO_DISTRIBUTION_VERSION: 36 FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}" build-fedora-container@x86_64: extends: - .fdo.container-build@fedora - - .gupnp_tools.fedora:34@x86_64 + - .gupnp_tools.fedora:36@x86_64 stage: prepare variables: GIT_STRATEGY: none @@ -86,7 +86,7 @@ build-fedora@x86_64: extends: - .fdo.distribution-image@fedora - - .gupnp_tools.fedora:34@x86_64 + - .gupnp_tools.fedora:36@x86_64 needs: - build-fedora-container@x86_64 <<: *build @@ -128,7 +128,7 @@ test-fedora@x86_64: extends: - .fdo.distribution-image@fedora - - .gupnp_tools.fedora:34@x86_64 + - .gupnp_tools.fedora:36@x86_64 needs: - build-fedora@x86_64 <<: *test @@ -144,7 +144,7 @@ #coverage-analysis: # extends: # - .fdo.distribution-image@fedora -# - .gupnp_tools.fedora:34@x86_64 +# - .gupnp_tools.fedora:36@x86_64 # stage: analysis # allow_failure: true # script: @@ -162,7 +162,7 @@ static-scan: extends: - .fdo.distribution-image@fedora - - .gupnp_tools.fedora:34@x86_64 + - .gupnp_tools.fedora:36@x86_64 stage: analysis needs: - build-fedora-container@x86_64 @@ -177,7 +177,7 @@ #pages: # extends: # - .fdo.distribution-image@fedora -# - .gupnp_tools.fedora:34@x86_64 +# - .gupnp_tools.fedora:36@x86_64 # stage: website # script: # - meson doc-build -Dgtk_doc=true diff -Nru gupnp-tools-0.10.3/meson.build gupnp-tools-0.12.0/meson.build --- gupnp-tools-0.10.3/meson.build 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/meson.build 2022-10-11 21:00:49.000000000 +0000 @@ -1,4 +1,4 @@ -project('gupnp-tools', ['c'], version: '0.10.3') +project('gupnp-tools', ['c'], version: '0.12.0') gnome = import('gnome') i18n = import('i18n') @@ -7,17 +7,18 @@ win = import('windows') endif -gssdp = dependency('gssdp-1.2', version: '>= 1.2.0', default_options: ['sniffer=false']) -gupnp = dependency('gupnp-1.2', version: '>= 1.4.0') -soup = dependency('libsoup-2.4', version: '>= 2.42') +gssdp = dependency('gssdp-1.6', version: '>= 1.6.0', default_options: ['sniffer=false']) +gupnp = dependency('gupnp-1.6', version: '>= 1.6.0') +soup = dependency('libsoup-3.0', version: '>= 3.0') gupnp_av = dependency('gupnp-av-1.0', version: '>= 0.5.5', required: get_option('av-tools')) gtk = dependency('gtk+-3.0', version: '>= 3.10') -glib = dependency('glib-2.0', version: '>= 2.24') -gio = dependency('gio-2.0', version: '>= 2.24') +glib_version = '2.68' +glib = dependency('glib-2.0', version: '>= ' + glib_version) +gio = dependency('gio-2.0', version: '>= ' + glib_version) libxml = dependency('libxml-2.0', version: '>= 2.0') -gobject = dependency('gobject-2.0', version: '>= 2.24') +gobject = dependency('gobject-2.0', version: '>= ' + glib_version) -# Check for gtksourceview (used for XML syntax highlighting) +# Check for gtksourceview (used for XML syntax highlighting) gtksourceview = dependency('gtksourceview-4', required: false) if not gtksourceview.found() gtksourceview = dependency('gtksourceview-3.0', version: '>= 3.2.0', required: false) @@ -42,9 +43,14 @@ conf.set('HAVE_GTK_SOURCEVIEW', gtksourceview.found()) conf.set('GETTEXT_PACKAGE', '"@0@"'.format(meson.project_name())) conf.set('LOCALEDIR', '"@0@"'.format(localedir)) +cc = meson.get_compiler('c') +add_project_arguments(cc.get_supported_arguments('-Werror=deprecated-declarations'), language: 'c') +conf.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_@0@'.format(glib_version.underscorify())) +conf.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_@0@'.format(glib_version.underscorify())) + configure_file(input: 'config.h.meson', output: 'config.h', configuration: conf) -config_header = declare_dependency(compile_args : '-DHAVE_CONFIG_H=1', include_directories : include_directories('.')) +config_header = declare_dependency(include_directories : include_directories('.')) subdir('data') subdir('src') diff -Nru gupnp-tools-0.10.3/NEWS gupnp-tools-0.12.0/NEWS --- gupnp-tools-0.10.3/NEWS 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/NEWS 2022-10-11 21:00:49.000000000 +0000 @@ -1,15 +1,38 @@ -0.10.3 (stable) +0.12.0 (stable) =============== - - Fix deprecated function calls - - Fix empty icon for devices with no icons - - Translation updates +Dependency changes: + - GLib required is now 2.68 + - GUPnP requirement up to 1.6 + - Libsoup requirement up to 3.0 + +- All + - Port to GUPnP 1.6 and Libsoup3 + - Fix inconsistencies regarding action errors + - Use more g_autoptr + - Drop gupnp_get_uuid() where used. + - Translation updates + +- Common + - Fix potential NULL pointer dereference + - Use GUPnP utility functions for download of icons + +- Universal CP: + - Fix missing icon on download error + - Fix uninitialized out value + +- Event Dumper: + - Added new tool for dumping UPnP events on command line Bugs fixed in this release: - https://gitlab.gnome.org/GNOME/gupnp-tools/issues/23 +Merge requests included in this release: + - https://gitlab.gnome.org/GNOME/gupnp-tools/merge_requests/4 + All contributors to this release: - Jens Georg + - Jürgen Benvenuti - Sabri Ünal - Hugo Carvalho - Luming Zh @@ -18,6 +41,7 @@ Added/updated translations: - da.po, courtesy of Alan Mortensen + - de.po, courtesy of Jürgen Benvenuti - eu.po, courtesy of Asier Sarasua Garmendia - pt.po, courtesy of Hugo Carvalho - tr.po, courtesy of Sabri Ünal diff -Nru gupnp-tools-0.10.3/po/de.po gupnp-tools-0.12.0/po/de.po --- gupnp-tools-0.10.3/po/de.po 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/po/de.po 2022-10-11 21:00:49.000000000 +0000 @@ -3,21 +3,22 @@ # This file is distributed under the same license as the gupnp-tools package. # Mario Blättermann , 2013, 2016-2018. # Christian Kirbach , 2013. +# Jürgen Benvenuti , 2022. # msgid "" msgstr "" "Project-Id-Version: gupnp-tools master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gupnp-tools/issues\n" -"POT-Creation-Date: 2018-12-02 11:50+0000\n" -"PO-Revision-Date: 2019-03-02 21:19+0100\n" -"Last-Translator: Bernd Homuth \n" +"POT-Creation-Date: 2022-05-14 11:52+0000\n" +"PO-Revision-Date: 2022-07-12 10:27+0200\n" +"Last-Translator: Jürgen Benvenuti \n" "Language-Team: Deutsch \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.1\n" +"X-Generator: Poedit 3.1\n" #: data/didl-lite-dialog.ui.in:9 msgid "GUPnP AV CP - Metadata View" @@ -31,11 +32,6 @@ msgid "Browse and control UPnP multimedia devices" msgstr "UPnP-Multimediageräte durchsuchen und steuern" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: data/gupnp-av-cp.desktop.in:9 -msgid "av-cp" -msgstr "av-cp" - #: data/gupnp-av-cp.ui:22 data/gupnp-av-cp.ui:208 msgid "_Play" msgstr "_Wiedergabe" @@ -140,7 +136,8 @@ msgid "translator-credits" msgstr "" "Christian Kirbach \n" -"Mario Blättermann " +"Mario Blättermann \n" +"Jürgen Benvenuti " #: data/gupnp-network-light.desktop.in:4 msgid "UPnP Network Light" @@ -150,11 +147,6 @@ msgid "Sample UPnP application for controlling lights" msgstr "UPnP-Beispielanwendung zur Lichtsteuerung" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: data/gupnp-network-light.desktop.in:9 -msgid "network-light-256x256" -msgstr "network-light-256x256" - #: data/gupnp-network-light.ui:8 msgid "" "A virtual network light bulb based on GUPnP framework.\n" @@ -193,11 +185,6 @@ msgstr "" "UPnP-Multimediageräte in Ihrem lokalen Netzwerk untersuchen und steuern" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: data/gupnp-universal-cp.desktop.in:9 -msgid "universal-cp" -msgstr "universal-cp" - #: data/gupnp-universal-cp.ui:9 msgid "" "A Generic Control Point based on GUPnP framework.\n" @@ -291,86 +278,118 @@ msgid "Event _log" msgstr "_Ereignismitschnitt" -#: data/search-dialog.ui:12 -msgid "Show _DIDL…" -msgstr "_DIDL anzeigen …" - -#: data/search-dialog.ui:49 +#: data/search-dialog.ui:39 msgid "_Close" msgstr "S_chließen" -#: data/search-dialog.ui:81 +#: data/search-dialog.ui:71 msgid "UPnP search expression" msgstr "UPnP-Suchausdruck" -#: data/search-dialog.ui:107 +#: data/search-dialog.ui:98 msgid "column" msgstr "Spalte" -#: src/av-cp/main.c:49 src/network-light/main.c:48 src/universal-cp/main.c:41 +#: src/av-cp/main.c:52 src/network-light/main.c:51 src/universal-cp/main.c:51 msgid "Network PORT to use for UPnP" msgstr "Netzwerk-Port, der für UPnP-Kommunikation verwendet werden soll" -#: src/av-cp/main.c:50 src/network-light/main.c:49 src/universal-cp/main.c:42 +#: src/av-cp/main.c:53 src/network-light/main.c:52 src/universal-cp/main.c:52 msgid "Network interfaces to use for UPnP communication" msgstr "" "Netzwerkschnittstellen, die für UPnP-Kommunikation verwendet werden sollen" -#: src/av-cp/main.c:51 +#: src/av-cp/main.c:54 msgid "Application part of the User-Agent header to use for UPnP communication" msgstr "" "Anwendungsbezeichnung im Kopf des User-Agents, die für UPnP-Kommunikation " "verwendet werden soll" -#: src/av-cp/main.c:225 src/network-light/main.c:104 -#: src/universal-cp/main.c:149 +#: src/av-cp/main.c:55 src/universal-cp/main.c:53 +msgid "Use the IPv4 protocol family" +msgstr "Die IPv4-Protokoll-Familie verwenden" + +#: src/av-cp/main.c:56 src/universal-cp/main.c:54 +msgid "Use the IPv6 protocol family" +msgstr "Die IPv6-Protokoll-Familie verwenden" + +#: src/av-cp/main.c:57 src/universal-cp/main.c:55 +msgid "Do not use the IPv4 protocol family" +msgstr "Die IPv4-Protokoll-Familie nicht verwenden" + +#: src/av-cp/main.c:58 src/universal-cp/main.c:56 +msgid "Do not use the IPv6 protocol family" +msgstr "Die IPv6-Protokoll-Familie nicht verwenden" + +#: src/av-cp/main.c:241 src/network-light/main.c:112 +#: src/universal-cp/main.c:194 msgid "- UPnP AV control point" msgstr "- UPnP AV-Kontrollpunkt" -#: src/av-cp/main.c:230 src/network-light/main.c:109 -#: src/universal-cp/main.c:154 +#: src/av-cp/main.c:246 src/network-light/main.c:117 +#: src/universal-cp/main.c:199 #, c-format msgid "Could not parse options: %s\n" msgstr "Optionen konnten nicht analysiert werden: %s\n" -#: src/av-cp/search-dialog.c:440 src/av-cp/search-dialog.c:579 +#: src/av-cp/search-dialog.c:384 +msgid "Show _DIDL…" +msgstr "_DIDL anzeigen …" + +#: src/av-cp/search-dialog.c:478 src/av-cp/search-dialog.c:627 msgid "Search failed" msgstr "Suche fehlgeschlagen" -#: src/av-cp/search-dialog.c:444 +#: src/av-cp/search-dialog.c:482 #, c-format msgid "Error message was: %s" msgstr "Fehlermeldung war: %s" -#: src/av-cp/search-dialog.c:488 +#: src/av-cp/search-dialog.c:530 #, c-format msgid "Searching on %s" msgstr "Suchen auf »%s«" -#: src/av-cp/search-dialog.c:491 +#: src/av-cp/search-dialog.c:533 #, c-format msgid "Searching in %s on %s" msgstr "Suchen in »%s« auf »%s«" -#: src/av-cp/search-dialog.c:583 +#: src/av-cp/search-dialog.c:631 #, c-format msgid "Search criteria invalid: %s" msgstr "Ungültige Suchkriterien angegeben: %s" -#: src/av-cp/search-dialog.c:689 +#: src/av-cp/search-dialog.c:736 #, c-format msgid "Error fetching detailed information: %s" msgstr "Fehler beim Holen detaillierter Informationen: %s" -#: src/network-light/main.c:50 +#: src/network-light/main.c:53 msgid "Friendly name for this UPnP light" msgstr "Freundlicher Name für dieses UPnP-Light" -#: src/network-light/main.c:51 +#: src/network-light/main.c:54 msgid "Apply change exclusively to this UPnP light" msgstr "Änderung exklusiv auf dieses UPnP-Light anwenden" -#: src/universal-cp/action-dialog.c:693 +#: src/network-light/main.c:55 +msgid "Use IPv4" +msgstr "IPv4 verwenden" + +#: src/network-light/main.c:56 +msgid "Use IPv6" +msgstr "IPv6 verwenden" + +#: src/network-light/main.c:57 +msgid "Do not use IPv4" +msgstr "IPv4 nicht verwenden" + +#: src/network-light/main.c:58 +msgid "Do not use IPv6" +msgstr "IPv6 nicht verwenden" + +#: src/universal-cp/action-dialog.c:690 src/universal-cp/action-dialog.c:709 #, c-format msgid "" "Action failed.\n" @@ -520,7 +539,7 @@ msgstr "Anzeigeadresse" #: src/universal-cp/details-treeview.c:432 -#: src/universal-cp/event-treeview.c:410 +#: src/universal-cp/event-treeview.c:414 msgid "Value" msgstr "Wert" @@ -536,30 +555,43 @@ msgid "Author" msgstr "Autor" -#: src/universal-cp/device-treeview.c:483 +#: src/universal-cp/device-treeview.c:489 msgid "State variables" msgstr "Zustandsvariablen" -#: src/universal-cp/device-treeview.c:524 +#: src/universal-cp/device-treeview.c:530 msgid "Information not available" msgstr "Information nicht verfügbar" -#: src/universal-cp/device-treeview.c:703 +#: src/universal-cp/device-treeview.c:709 msgid "UPnP Network" msgstr "UPnP-Netzwerk" -#: src/universal-cp/device-treeview.c:716 src/universal-cp/event-treeview.c:407 +#: src/universal-cp/device-treeview.c:722 src/universal-cp/event-treeview.c:411 msgid "Device" msgstr "Gerät" -#: src/universal-cp/event-treeview.c:406 +#: src/universal-cp/event-treeview.c:410 msgid "Time" msgstr "Zeit" -#: src/universal-cp/event-treeview.c:408 +#: src/universal-cp/event-treeview.c:412 msgid "Service" msgstr "Dienste" -#: src/universal-cp/event-treeview.c:409 +#: src/universal-cp/event-treeview.c:413 msgid "State Variable" msgstr "Zustandsvariable" + +#: src/universal-cp/main.c:57 +msgid "The UDA version to use" +msgstr "Die UDA-Version, die verwendet werden soll" + +#~ msgid "av-cp" +#~ msgstr "av-cp" + +#~ msgid "network-light-256x256" +#~ msgstr "network-light-256x256" + +#~ msgid "universal-cp" +#~ msgstr "universal-cp" diff -Nru gupnp-tools-0.10.3/src/av-cp/didl-dialog.c gupnp-tools-0.12.0/src/av-cp/didl-dialog.c --- gupnp-tools-0.10.3/src/av-cp/didl-dialog.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/didl-dialog.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include "didl-dialog.h" #include "pretty-print.h" diff -Nru gupnp-tools-0.10.3/src/av-cp/entry-completion.c gupnp-tools-0.12.0/src/av-cp/entry-completion.c --- gupnp-tools-0.10.3/src/av-cp/entry-completion.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/entry-completion.c 2022-10-11 21:00:49.000000000 +0000 @@ -1,3 +1,5 @@ +#include + #include "entry-completion.h" #include @@ -198,4 +200,4 @@ -1); it++; } -} \ No newline at end of file +} diff -Nru gupnp-tools-0.10.3/src/av-cp/gui.c gupnp-tools-0.12.0/src/av-cp/gui.c --- gupnp-tools-0.10.3/src/av-cp/gui.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/gui.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,12 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + #include +#include +#include #include "gui.h" #include "playlist-treeview.h" diff -Nru gupnp-tools-0.10.3/src/av-cp/main.c gupnp-tools-0.12.0/src/av-cp/main.c --- gupnp-tools-0.10.3/src/av-cp/main.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/main.c 2022-10-11 21:00:49.000000000 +0000 @@ -20,9 +20,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include diff -Nru gupnp-tools-0.10.3/src/av-cp/playlist-treeview.c gupnp-tools-0.12.0/src/av-cp/playlist-treeview.c --- gupnp-tools-0.10.3/src/av-cp/playlist-treeview.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/playlist-treeview.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include -#ifdef HAVE_CONFIG_H -#include -#endif + #include #include "playlist-treeview.h" @@ -1024,7 +1024,6 @@ compare_media_server, (gpointer) udn, FALSE)) { - unschedule_icon_update (info); gtk_tree_store_remove (GTK_TREE_STORE (model), &iter); } } diff -Nru gupnp-tools-0.10.3/src/av-cp/renderer-combo.c gupnp-tools-0.12.0/src/av-cp/renderer-combo.c --- gupnp-tools-0.10.3/src/av-cp/renderer-combo.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/renderer-combo.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + +#include +#include #include "renderer-combo.h" #include "renderer-controls.h" @@ -340,12 +339,20 @@ } static void -on_device_icon_available (GUPnPDeviceInfo *info, - GdkPixbuf *icon) +on_device_icon_available (GObject *source, + GAsyncResult *res, + gpointer user_data) { GtkTreeModel *model; GtkTreeIter iter; const char *udn; + g_autoptr (GdkPixbuf) icon; + g_autoptr (GError) error = NULL; + + icon = update_icon_finish (GUPNP_DEVICE_INFO (source), res, &error); + if (error != NULL) { + g_debug ("Failed to download icon: %s", error->message); + } if (icon == NULL) return; @@ -353,7 +360,7 @@ model = gtk_combo_box_get_model (GTK_COMBO_BOX (renderer_combo)); g_assert (model != NULL); - udn = gupnp_device_info_get_udn (info); + udn = gupnp_device_info_get_udn (GUPNP_DEVICE_INFO (source)); if (find_renderer (model, udn, &iter)) { gtk_list_store_set (GTK_LIST_STORE (model), @@ -362,7 +369,7 @@ -1); } - g_object_unref (icon); + g_object_set_data (source, "icon-download-cancellable", NULL); } static void @@ -516,7 +523,12 @@ gupnp_service_proxy_set_subscribed (av_transport, TRUE); gupnp_service_proxy_set_subscribed (rendering_control, TRUE); - schedule_icon_update (info, on_device_icon_available); + GCancellable *cancellable = g_cancellable_new (); + g_object_set_data_full (G_OBJECT (info), + "icon-download-cancellable", + cancellable, + g_object_unref); + update_icon_async (info, cancellable, on_device_icon_available, NULL); if (was_empty) gtk_combo_box_set_active_iter (combo, &iter); @@ -846,7 +858,16 @@ model = gtk_combo_box_get_model (combo); if (find_renderer (model, udn, &iter)) { - unschedule_icon_update (info); + GCancellable *cancellable = + g_object_get_data (G_OBJECT (info), + "icon-download-cancellable"); + if (cancellable != NULL) { + g_cancellable_cancel (cancellable); + + g_object_set_data (G_OBJECT (info), + "icon-download-cancellable", + NULL); + } gtk_list_store_remove (GTK_LIST_STORE (model), &iter); gtk_combo_box_set_active (combo, 0); } diff -Nru gupnp-tools-0.10.3/src/av-cp/renderer-controls.c gupnp-tools-0.12.0/src/av-cp/renderer-controls.c --- gupnp-tools-0.10.3/src/av-cp/renderer-controls.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/renderer-controls.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include -#ifdef HAVE_CONFIG_H -#include -#endif + #include #include diff -Nru gupnp-tools-0.10.3/src/av-cp/search-dialog.c gupnp-tools-0.12.0/src/av-cp/search-dialog.c --- gupnp-tools-0.10.3/src/av-cp/search-dialog.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/search-dialog.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include diff -Nru gupnp-tools-0.10.3/src/av-cp/server-device.c gupnp-tools-0.12.0/src/av-cp/server-device.c --- gupnp-tools-0.10.3/src/av-cp/server-device.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/av-cp/server-device.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include "server-device.h" @@ -150,8 +152,9 @@ } static void -av_cp_media_server_on_icon_updated (GUPnPDeviceInfo *info, - GdkPixbuf *icon); +av_cp_media_server_on_icon_updated (GObject *source, + GAsyncResult *res, + gpointer user_data); static void av_cp_media_server_on_get_sort_caps (GObject *object, @@ -308,13 +311,20 @@ } static void -av_cp_media_server_on_icon_updated (GUPnPDeviceInfo *info, - GdkPixbuf *icon) +av_cp_media_server_on_icon_updated (GObject *source, + GAsyncResult *res, + gpointer user_data) { - AVCPMediaServer *self = AV_CP_MEDIA_SERVER (info); + AVCPMediaServer *self = AV_CP_MEDIA_SERVER (source); AVCPMediaServerPrivate *priv = av_cp_media_server_get_instance_private (self); + g_autoptr (GError) error = NULL; + + priv->icon = + update_icon_finish (GUPNP_DEVICE_INFO (source), res, &error); + if (error != NULL) { + g_debug ("Failed to download device icon: %s", error->message); + } - priv->icon = icon; av_cp_media_server_get_content_directory (self); if (priv->content_directory != NULL) { @@ -401,8 +411,10 @@ static void av_cp_media_server_introspect (AVCPMediaServer *self) { - schedule_icon_update (GUPNP_DEVICE_INFO (self), - av_cp_media_server_on_icon_updated); + update_icon_async (GUPNP_DEVICE_INFO (self), + NULL, + av_cp_media_server_on_icon_updated, + NULL); } static void diff -Nru gupnp-tools-0.10.3/src/common/icons.c gupnp-tools-0.12.0/src/common/icons.c --- gupnp-tools-0.10.3/src/common/icons.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/common/icons.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,9 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include #include @@ -39,11 +37,6 @@ static GList *pending_gets; typedef struct { - GUPnPDeviceInfo *info; - - DeviceIconAvailableCallback callback; - - SoupMessage *message; gchar *mime_type; gint width; gint height; @@ -52,35 +45,34 @@ static void get_icon_url_data_free (GetIconURLData *data) { - g_object_unref (data->info); - g_free (data->mime_type); g_slice_free (GetIconURLData, data); } +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GetIconURLData, get_icon_url_data_free) + static GdkPixbuf * -get_icon_from_message (SoupMessage *msg, - GetIconURLData *data, - GError **error) +get_icon_from_bytes (GBytes *icon_data, + const char *mime, + int source_width, + int source_height, + GError **error) { - GdkPixbufLoader *loader; + g_autoptr (GdkPixbufLoader) loader; GdkPixbuf *pixbuf; - loader = gdk_pixbuf_loader_new_with_mime_type (data->mime_type, error); + loader = gdk_pixbuf_loader_new_with_mime_type (mime, error); if (loader == NULL) return NULL; - gdk_pixbuf_loader_write (loader, - (guchar *) msg->response_body->data, - msg->response_body->length, - error); + gdk_pixbuf_loader_write_bytes (loader, icon_data, error); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); if (pixbuf) { gfloat aspect_ratio; gint height; /* Preserve the aspect-ratio of the original image */ - aspect_ratio = (gfloat) data->width / data->height; + aspect_ratio = (gfloat) source_width / source_height; height = (gint) (PREFERED_WIDTH / aspect_ratio); pixbuf = gdk_pixbuf_scale_simple (pixbuf, PREFERED_WIDTH, @@ -89,7 +81,6 @@ } gdk_pixbuf_loader_close (loader, NULL); - g_object_unref (loader); return pixbuf; } @@ -97,123 +88,72 @@ /** * Icon downloaded. **/ -static void -got_icon_url (SoupSession *session, - SoupMessage *msg, - GetIconURLData *data) -{ - GdkPixbuf *pixbuf = NULL; - - if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - GError *error = NULL; - - pixbuf = get_icon_from_message (msg, data, &error); - - if (error) { - g_warning ("Failed to create icon for '%s': %s", - gupnp_device_info_get_udn (data->info), - error->message); - g_error_free (error); - } else if (!pixbuf) { - g_warning ("Failed to create icon for '%s'", - gupnp_device_info_get_udn (data->info)); - } - } - - data->callback (data->info, pixbuf); - - pending_gets = g_list_remove (pending_gets, data); - get_icon_url_data_free (data); -} - -static gboolean -on_icon_schedule_error (gpointer user_data) -{ - GetIconURLData *data = (GetIconURLData *) user_data; - - data->callback (data->info, NULL); - g_object_unref (data->info); - g_slice_free (GetIconURLData, data); - - return FALSE; -} -void -schedule_icon_update (GUPnPDeviceInfo *info, - DeviceIconAvailableCallback callback) +static void +on_got_icon (GObject *source, GAsyncResult *res, gpointer user_data) { - GetIconURLData *data; - char *icon_url; + GError *error = NULL; + g_autoptr (GTask) task = G_TASK (user_data); + g_autofree char *mime = NULL; + int width; + int height; + + g_autoptr (GBytes) icon = + gupnp_device_info_get_icon_finish (GUPNP_DEVICE_INFO (source), + res, + &mime, + NULL, + &width, + &height, + &error); - data = g_slice_new0 (GetIconURLData); - data->info = g_object_ref (info); - data->callback = callback; - - icon_url = gupnp_device_info_get_icon_url - (info, - NULL, - PREFERED_DEPTH, - PREFERED_WIDTH, - PREFERED_HEIGHT, - TRUE, - &data->mime_type, - NULL, - &data->width, - &data->height); - if (icon_url == NULL) { - g_free (data->mime_type); + if (error != NULL) { + g_task_return_error (task, error); - g_idle_add (on_icon_schedule_error, data); return; } - char *new_uri = gupnp_context_rewrite_uri (gupnp_device_info_get_context (info), icon_url); - g_free (icon_url); - - data->message = soup_message_new (SOUP_METHOD_GET, new_uri); + GdkPixbuf *device_icon = icon == NULL ? NULL + : get_icon_from_bytes (icon, + mime, + width, + height, + &error); - if (data->message == NULL) { - g_warning ("Invalid URL icon for device '%s': %s", - gupnp_device_info_get_udn (info), - new_uri); - - g_free (new_uri); - g_free (data->mime_type); - g_idle_add (on_icon_schedule_error, data); + if (error != NULL) { + g_task_return_error (task, error); return; } - pending_gets = g_list_prepend (pending_gets, data); - soup_session_queue_message (download_session, - data->message, - (SoupSessionCallback) got_icon_url, - data); - - g_free (new_uri); + g_task_return_pointer (task, device_icon, g_object_unref); } void -unschedule_icon_update (GUPnPDeviceInfo *info) +update_icon_async (GUPnPDeviceInfo *info, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task = g_task_new (info, cancellable, callback, user_data); + + gupnp_device_info_get_icon_async (info, + NULL, + PREFERED_DEPTH, + PREFERED_WIDTH, + PREFERED_HEIGHT, + TRUE, + cancellable, + on_got_icon, + task); +} + +GdkPixbuf * +update_icon_finish (GUPnPDeviceInfo *info, GAsyncResult *res, GError **error) { - GList *gets; + g_return_val_if_fail (g_task_is_valid (res, info), NULL); - for (gets = pending_gets; gets; gets = gets->next) { - GetIconURLData *data; - const char *udn1; - const char *udn2; - - data = gets->data; - udn1 = gupnp_device_info_get_udn (info); - udn2 = gupnp_device_info_get_udn (data->info); - - if (udn1 && udn2 && strcmp (udn1, udn2) == 0) { - soup_session_cancel_message (download_session, - data->message, - SOUP_STATUS_CANCELLED); - break; - } - } + return g_task_propagate_pointer (G_TASK (res), error); } GdkPixbuf * @@ -329,16 +269,6 @@ { int i; - while (pending_gets) { - GetIconURLData *data; - - data = pending_gets->data; - - soup_session_cancel_message (download_session, - data->message, - SOUP_STATUS_CANCELLED); - } - g_object_unref (download_session); for (i = 0; i < ICON_LAST; i++) { diff -Nru gupnp-tools-0.10.3/src/common/icons.h gupnp-tools-0.12.0/src/common/icons.h --- gupnp-tools-0.10.3/src/common/icons.h 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/common/icons.h 2022-10-11 21:00:49.000000000 +0000 @@ -46,15 +46,14 @@ ICON_LAST } IconID; -typedef void (* DeviceIconAvailableCallback) (GUPnPDeviceInfo *info, - GdkPixbuf *icon); - void -schedule_icon_update (GUPnPDeviceInfo *info, - DeviceIconAvailableCallback callback); +update_icon_async (GUPnPDeviceInfo *info, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); -void -unschedule_icon_update (GUPnPDeviceInfo *info); +GdkPixbuf * +update_icon_finish (GUPnPDeviceInfo *info, GAsyncResult *res, GError **error); GdkPixbuf * get_icon_by_id (IconID icon_id); diff -Nru gupnp-tools-0.10.3/src/common/meson.build gupnp-tools-0.12.0/src/common/meson.build --- gupnp-tools-0.10.3/src/common/meson.build 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/common/meson.build 2022-10-11 21:00:49.000000000 +0000 @@ -7,6 +7,6 @@ ) libutil = static_library('util', ['icons.c', 'icons.h', 'pretty-print.c', 'pretty-print.h'] + util_resource, - dependencies : [libxml, soup, gupnp, gtk]) + dependencies : [libxml, soup, gupnp, gtk, config_header]) util = declare_dependency(link_with: libutil, include_directories : include_directories('.')) diff -Nru gupnp-tools-0.10.3/src/common/pretty-print.c gupnp-tools-0.12.0/src/common/pretty-print.c --- gupnp-tools-0.10.3/src/common/pretty-print.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/common/pretty-print.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include "pretty-print.h" #include diff -Nru gupnp-tools-0.10.3/src/discover/gssdp-discover.c gupnp-tools-0.12.0/src/discover/gssdp-discover.c --- gupnp-tools-0.10.3/src/discover/gssdp-discover.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/discover/gssdp-discover.c 2022-10-11 21:00:49.000000000 +0000 @@ -21,6 +21,8 @@ * Boston, MA 02111-1307, USA. */ +#include + #include #include #include @@ -87,10 +89,6 @@ GOptionContext *context; GSSDPDiscover discover; -#if !GLIB_CHECK_VERSION(2, 35, 0) - g_type_init (); -#endif - context = g_option_context_new ("- discover devices using SSDP"); g_option_context_add_main_entries (context, entries, NULL); @@ -102,7 +100,11 @@ g_option_context_free (context); - discover.client = gssdp_client_new (interface, &error); + discover.client = gssdp_client_new_full (interface, + NULL, + 0, + GSSDP_UDA_VERSION_1_0, + &error); if (error != NULL) { g_warning ("Failed to create GSSDP client: %s", error->message); g_error_free (error); diff -Nru gupnp-tools-0.10.3/src/discover/meson.build gupnp-tools-0.12.0/src/discover/meson.build --- gupnp-tools-0.10.3/src/discover/meson.build 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/discover/meson.build 2022-10-11 21:00:49.000000000 +0000 @@ -1 +1 @@ -executable('gssdp-discover', ['gssdp-discover.c'], dependencies : [gssdp, gobject], install: true) +executable('gssdp-discover', ['gssdp-discover.c'], dependencies : [gssdp, gobject, config_header], install: true) diff -Nru gupnp-tools-0.10.3/src/event-dumper/event-dumper.c gupnp-tools-0.12.0/src/event-dumper/event-dumper.c --- gupnp-tools-0.10.3/src/event-dumper/event-dumper.c 1970-01-01 00:00:00.000000000 +0000 +++ gupnp-tools-0.12.0/src/event-dumper/event-dumper.c 2022-10-11 21:00:49.000000000 +0000 @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-FileCopyrightText: Copyright 2022 Jens Georg + +#include + +#include +#include +#include + +#include + +void +on_variable_notify (GUPnPServiceProxy *proxy, + const char *variable, + GValue *value, + gpointer user_data) +{ + g_autoptr (GDateTime) dt = g_date_time_new_now_local (); + g_autofree char *timestr = g_date_time_format_iso8601 (dt); + g_auto (GValue) v = G_VALUE_INIT; + g_value_init (&v, G_TYPE_STRING); + g_value_transform (value, &v); + + g_print ("%s|%s|%s|%s|%s\n", + timestr, + gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (user_data)), + gupnp_service_info_get_id (GUPNP_SERVICE_INFO (user_data)), + variable, + g_value_get_string (&v)); +} + +void +on_introspection (GObject *source, GAsyncResult *res, gpointer user_data) +{ + g_autoptr (GError) error = NULL; + + g_autoptr (GUPnPServiceIntrospection) is = + gupnp_service_info_introspect_finish ( + GUPNP_SERVICE_INFO (source), + res, + &error); + + g_autofree char *id = + gupnp_service_info_get_id (GUPNP_SERVICE_INFO (source)); + + if (error != NULL) { + g_warning ("Failed to introspect service proxy %s: %s", + id, + error->message); + + return; + } else { + g_info ("Got introspection for %s", id); + } + + const GList *state_variables = + gupnp_service_introspection_list_state_variables (is); + for (const GList *it = state_variables; it != NULL; + it = g_list_next (it)) { + GUPnPServiceStateVariableInfo *info = it->data; + if (not info->send_events) + continue; + + g_info ("Subscribing to %s (type: %s)", + info->name, + g_type_name (info->type)); + + gupnp_service_proxy_add_notify (GUPNP_SERVICE_PROXY (source), + info->name, + info->type, + on_variable_notify, + source); + } +} + +void +subscribe_to_proxy (GUPnPServiceProxy *sp, gpointer user_data) +{ + g_object_ref (sp); + g_autofree char *id = + gupnp_service_info_get_id (GUPNP_SERVICE_INFO (sp)); + + g_info ("Found new service proxy %s", id); + gupnp_service_info_introspect_async (GUPNP_SERVICE_INFO (sp), + NULL, + on_introspection, + NULL); + gupnp_service_proxy_set_subscribed (sp, TRUE); +} + +void +on_proxy_available (GUPnPControlPoint *cp, + GUPnPDeviceProxy *dp, + gpointer user_data) +{ + g_autofree char *id = + gupnp_device_info_get_friendly_name (GUPNP_DEVICE_INFO (dp)); + + g_info ("New device %s, type %s at %s", + id, + gupnp_device_info_get_device_type (GUPNP_DEVICE_INFO (dp)), + gupnp_device_info_get_location (GUPNP_DEVICE_INFO (dp))); + + GList *services = + gupnp_device_info_list_services (GUPNP_DEVICE_INFO (dp)); + + g_list_foreach ((GList *) services, (GFunc) subscribe_to_proxy, NULL); + + // Shallow-free the list, so we keep a reference to each service + g_list_free_full (services, (GDestroyNotify) g_object_unref); + + g_object_ref (dp); +} + +void +on_proxy_unavailable (GUPnPControlPoint *cp, + GUPnPDeviceProxy *dp, + gpointer user_data) +{ + g_autofree char *id = + gupnp_device_info_get_friendly_name (GUPNP_DEVICE_INFO (dp)); + + g_info ("Lost service proxy %s", id); + + // Dropping the reference we added in on_proxy_available + g_object_unref (dp); +} + +void +on_context_available (GUPnPContextManager *cm, + GUPnPContext *ctx, + gpointer user_data) +{ + + g_info ("New context: %s", + gssdp_client_get_host_ip (GSSDP_CLIENT (ctx))); + g_autoptr (GUPnPControlPoint) cp = + gupnp_control_point_new (ctx, "upnp:rootdevice"); + + g_signal_connect (cp, + "device-proxy-available", + G_CALLBACK (on_proxy_available), + NULL); + + g_signal_connect (cp, + "device-proxy-unavailable", + G_CALLBACK (on_proxy_unavailable), + NULL); + + gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE); + + gupnp_context_manager_manage_control_point (cm, cp); +} + +void +on_context_unavailable (GUPnPContextManager *cm, + GUPnPContext *ctx, + gpointer user_data) +{ + g_info ("Context gone: %s", + gssdp_client_get_host_ip (GSSDP_CLIENT (ctx))); +} + +int +main (int argc, char *argv[]) +{ + g_autoptr (GUPnPContextManager) cm = gupnp_context_manager_create (0); + g_autoptr (GMainLoop) loop = g_main_loop_new (NULL, FALSE); + + g_signal_connect (cm, + "context-available", + G_CALLBACK (on_context_available), + NULL); + + g_signal_connect (cm, + "context-unavailable", + G_CALLBACK (on_context_unavailable), + NULL); + + g_unix_signal_add (SIGINT, (GSourceFunc) g_main_loop_quit, loop); + g_unix_signal_add (SIGTERM, (GSourceFunc) g_main_loop_quit, loop); + + g_main_loop_run (loop); + + return 0; +} diff -Nru gupnp-tools-0.10.3/src/event-dumper/meson.build gupnp-tools-0.12.0/src/event-dumper/meson.build --- gupnp-tools-0.10.3/src/event-dumper/meson.build 1970-01-01 00:00:00.000000000 +0000 +++ gupnp-tools-0.12.0/src/event-dumper/meson.build 2022-10-11 21:00:49.000000000 +0000 @@ -0,0 +1 @@ +executable('gupnp-event-dumper', ['event-dumper.c'], dependencies : [gupnp, gobject, config_header], install: true) diff -Nru gupnp-tools-0.10.3/src/meson.build gupnp-tools-0.12.0/src/meson.build --- gupnp-tools-0.10.3/src/meson.build 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/meson.build 2022-10-11 21:00:49.000000000 +0000 @@ -8,3 +8,4 @@ subdir('discover') subdir('network-light') subdir('universal-cp') +subdir('event-dumper') diff -Nru gupnp-tools-0.10.3/src/network-light/gui.c gupnp-tools-0.12.0/src/network-light/gui.c --- gupnp-tools-0.10.3/src/network-light/gui.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/network-light/gui.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include -#ifdef HAVE_CONFIG_H -#include -#endif + #include #include "gui.h" diff -Nru gupnp-tools-0.10.3/src/network-light/main.c gupnp-tools-0.12.0/src/network-light/main.c --- gupnp-tools-0.10.3/src/network-light/main.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/network-light/main.c 2022-10-11 21:00:49.000000000 +0000 @@ -22,9 +22,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include #include diff -Nru gupnp-tools-0.10.3/src/network-light/upnp.c gupnp-tools-0.12.0/src/network-light/upnp.c --- gupnp-tools-0.10.3/src/network-light/upnp.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/network-light/upnp.c 2022-10-11 21:00:49.000000000 +0000 @@ -20,6 +20,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include #include @@ -28,10 +30,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #include "gui.h" #include "upnp.h" #include "main.h" @@ -197,7 +195,7 @@ get_status (), NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } G_MODULE_EXPORT @@ -212,7 +210,7 @@ get_status (), NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } G_MODULE_EXPORT @@ -228,7 +226,7 @@ G_TYPE_BOOLEAN, &status, NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); set_status (status); } @@ -267,7 +265,7 @@ get_load_level (), NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } G_MODULE_EXPORT @@ -282,7 +280,7 @@ get_load_level (), NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } G_MODULE_EXPORT @@ -298,7 +296,7 @@ G_TYPE_UINT, &load_level, NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); if (load_level > 100) load_level = 100; @@ -412,7 +410,7 @@ xmlNode *uuid_node; char *udn; - uuid = gupnp_get_uuid (); + uuid = g_uuid_string_random (); const xmlDoc *xml_doc = gupnp_xml_doc_get_doc (doc); uuid_node = xml_util_get_element ((xmlNode *) xml_doc, @@ -776,7 +774,7 @@ gboolean init_upnp (gchar **interfaces, guint port, gchar *name, gboolean ipv4, gboolean ipv6) { - GUPnPWhiteList *white_list; + GUPnPContextFilter *context_filter; switch_proxies = NULL; dimming_proxies = NULL; @@ -809,10 +807,10 @@ g_assert (context_manager != NULL); if (interfaces != NULL) { - white_list = gupnp_context_manager_get_white_list - (context_manager); - gupnp_white_list_add_entryv (white_list, interfaces); - gupnp_white_list_set_enabled (white_list, TRUE); + context_filter = gupnp_context_manager_get_context_filter ( + context_manager); + gupnp_context_filter_add_entryv (context_filter, interfaces); + gupnp_context_filter_set_enabled (context_filter, TRUE); } g_signal_connect (context_manager, diff -Nru gupnp-tools-0.10.3/src/universal-cp/action-dialog.c gupnp-tools-0.12.0/src/universal-cp/action-dialog.c --- gupnp-tools-0.10.3/src/universal-cp/action-dialog.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/action-dialog.c 2022-10-11 21:00:49.000000000 +0000 @@ -20,13 +20,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include @@ -421,8 +419,10 @@ introspection, arg_info->related_state_variable); - if (arg_info->direction == GUPNP_SERVICE_ACTION_ARG_DIRECTION_OUT) + if (arg_info->direction == GUPNP_SERVICE_ACTION_ARG_DIRECTION_OUT) { + *value = NULL; return arg_info->name; + } *value = g_slice_alloc0 (sizeof (GValue)); g_value_init (*value, variable_info->type); diff -Nru gupnp-tools-0.10.3/src/universal-cp/details-treeview.c gupnp-tools-0.12.0/src/universal-cp/details-treeview.c --- gupnp-tools-0.10.3/src/universal-cp/details-treeview.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/details-treeview.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + +#include +#include #include #include @@ -310,7 +309,7 @@ show_service_details (GUPnPServiceInfo *info) { char *details[32]; - const SoupURI *uri; + const GUri *uri; const char *str; int i = 0; @@ -332,7 +331,7 @@ details[i++] = _("Base URL"); uri = gupnp_service_info_get_url_base (info); if (uri) - details[i++] = soup_uri_to_string ((SoupURI *) uri, FALSE); + details[i++] = g_uri_to_string ((GUri *) uri); details[i++] = _("Service ID"); details[i++] = gupnp_service_info_get_id (info); @@ -357,7 +356,7 @@ show_device_details (GUPnPDeviceInfo *info) { char *details[32]; - const SoupURI *uri; + const GUri *uri; const char *str; int i = 0; @@ -379,7 +378,7 @@ details[i++] = _("Base URL"); uri = gupnp_device_info_get_url_base (info); if (uri) - details[i++] = soup_uri_to_string ((SoupURI *) uri, FALSE); + details[i++] = g_uri_to_string ((GUri *) uri); details[i++] = _("Friendly Name"); details[i++] = gupnp_device_info_get_friendly_name (info); diff -Nru gupnp-tools-0.10.3/src/universal-cp/device-treeview.c gupnp-tools-0.12.0/src/universal-cp/device-treeview.c --- gupnp-tools-0.10.3/src/universal-cp/device-treeview.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/device-treeview.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + +#include +#include #include #include @@ -324,7 +323,16 @@ return; if (find_device (model, udn, &root_iter, &iter)) { - unschedule_icon_update (info); + GCancellable *cancellable = + g_object_get_data (G_OBJECT (info), + "icon-download-cancellable"); + if (cancellable != NULL) { + g_cancellable_cancel (cancellable); + + g_object_set_data (G_OBJECT (info), + "icon-download-cancellable", + NULL); + } gtk_tree_store_remove (GTK_TREE_STORE (model), &iter); } } @@ -380,13 +388,21 @@ } static void -on_device_icon_available (GUPnPDeviceInfo *info, - GdkPixbuf *icon) +on_device_icon_available (GObject *source, + GAsyncResult *res, + gpointer user_data) { GtkTreeModel *model; GtkTreeIter root_iter; GtkTreeIter device_iter; const char *udn; + g_autoptr (GError) error = NULL; + g_autoptr (GdkPixbuf) icon = NULL; + + icon = update_icon_finish (GUPNP_DEVICE_INFO (source), res, &error); + if (error != NULL) { + g_debug ("Failed to download icon: %s", error->message); + } // There was no icon or there was an error getting that // icon. Just keep the default then @@ -394,21 +410,22 @@ return; } - model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (user_data)); g_assert (model != NULL); - udn = gupnp_device_info_get_udn (info); + udn = gupnp_device_info_get_udn (GUPNP_DEVICE_INFO (source)); if (!gtk_tree_model_get_iter_first (model, &root_iter)) return; - if (find_device (model, udn, &root_iter, &device_iter)) + if (find_device (model, udn, &root_iter, &device_iter)) { + g_object_set_data (source, "icon-download-cancellable", NULL); + gtk_tree_store_set (GTK_TREE_STORE (model), &device_iter, 0, icon, -1); - - g_clear_object (&icon); + } } static void @@ -553,20 +570,24 @@ } static void -got_introspection (GUPnPServiceInfo *info, - GUPnPServiceIntrospection *introspection, - const GError *error, - gpointer user_data) +got_introspection (GObject *source, GAsyncResult *res, gpointer user_data) { GtkTreeModel *model; GtkTreeIter *service_iter; + GError *error = NULL; + + GUPnPServiceIntrospection *introspection = + gupnp_service_info_introspect_finish ( + GUPNP_SERVICE_INFO (source), + res, + &error); service_iter = (GtkTreeIter *) user_data; model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); g_assert (model != NULL); - append_introspection (GUPNP_SERVICE_PROXY (info), + append_introspection (GUPNP_SERVICE_PROXY (source), introspection, GTK_TREE_STORE (model), service_iter); @@ -576,7 +597,9 @@ g_object_unref (introspection); /* Services are subscribed to by default */ - gupnp_service_proxy_set_subscribed (GUPNP_SERVICE_PROXY (info), TRUE); + gupnp_service_proxy_set_subscribed ( + GUPNP_SERVICE_PROXY (source), + TRUE); } } @@ -602,9 +625,10 @@ 5, ICON_SERVICE, -1); - gupnp_service_info_get_introspection_async (info, - got_introspection, - service_iter); + gupnp_service_info_introspect_async (info, + NULL, + got_introspection, + service_iter); g_free (id); } @@ -621,6 +645,7 @@ if (friendly_name) { GtkTreeIter device_iter; GList *child; + GCancellable *cancellable = g_cancellable_new (); gtk_tree_store_insert_with_values (GTK_TREE_STORE (model), @@ -632,7 +657,14 @@ -1); g_free (friendly_name); - schedule_icon_update (info, on_device_icon_available); + g_object_set_data_full (G_OBJECT (info), + "icon-download-cancellable", + cancellable, + g_object_unref); + update_icon_async (info, + cancellable, + on_device_icon_available, + treeview); /* Append the embedded devices */ child = gupnp_device_info_list_devices (info); diff -Nru gupnp-tools-0.10.3/src/universal-cp/event-treeview.c gupnp-tools-0.12.0/src/universal-cp/event-treeview.c --- gupnp-tools-0.10.3/src/universal-cp/event-treeview.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/event-treeview.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + +#include +#include #include #include @@ -309,11 +308,7 @@ if (size > MAX_VALUE_SIZE) size = MAX_VALUE_SIZE; -#if GLIB_CHECK_VERSION(2,68,0) display_value = g_memdup2 (value, size + 1); -#else - display_value = g_memdup (value, size + 1); -#endif display_value[size] = '\0'; return display_value; diff -Nru gupnp-tools-0.10.3/src/universal-cp/gui.c gupnp-tools-0.12.0/src/universal-cp/gui.c --- gupnp-tools-0.10.3/src/universal-cp/gui.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/gui.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,11 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#ifdef HAVE_CONFIG_H #include -#endif + +#include +#include #include diff -Nru gupnp-tools-0.10.3/src/universal-cp/main.c gupnp-tools-0.12.0/src/universal-cp/main.c --- gupnp-tools-0.10.3/src/universal-cp/main.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/universal-cp/main.c 2022-10-11 21:00:49.000000000 +0000 @@ -20,9 +20,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include "gui.h" diff -Nru gupnp-tools-0.10.3/src/upload/container-search.c gupnp-tools-0.12.0/src/upload/container-search.c --- gupnp-tools-0.10.3/src/upload/container-search.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/upload/container-search.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include #include @@ -74,9 +76,9 @@ static void browse_cb (GObject *object, GAsyncResult *res, gpointer user_data) { - GError *error = NULL; - char *result = NULL; - char *container_id = NULL; + g_autoptr (GError) error = NULL; + g_autofree char *result = NULL; + g_autofree char *container_id = NULL; GUPnPServiceProxyAction *action = NULL; GUPnPServiceProxy *proxy = GUPNP_SERVICE_PROXY (object); @@ -85,9 +87,6 @@ if (error != NULL) { g_critical ("Failed to browse root container: %s", error->message); - - g_error_free (error); - application_exit (); return; @@ -102,9 +101,6 @@ if (error != NULL) { g_critical ("Failed to browse root container: %s", error->message); - - g_error_free (error); - application_exit (); return; @@ -115,17 +111,11 @@ container_id = parse_result (result); if (container_id == NULL) { g_critical ("Failed to find a suitable container for upload."); - g_free (result); application_exit (); - - return; } else { container_found (container_id); - g_free (container_id); } - - g_free (result); } void diff -Nru gupnp-tools-0.10.3/src/upload/control_point.c gupnp-tools-0.12.0/src/upload/control_point.c --- gupnp-tools-0.10.3/src/upload/control_point.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/upload/control_point.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include #include diff -Nru gupnp-tools-0.10.3/src/upload/item-creation.c gupnp-tools-0.12.0/src/upload/item-creation.c --- gupnp-tools-0.10.3/src/upload/item-creation.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/upload/item-creation.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include #include diff -Nru gupnp-tools-0.10.3/src/upload/main.c gupnp-tools-0.12.0/src/upload/main.c --- gupnp-tools-0.10.3/src/upload/main.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/upload/main.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,12 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include -#include #include -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include "control_point.h" #include "item-creation.h" @@ -134,13 +133,9 @@ main (gint argc, gchar *argv[]) { - GError *error = NULL; + g_autoptr (GError) error = NULL; gint i; - GOptionContext *context; - -#if !GLIB_CHECK_VERSION(2, 35, 0) - g_type_init (); -#endif + g_autoptr (GOptionContext) context; context = g_option_context_new ("- Upload files to UPnP MediaServer"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); @@ -151,11 +146,10 @@ } if (argc < 2) { - char *help = NULL; + g_autofree char *help = NULL; help = g_option_context_get_help (context, TRUE, NULL); g_print ("%s\n", help); - g_free (help); return -4; } @@ -181,11 +175,14 @@ } error = NULL; - upnp_context = gupnp_context_new (interface, 0, &error); + upnp_context = gupnp_context_new_full (interface, + NULL, + 0, + GSSDP_UDA_VERSION_1_0, + &error); if (error) { g_printerr ("Error creating the GUPnP context: %s\n", - error->message); - g_error_free (error); + error->message); return -6; } @@ -206,7 +203,6 @@ g_clear_pointer (&main_loop, g_main_loop_unref); deinit_control_point (); g_object_unref (upnp_context); - g_option_context_free (context); g_free (dest_container); g_free (interface); diff -Nru gupnp-tools-0.10.3/src/upload/transfer.c gupnp-tools-0.12.0/src/upload/transfer.c --- gupnp-tools-0.10.3/src/upload/transfer.c 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/src/upload/transfer.c 2022-10-11 21:00:49.000000000 +0000 @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include #include #include @@ -40,15 +42,14 @@ GAsyncResult *result, gpointer user_data) { - GError *error; + g_autoptr (GError) error = NULL; TrackTransferData *data; - guint64 total, length; - gchar *status; + guint64 total = 0, length = 0; + g_autofree gchar *status = NULL; GUPnPServiceProxyAction *action; data = (TrackTransferData *) user_data; - error = NULL; total = length = 0; status = NULL; action = gupnp_service_proxy_call_action_finish ( @@ -58,6 +59,7 @@ if (error == NULL) { gupnp_service_proxy_action_get_result (action, &error, NULL); } + if (error != NULL) { g_critical ("Failed to track file transfer: %s", error->message); diff -Nru gupnp-tools-0.10.3/subprojects/gssdp-1.2.wrap gupnp-tools-0.12.0/subprojects/gssdp-1.2.wrap --- gupnp-tools-0.10.3/subprojects/gssdp-1.2.wrap 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/subprojects/gssdp-1.2.wrap 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -[wrap-git] -url = https://gitlab.gnome.org/GNOME/gssdp.git -revision = gssdp-1.4 -depth = 1 - -[provides] -dependency_name = gssdp-1.2 - diff -Nru gupnp-tools-0.10.3/subprojects/gssdp-1.6.wrap gupnp-tools-0.12.0/subprojects/gssdp-1.6.wrap --- gupnp-tools-0.10.3/subprojects/gssdp-1.6.wrap 1970-01-01 00:00:00.000000000 +0000 +++ gupnp-tools-0.12.0/subprojects/gssdp-1.6.wrap 2022-10-11 21:00:49.000000000 +0000 @@ -0,0 +1,8 @@ +[wrap-git] +url = https://gitlab.gnome.org/GNOME/gssdp.git +revision = master +depth = 1 + +[provides] +dependency_name = gssdp-1.2 + diff -Nru gupnp-tools-0.10.3/subprojects/gupnp-1.2.wrap gupnp-tools-0.12.0/subprojects/gupnp-1.2.wrap --- gupnp-tools-0.10.3/subprojects/gupnp-1.2.wrap 2022-05-20 08:13:50.000000000 +0000 +++ gupnp-tools-0.12.0/subprojects/gupnp-1.2.wrap 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -[wrap-git] -url = https://gitlab.gnome.org/GNOME/gupnp.git -revision = gupnp-1.4 -depth = 1 - -[provides] -dependency_name = gupnp-1.2 - diff -Nru gupnp-tools-0.10.3/subprojects/gupnp-1.6.wrap gupnp-tools-0.12.0/subprojects/gupnp-1.6.wrap --- gupnp-tools-0.10.3/subprojects/gupnp-1.6.wrap 1970-01-01 00:00:00.000000000 +0000 +++ gupnp-tools-0.12.0/subprojects/gupnp-1.6.wrap 2022-10-11 21:00:49.000000000 +0000 @@ -0,0 +1,8 @@ +[wrap-git] +url = https://gitlab.gnome.org/GNOME/gupnp.git +revision = master +depth = 1 + +[provides] +dependency_name = gupnp-1.2 +