+++ /dev/null
-From 26f884bf977977041fe6f98a0af186be1580bf22 Mon Sep 17 00:00:00 2001
-From: Simon Morlat <simon.morlat@linphone.org>
-Date: Thu, 29 Sep 2016 15:26:18 +0200
-Subject: [PATCH] fix compilation issue with latest bctoobox
-
-[Upstream commit https://github.com/BelledonneCommunications/mediastreamer2/commit/26f884bf977977041fe6f98a0af186be1580bf22]
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- configure.ac | 2 +-
- src/crypto/dtls_srtp.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 7ab20a08f..244d87275 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1116,7 +1116,7 @@ fi
-
-
- dnl check bctoolbox library
--PKG_CHECK_MODULES(BCTOOLBOX, bctoolbox >= 0.0.0, found_bctoolbox=true, found_bctoolbox=false)
-+PKG_CHECK_MODULES(BCTOOLBOX, bctoolbox >= 0.4.0, found_bctoolbox=true, found_bctoolbox=false)
- if test "$found_bctoolbox" = "true" ; then
- LIBS="$LIBS $BCTOOLBOX_LIBS"
- CFLAGS="$CFLAGS $BCTOOLBOX_CFLAGS"
-diff --git a/src/crypto/dtls_srtp.c b/src/crypto/dtls_srtp.c
-index e2c8e1c44..fd37eb5cb 100644
---- a/src/crypto/dtls_srtp.c
-+++ b/src/crypto/dtls_srtp.c
-@@ -705,7 +705,7 @@ static int ms_dtls_srtp_initialise_bctbx_dtls_context(DtlsBcToolBoxContext *dtls
- bctbx_ssl_config_set_authmode(dtlsContext->ssl_config, BCTBX_SSL_VERIFY_OPTIONAL);
- bctbx_ssl_config_set_own_cert( dtlsContext->ssl_config, dtlsContext->crt, dtlsContext->pkey );
- /* This is useless as peer would certainly be a self signed certificate and we won't verify it but avoid runtime warnings */
-- bctbx_ssl_config_set_ca_chain(dtlsContext->ssl_config, dtlsContext->crt, NULL);
-+ bctbx_ssl_config_set_ca_chain(dtlsContext->ssl_config, dtlsContext->crt);
-
- /* we are not ready yet to actually start the ssl context, this will be done by calling bctbx_ssl_setup when stream starts */
- return 0;
--- /dev/null
+From 342f59f1603f759b6dd90754f8dba14d08947f55 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 27 Feb 2020 16:18:35 +0100
+Subject: [PATCH] src/videofilters/nowebcam.c: fix build without ffmpeg or jpeg
+
+jpeg2yuv is only defined if ffmpeg or turbojpeg is available
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ CMakeLists.txt | 3 +++
+ src/videofilters/nowebcam.c | 4 ++++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0efc1a5f..6668db2b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -336,7 +336,10 @@ if(ENABLE_JPEG)
+ if(NOT TURBOJPEG_FOUND)
+ message(WARNING "Could not find libturbo-jpeg, mediastreamer2 will be compiled without LibJpeg-Turbo")
+ set(ENABLE_JPEG OFF CACHE BOOL "Enable JPEG support" FORCE)
++ add_definitions(-DNO_JPEG)
+ endif()
++else()
++ add_definitions(-DNO_JPEG)
+ endif()
+ if(ENABLE_QRCODE)
+ find_package(Zxing)
+diff --git a/src/videofilters/nowebcam.c b/src/videofilters/nowebcam.c
+index a2344dcd..afb0d7b1 100644
+--- a/src/videofilters/nowebcam.c
++++ b/src/videofilters/nowebcam.c
+@@ -107,7 +107,9 @@ static mblk_t *_ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize) {
+ if (err != st_sizel) {
+ ms_error("Could not read as much as wanted !");
+ }
++#if !(defined(NO_FFMPEG) && defined(NO_JPEG))
+ m = jpeg2yuv(jpgbuf, st_sizel, reqsize);
++#endif
+ ms_free(jpgbuf);
+ if (m == NULL) {
+ CloseHandle(fd);
+@@ -140,7 +142,9 @@ static mblk_t *_ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize) {
+ if (err != statbuf.st_size) {
+ ms_error("Could not read as much as wanted: %i<>%li !", err, (long)statbuf.st_size);
+ }
++#if !(defined(NO_FFMPEG) && defined(NO_JPEG))
+ m = jpeg2yuv(jpgbuf,statbuf.st_size,reqsize);
++#endif
+ ms_free(jpgbuf);
+ if (m == NULL) {
+ close(fd);
+--
+2.25.0
+
#
################################################################################
-MEDIASTREAMER_VERSION = 2.14.0
-MEDIASTREAMER_SITE = http://download.savannah.nongnu.org/releases/linphone/mediastreamer
+MEDIASTREAMER_VERSION = 4.3.1
+MEDIASTREAMER_SITE = \
+ https://gitlab.linphone.org/BC/public/mediastreamer2/-/archive/$(MEDIASTREAMER_VERSION)
+MEDIASTREAMER_LICENSE = GPL-3.0+
+MEDIASTREAMER_LICENSE_FILES = LICENSE.txt
MEDIASTREAMER_INSTALL_STAGING = YES
-# host-vim needed for the xxd utility
-MEDIASTREAMER_DEPENDENCIES = host-intltool host-pkgconf ortp host-gettext host-vim
-# tests fail linking on some architectures, so disable them
-MEDIASTREAMER_CONF_OPTS = --disable-tests --disable-glx --disable-strict
-MEDIASTREAMER_LICENSE = GPL-2.0+
-MEDIASTREAMER_LICENSE_FILES = COPYING
-
-# patching configure.ac
-MEDIASTREAMER_AUTORECONF = YES
+MEDIASTREAMER_DEPENDENCIES = ortp
+MEDIASTREAMER_CONF_OPTS = \
+ -DENABLE_DOC=OFF \
+ -DENABLE_GL=OFF \
+ -DENABLE_GLX=OFF \
+ -DENABLE_MKV=OFF \
+ -DENABLE_SOUND=OFF \
+ -DENABLE_STRICT=OFF \
+ -DENABLE_TOOLS=OFF \
+ -DENABLE_UNIT_TESTS=OFF \
+ -DENABLE_ZRTP=OFF
ifeq ($(BR2_PACKAGE_ALSA_LIB_MIXER)$(BR2_PACKAGE_ALSA_LIB_PCM),yy)
-MEDIASTREAMER_CONF_OPTS += --enable-alsa
+MEDIASTREAMER_CONF_OPTS += \
+ -DENABLE_ALSA=ON \
+ -DENABLE_SOUND=ON
MEDIASTREAMER_DEPENDENCIES += alsa-lib
else
-MEDIASTREAMER_CONF_OPTS += --disable-alsa
+MEDIASTREAMER_CONF_OPTS += -DENABLE_ALSA=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_BCG729),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_G729=ON
+MEDIASTREAMER_DEPENDENCIES += bcg729
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_G729=OFF
endif
-ifeq ($(BR2_PACKAGE_LIBUPNP),y)
-MEDIASTREAMER_CONF_OPTS += --enable-upnp
-MEDIASTREAMER_DEPENDENCIES += libupnp
+ifeq ($(BR2_PACKAGE_JPEG_TURBO),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_JPEG=ON
+MEDIASTREAMER_DEPENDENCIES += jpeg
else
-MEDIASTREAMER_CONF_OPTS += --disable-upnp
+MEDIASTREAMER_CONF_OPTS += -DENABLE_JPEG=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGSM),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_GSM=ON
+MEDIASTREAMER_DEPENDENCIES += libgsm
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_GSM=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBPCAP),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_PCAP=ON
+MEDIASTREAMER_DEPENDENCIES += libpcap
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_PCAP=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSRTP),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SRTP=ON
+MEDIASTREAMER_DEPENDENCIES += libsrtp
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SRTP=OFF
endif
ifeq ($(BR2_PACKAGE_LIBVPX),y)
-MEDIASTREAMER_CONF_OPTS += --enable-vp8
+MEDIASTREAMER_CONF_OPTS += -DENABLE_VPX=ON
MEDIASTREAMER_DEPENDENCIES += libvpx
else
-MEDIASTREAMER_CONF_OPTS += --disable-vp8
+MEDIASTREAMER_CONF_OPTS += -DENABLE_VPX=OFF
endif
ifeq ($(BR2_PACKAGE_OPUS),y)
-MEDIASTREAMER_CONF_OPTS += --enable-opus
+MEDIASTREAMER_CONF_OPTS += -DENABLE_OPUS=ON
MEDIASTREAMER_DEPENDENCIES += opus
else
-MEDIASTREAMER_CONF_OPTS += --disable-opus
+MEDIASTREAMER_CONF_OPTS += -DENABLE_OPUS=OFF
endif
-# portaudio backend needs speex as well
-ifeq ($(BR2_PACKAGE_PORTAUDIO)$(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yyy)
-MEDIASTREAMER_CONF_OPTS += --enable-portaudio
-MEDIASTREAMER_DEPENDENCIES += portaudio speex
+ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
+MEDIASTREAMER_CONF_OPTS += \
+ -DENABLE_PORTAUDIO=ON \
+ -DENABLE_SOUND=ON
+MEDIASTREAMER_DEPENDENCIES += portaudio
else
-MEDIASTREAMER_CONF_OPTS += --disable-portaudio
+MEDIASTREAMER_CONF_OPTS += -DENABLE_PORTAUDIO=OFF
endif
ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
-MEDIASTREAMER_CONF_OPTS += --enable-pulseaudio
+MEDIASTREAMER_CONF_OPTS += \
+ -DENABLE_PULSEAUDIO=ON \
+ -DENABLE_SOUND=ON
MEDIASTREAMER_DEPENDENCIES += pulseaudio
else
-MEDIASTREAMER_CONF_OPTS += --disable-pulseaudio
+MEDIASTREAMER_CONF_OPTS += -DENABLE_PULSEAUDIO=OFF
endif
-ifeq ($(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yy)
-MEDIASTREAMER_CONF_OPTS += --enable-speex
+ifeq ($(BR2_PACKAGE_SPEEX),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SPEEX_CODEC=ON
MEDIASTREAMER_DEPENDENCIES += speex
else
-MEDIASTREAMER_CONF_OPTS += --disable-speex
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SPEEX_CODEC=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SPEEXDSP),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SPEEX_DSP=ON
+MEDIASTREAMER_DEPENDENCIES += speexdsp
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SPEEX_DSP=OFF
endif
ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
-MEDIASTREAMER_CONF_OPTS += --enable-ffmpeg
+MEDIASTREAMER_CONF_OPTS += -DENABLE_FFMPEG=ON
MEDIASTREAMER_DEPENDENCIES += ffmpeg
else
-MEDIASTREAMER_CONF_OPTS += --disable-ffmpeg
+MEDIASTREAMER_CONF_OPTS += -DENABLE_FFMPEG=OFF
endif
ifeq ($(BR2_PACKAGE_SDL),y)
-MEDIASTREAMER_CONF_OPTS += --enable-sdl
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SDL=ON
MEDIASTREAMER_DEPENDENCIES += sdl
else
-MEDIASTREAMER_CONF_OPTS += --disable-sdl
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SDL=OFF
endif
-# mediastreamer assumes SDL has X11 support if --enable-x11 (and X11 support
-# is only used for SDL output)
-ifeq ($(BR2_PACKAGE_SDL_X11),y)
-MEDIASTREAMER_CONF_OPTS += --enable-x11
+ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_X11=ON
+MEDIASTREAMER_DEPENDENCIES += xlib_libX11
else
-MEDIASTREAMER_CONF_OPTS += --disable-x11
+MEDIASTREAMER_CONF_OPTS += -DENABLE_X11=OFF
endif
ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
-MEDIASTREAMER_CONF_OPTS += --enable-xv
+MEDIASTREAMER_CONF_OPTS += -DENABLE_XV=ON
MEDIASTREAMER_DEPENDENCIES += xlib_libXv
else
-MEDIASTREAMER_CONF_OPTS += --disable-xv
+MEDIASTREAMER_CONF_OPTS += -DENABLE_XV=OFF
endif
ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
-MEDIASTREAMER_CONF_OPTS += --enable-theora
+MEDIASTREAMER_CONF_OPTS += -DENABLE_THEORA=ON
MEDIASTREAMER_DEPENDENCIES += libtheora
else
-MEDIASTREAMER_CONF_OPTS += --disable-theora
+MEDIASTREAMER_CONF_OPTS += -DENABLE_THEORA=OFF
endif
ifeq ($(BR2_PACKAGE_LIBV4L),y)
-MEDIASTREAMER_CONF_OPTS += --enable-libv4l1 --enable-libv4l2
+MEDIASTREAMER_CONF_OPTS += -DENABLE_V4L=ON
MEDIASTREAMER_DEPENDENCIES += libv4l
else
-MEDIASTREAMER_CONF_OPTS += --disable-libv4l1 --disable-libv4l2
+MEDIASTREAMER_CONF_OPTS += -DENABLE_V4L=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZXING_CPP),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_QRCODE=ON
+MEDIASTREAMER_DEPENDENCIES += zxing-cpp
+else
+MEDIASTREAMER_CONF_OPTS += -DENABLE_QRCODE=OFF
+endif
+
+ifeq ($(BR2_STATIC_LIBS),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SHARED=OFF -DENABLE_STATIC=ON
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=ON
+else ifeq ($(BR2_SHARED_LIBS),y)
+MEDIASTREAMER_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=OFF
endif
-$(eval $(autotools-package))
+$(eval $(cmake-package))