| 1 | From e70dcd0a9f89efbdaa011c20737ad550635ea580 Mon Sep 17 00:00:00 2001
|
| 2 | From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <[email protected]>
|
| 3 | Date: Tue, 20 Oct 2020 19:51:22 -0400
|
| 4 | Subject: [PATCH] rawudp-upnp test: Also build against new GUPnP 1.2 library if
|
| 5 | present
|
| 6 |
|
| 7 | Update the configure test to match
|
| 8 | ---
|
| 9 | configure.ac | 17 +++++++++++++++++
|
| 10 | tests/check/Makefile.am | 7 +++----
|
| 11 | tests/check/transmitter/rawudp-upnp.c | 16 ++++++++++++++--
|
| 12 | tests/check/transmitter/rawudp.c | 4 ++--
|
| 13 | 4 files changed, 36 insertions(+), 8 deletions(-)
|
| 14 |
|
| 15 | diff --git a/configure.ac b/configure.ac
|
| 16 | index 03afc96b..1efed132 100644
|
| 17 | |
| 18 | |
| 19 | @@ -370,8 +370,25 @@ fi
|
| 20 |
|
| 21 | if test "x$HAVE_GUPNP" = "xyes"; then
|
| 22 | AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
|
| 23 | +
|
| 24 | + PKG_CHECK_MODULES(GUPNP_CORE, [ gupnp-1.2 ],
|
| 25 | + [ HAVE_GUPNP_CORE_12=yes ],
|
| 26 | + [ HAVE_GUPNP_CORE_12=no
|
| 27 | + PKG_CHECK_MODULES(GUPNP_CORE, [ gupnp-1.0 ],
|
| 28 | + [ HAVE_GUPNP_CORE_10=yes ],
|
| 29 | + [ HAVE_GUPNP_CORE_10=no ])
|
| 30 | + ])
|
| 31 | +
|
| 32 | + if test "x$HAVE_GUPNP_CORE_10" = "xyes"; then
|
| 33 | + AC_DEFINE(HAVE_GUPNP_CORE_10,,[Have the GUPnP 1.0 library])
|
| 34 | + fi
|
| 35 | +
|
| 36 | + if test "x$HAVE_GUPNP_CORE_12" = "xyes"; then
|
| 37 | + AC_DEFINE(HAVE_GUPNP_CORE_12,,[Have the GUPnP 1.2 library])
|
| 38 | + fi
|
| 39 | fi
|
| 40 |
|
| 41 | +
|
| 42 | dnl build static plugins or not
|
| 43 | AC_MSG_CHECKING([whether to build static plugins or not])
|
| 44 | AC_ARG_ENABLE(
|
| 45 | diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
|
| 46 | index d50fc264..d21687d7 100644
|
| 47 | |
| 48 | |
| 49 | @@ -76,9 +76,9 @@ base_fscodec_SOURCES = \
|
| 50 |
|
| 51 |
|
| 52 | transmitter_rawudp_CFLAGS = $(AM_CFLAGS) \
|
| 53 | - $(GUPNP_CFLAGS) $(GIO_CFLAGS) $(NICE_CFLAGS)
|
| 54 | + $(GUPNP_CORE_CFLAGS) $(GIO_CFLAGS) $(NICE_CFLAGS)
|
| 55 | transmitter_rawudp_LDADD = $(LDADD) \
|
| 56 | - $(GUPNP_LIBS) \
|
| 57 | + $(GUPNP_CORE_LIBS) \
|
| 58 | $(GIO_LIBS) \
|
| 59 | $(NICE_LIBS)
|
| 60 | transmitter_rawudp_SOURCES = \
|
| 61 | @@ -113,9 +113,8 @@ transmitter_nice_SOURCES = \
|
| 62 | transmitter_nice_LDADD = $(LDADD) $(GST_BASE_LIBS)
|
| 63 |
|
| 64 |
|
| 65 | -transmitter_shm_CFLAGS = $(AM_CFLAGS) $(GUPNP_CFLAGS) $(NICE_CFLAGS)
|
| 66 | +transmitter_shm_CFLAGS = $(AM_CFLAGS) $(NICE_CFLAGS)
|
| 67 | transmitter_shm_LDADD = $(LDADD) \
|
| 68 | - $(GUPNP_LIBS) \
|
| 69 | $(NICE_LIBS)
|
| 70 | transmitter_shm_SOURCES = \
|
| 71 | check-threadsafe.h \
|
| 72 | diff --git a/tests/check/transmitter/rawudp-upnp.c b/tests/check/transmitter/rawudp-upnp.c
|
| 73 | index 4818cd28..9ccf85d8 100644
|
| 74 | |
| 75 | |
| 76 | @@ -37,7 +37,7 @@ get_vars (gboolean *out_got_address,
|
| 77 | }
|
| 78 |
|
| 79 |
|
| 80 | -#ifdef HAVE_GUPNP
|
| 81 | +#if defined(HAVE_GUPNP_CORE_10) || defined(HAVE_GUPNP_CORE_12)
|
| 82 |
|
| 83 | #include <libgupnp/gupnp.h>
|
| 84 |
|
| 85 | @@ -126,8 +126,14 @@ start_upnp_server (void)
|
| 86 | GUPnPDeviceInfo *subdev1;
|
| 87 | GUPnPDeviceInfo *subdev2;
|
| 88 | const gchar *upnp_xml_path;
|
| 89 | + GError *gerr = NULL;
|
| 90 |
|
| 91 | - context = gupnp_context_new (NULL, NULL, 0, NULL);
|
| 92 | +#ifdef HAVE_GUPNP_CORE_12
|
| 93 | + context = gupnp_context_new (NULL, 0, &gerr);
|
| 94 | +#else
|
| 95 | + context = gupnp_context_new (NULL, NULL, 0, &gerr);
|
| 96 | +#endif
|
| 97 | + g_assert_no_error (gerr);
|
| 98 | ts_fail_if (context == NULL, "Can't get gupnp context");
|
| 99 |
|
| 100 | if (g_getenv ("UPNP_XML_PATH"))
|
| 101 | @@ -137,8 +143,14 @@ start_upnp_server (void)
|
| 102 |
|
| 103 | gupnp_context_host_path (context, upnp_xml_path, "");
|
| 104 |
|
| 105 | +#ifdef HAVE_GUPNP_CORE_12
|
| 106 | + dev = gupnp_root_device_new (context, "InternetGatewayDevice.xml",
|
| 107 | + upnp_xml_path, &gerr);
|
| 108 | + g_assert_no_error (gerr);
|
| 109 | +#else
|
| 110 | dev = gupnp_root_device_new (context, "InternetGatewayDevice.xml",
|
| 111 | upnp_xml_path);
|
| 112 | +#endif
|
| 113 | ts_fail_if (dev == NULL, "could not get root dev");
|
| 114 |
|
| 115 | subdev1 = gupnp_device_info_get_device (GUPNP_DEVICE_INFO (dev),
|
| 116 | diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
|
| 117 | index e1936ac0..d803f347 100644
|
| 118 | |
| 119 | |
| 120 | @@ -637,7 +637,7 @@ GST_START_TEST (test_rawudptransmitter_stop_stream)
|
| 121 | }
|
| 122 | GST_END_TEST;
|
| 123 |
|
| 124 | -#ifdef HAVE_GUPNP
|
| 125 | +#if defined(HAVE_GUPNP_CORE_10) || defined (HAVE_GUPNP_CORE_12)
|
| 126 |
|
| 127 | GST_START_TEST (test_rawudptransmitter_run_upnp_discovery)
|
| 128 | {
|
| 129 | @@ -967,7 +967,7 @@ rawudptransmitter_suite (void)
|
| 130 | tcase_add_test (tc_chain, test_rawudptransmitter_stop_stream);
|
| 131 | suite_add_tcase (s, tc_chain);
|
| 132 |
|
| 133 | -#ifdef HAVE_GUPNP
|
| 134 | +#if defined(HAVE_GUPNP_CORE_10) || defined (HAVE_GUPNP_CORE_12)
|
| 135 | if (g_getenv ("UPNP")) {
|
| 136 | gchar *multicast_addr;
|
| 137 |
|
| 138 | --
|
| 139 | GitLab
|
| 140 |
|