--- /dev/null
+diff -u -r mediastreamer2-2.16.1/configure.ac mediastreamer2-2.16.1-libsrtp2/configure.ac
+--- mediastreamer2-2.16.1/configure.ac 2017-07-21 15:00:47.000000000 +0200
++++ mediastreamer2-2.16.1-libsrtp2/configure.ac 2018-01-13 00:06:22.194089121 +0100
+@@ -1041,7 +1041,7 @@
+
+ dnl check for libsrtp support (secure rtp)
+ AC_ARG_WITH(srtp,
+- AC_HELP_STRING([--with-srtp], [Set prefix where libsrtp can be found or "none" to disable (ex:/usr or /usr/local) [[default=/usr]]]),
++ AC_HELP_STRING([--with-srtp], [Set prefix where libsrtp2 can be found or "none" to disable (ex:/usr or /usr/local) [[default=/usr]]]),
+ [srtp_prefix=$withval],
+ [if test "$prefix" != "NONE"; then
+ srtp_prefix=$prefix
+@@ -1051,22 +1051,22 @@
+
+ if test "${srtp_prefix}" != "none" ; then
+ if test "${srtp_prefix}" != "/usr" ; then
+- SRTP_CFLAGS="-I${srtp_prefix}/include -I${srtp_prefix}/include/srtp"
++ SRTP_CFLAGS="-I${srtp_prefix}/include -I${srtp_prefix}/include/srtp2"
+ SRTP_LIBS="-L${srtp_prefix}/lib"
+ fi
+- SRTP_LIBS="$SRTP_LIBS -lsrtp"
++ SRTP_LIBS="$SRTP_LIBS -lsrtp2"
+
+ dnl check srtp headers
+ CPPFLAGS_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $SRTP_CFLAGS"
+- AC_CHECK_HEADER([srtp/srtp.h],have_srtp_headers=yes)
++ AC_CHECK_HEADER([srtp2/srtp.h],have_srtp_headers=yes)
+ CPPFLAGS=$CPPFLAGS_save
+
+ dnl check for srtp lib
+ LDFLAGS_save=$LDFLAGS
+ LDFLAGS="$LDFLAGS $SRTP_LIBS"
+ LIBS_save=$LIBS
+- AC_CHECK_LIB(srtp,[srtp_init, crypto_policy_set_aes_cm_256_hmac_sha1_80, crypto_policy_set_aes_cm_256_hmac_sha1_32], have_srtp_lib=yes)
++ AC_CHECK_LIB(srtp2,[srtp_init, srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80, srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32], have_srtp_lib=yes)
+ LDFLAGS=$LDFLAGS_save
+ LIBS=$LIBS_save
+
+@@ -1075,9 +1075,9 @@
+ LIBS_save=$LIBS
+ LDFLAGS="$LDFLAGS $SRTP_LIBS"
+ AC_CHECK_LIB(
+- srtp,
++ srtp2,
+ sha1_update,[
+- AC_MSG_WARN([This libsrtp version exports symbols conflicting with polarssl, resulting in a bad execution path. libsrtp will be statically linked])
++ AC_MSG_WARN([This libsrtp2 version exports symbols conflicting with polarssl, resulting in a bad execution path. libsrtp2 will be statically linked])
+ srtp_polarssl_conflict=yes
+ ],
+ srtp_polarssl_conflict=no
+@@ -1086,13 +1086,13 @@
+ LIBS=$LIBS_save
+
+ if test "$srtp_polarssl_conflict" = "yes"; then
+- srtp_static_lib="${srtp_prefix}/lib/libsrtp.a"
++ srtp_static_lib="${srtp_prefix}/lib/libsrtp2.a"
+ if test -f $srtp_static_lib -a -r $srtp_static_lib; then
+- SRTP_LIBS="${srtp_prefix}/lib/libsrtp.a -Bsymbolic -Wl,--version-script=\$(top_srcdir)/src/libsrtp.map"
++ SRTP_LIBS="${srtp_prefix}/lib/libsrtp2.a -Bsymbolic -Wl,--version-script=\$(top_srcdir)/src/libsrtp2.map"
+ AC_DEFINE(HAVE_SRTP, 1, [Defined when srtp support is compiled])
+ have_srtp=true
+ else
+- AC_MSG_WARN([Could not access to $srtp_static_lib. Please use --with-srtp=PREFIX to specify the prefix where libsrtp.a has been installed])
++ AC_MSG_WARN([Could not access to $srtp_static_lib. Please use --with-srtp=PREFIX to specify the prefix where libsrtp2.a has been installed])
+ SRTP_CFLAGS=
+ SRTP_LIBS=
+ have_srtp=true
+diff -u -r mediastreamer2-2.16.1/src/crypto/ms_srtp.c mediastreamer2-2.16.1-libsrtp2/src/crypto/ms_srtp.c
+--- mediastreamer2-2.16.1/src/crypto/ms_srtp.c 2017-07-21 15:00:47.000000000 +0200
++++ mediastreamer2-2.16.1-libsrtp2/src/crypto/ms_srtp.c 2018-01-13 00:14:48.575306030 +0100
+@@ -38,7 +38,7 @@
+ // Windows phone doesn't use make install
+ #include <srtp.h>
+ #else
+-#include <srtp/srtp.h>
++#include <srtp2/srtp.h>
+ #endif
+
+
+@@ -99,7 +99,7 @@
+ /**** Sender functions ****/
+ static int _process_on_send(RtpSession* session,MSSrtpStreamContext *ctx, mblk_t *m){
+ int slen;
+- err_status_t err;
++ srtp_err_status_t err;
+ bool_t is_rtp=ctx->is_rtp;
+ rtp_header_t *rtp_header=is_rtp?(rtp_header_t*)m->b_rptr:NULL;
+ rtcp_common_header_t *rtcp_header=!is_rtp?(rtcp_common_header_t*)m->b_rptr:NULL;
+@@ -109,7 +109,7 @@
+ ms_mutex_lock(&ctx->mutex);
+ if (!ctx->secured) {
+ /*does not make sense to protect, because we don't have any key*/
+- err=err_status_ok;
++ err=srtp_err_status_ok;
+ slen = 0; /*droping packets*/
+ } else {
+ /* defragment incoming message and enlarge the buffer for srtp to write its data */
+@@ -120,7 +120,7 @@
+ } else if (rtcp_header && (slen>RTP_FIXED_HEADER_SIZE && rtcp_header->version==2)) {
+ ms_mutex_lock(&ctx->mutex);
+ if (!ctx->secured) {
+- err=err_status_ok;
++ err=srtp_err_status_ok;
+ /*does not make sense to protect, because we don't have any key*/
+ slen = 0; /*droping packets*/
+ } else {
+@@ -135,7 +135,7 @@
+ }
+
+ /* check return code from srtp_protect */
+- if (err==err_status_ok){
++ if (err==srtp_err_status_ok){
+ return slen;
+ }
+ ortp_error("srtp_protect%s() failed (%d) for stream ctx [%p]", is_rtp?"":"_rtcp", err,ctx);
+@@ -151,7 +151,7 @@
+ }
+ static int _process_on_receive(RtpSession* session,MSSrtpStreamContext *ctx, mblk_t *m, int err){
+ int slen;
+- err_status_t srtp_err;
++ srtp_err_status_t srtp_err;
+ bool_t is_rtp=ctx->is_rtp;
+
+ /* keep NON-RTP data unencrypted */
+@@ -167,7 +167,7 @@
+
+ slen=err;
+ srtp_err = is_rtp?srtp_unprotect(ctx->srtp,m->b_rptr,&slen):srtp_unprotect_rtcp(ctx->srtp,m->b_rptr,&slen);
+- if (srtp_err==err_status_ok) {
++ if (srtp_err==srtp_err_status_ok) {
+ return slen;
+ } else {
+ ms_error("srtp_unprotect%s() failed (%d) on stream ctx [%p]", is_rtp?"":"_rtcp", srtp_err,ctx);
+@@ -201,7 +201,7 @@
+
+
+ static int ms_media_stream_session_fill_srtp_context(MSMediaStreamSessions *sessions, bool_t is_send, bool_t is_rtp) {
+- err_status_t err=0;
++ srtp_err_status_t err=0;
+ RtpTransport *transport=NULL;
+ MSSrtpStreamContext* stream_ctx = get_stream_context(sessions,is_send,is_rtp);
+
+@@ -258,28 +258,28 @@
+ }
+
+
+-static int ms_set_srtp_crypto_policy(MSCryptoSuite suite, crypto_policy_t *policy) {
++static int ms_set_srtp_srtp_crypto_policy(MSCryptoSuite suite, srtp_crypto_policy_t *policy) {
+ switch(suite){
+ case MS_AES_128_SHA1_32:
+ // srtp doc says: not adapted to rtcp...
+- crypto_policy_set_aes_cm_128_hmac_sha1_32(policy);
++ srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(policy);
+ break;
+ case MS_AES_128_NO_AUTH:
+ // srtp doc says: not adapted to rtcp...
+- crypto_policy_set_aes_cm_128_null_auth(policy);
++ srtp_crypto_policy_set_aes_cm_128_null_auth(policy);
+ break;
+ case MS_NO_CIPHER_SHA1_80:
+- crypto_policy_set_null_cipher_hmac_sha1_80(policy);
++ srtp_crypto_policy_set_null_cipher_hmac_sha1_80(policy);
+ break;
+ case MS_AES_128_SHA1_80: /*default mode*/
+- crypto_policy_set_aes_cm_128_hmac_sha1_80(policy);
++ srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(policy);
+ break;
+ case MS_AES_256_SHA1_80: // For backward compatibility
+ case MS_AES_CM_256_SHA1_80:
+- crypto_policy_set_aes_cm_256_hmac_sha1_80(policy);
+- break;
++ srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(policy);
++ break;
+ case MS_AES_256_SHA1_32:
+- crypto_policy_set_aes_cm_256_hmac_sha1_32(policy);
++ srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(policy);
+ break;
+ case MS_CRYPTO_SUITE_INVALID:
+ return -1;
+@@ -291,13 +291,13 @@
+ static int ms_add_srtp_stream(srtp_t srtp, MSCryptoSuite suite, uint32_t ssrc, const char* key, size_t key_length, bool_t is_send, bool_t is_rtp)
+ {
+ srtp_policy_t policy;
+- err_status_t err;
+- ssrc_t ssrc_conf;
++ srtp_err_status_t err;
++ srtp_ssrc_t ssrc_conf;
+
+ memset(&policy,0,sizeof(policy));
+
+ if (is_rtp) {
+- if (ms_set_srtp_crypto_policy(suite, &policy.rtp) != 0) {
++ if (ms_set_srtp_srtp_crypto_policy(suite, &policy.rtp) != 0) {
+ return -1;
+ }
+ /* check if key length match given policy */
+@@ -306,7 +306,7 @@
+ return -1;
+ }
+ }else {
+- if (ms_set_srtp_crypto_policy(suite, &policy.rtcp) != 0) {
++ if (ms_set_srtp_srtp_crypto_policy(suite, &policy.rtcp) != 0) {
+ return -1;
+ }
+ if ((int)key_length != policy.rtcp.cipher_key_len) {
+@@ -326,7 +326,7 @@
+ policy.next = NULL;
+
+ err = srtp_add_stream(srtp, &policy);
+- if (err != err_status_ok) {
++ if (err != srtp_err_status_ok) {
+ ms_error("Failed to add stream to srtp session (%d)", err);
+ return -1;
+ }
+@@ -344,7 +344,7 @@
+ int ms_srtp_init(void)
+ {
+
+- err_status_t st=0;
++ srtp_err_status_t st=0;
+ ms_message("srtp init");
+ if (!srtp_init_done) {
+ st=srtp_init();
+@@ -352,7 +352,6 @@
+ srtp_init_done++;
+ }else{
+ ms_fatal("Couldn't initialize SRTP library: %d.", st);
+- err_reporting_init("mediastreamer2");
+ }
+ }else srtp_init_done++;
+ return (int)st;
+@@ -508,7 +507,7 @@
+ #else /* HAVE_SRTP */
+
+ typedef void* srtp_t;
+-typedef int err_status_t;
++typedef int srtp_err_status_t;
+
+ bool_t ms_srtp_supported(void){
+ return FALSE;
Summary: Audio/Video real-time streaming
Summary(pl.UTF-8): Przesyłanie strumieni audio/video w czasie rzeczywistym
Name: mediastreamer
-Version: 2.12.1
-Release: 4
+Version: 2.16.1
+Release: 1
License: GPL v2+
Group: Libraries
-Source0: http://download-mirror.savannah.gnu.org/releases/linphone/mediastreamer/%{name}-%{version}.tar.gz
-# Source0-md5: 1ca115e94a718638fbecf8352c169861
-Patch0: %{name}-imagedir.patch
-Patch1: %{name}-ffmpeg.patch
-Patch2: %{name}-werror.patch
-Patch3: ffmpeg4.patch
+Source0: https://linphone.org/releases/sources//mediastreamer/%{name}-%{version}.tar.gz
+# Source0-md5: 15b8b129a922180855d04d58cdd08d43
+Patch0: build.patch
+Patch1: libsrtp2.patch
URL: http://www.linphone.org/technical-corner/mediastreamer2/overview
%{?with_opengl:BuildRequires: OpenGL-GLX-devel}
BuildRequires: SDL-devel >= 1.2.0
BuildRequires: autoconf >= 2.53
BuildRequires: automake >= 1:1.9
%{?with_bcg729:BuildRequires: bcg729-devel >= 1.0}
-%{?with_zrtp:BuildRequires: bzrtp-devel >= 1.0.0}
+%{?with_zrtp:BuildRequires: bzrtp-devel >= 1.0.6}
BuildRequires: doxygen
# libavcodec >= 51.0.0, libswscale >= 0.7.0
BuildRequires: ffmpeg-devel
BuildRequires: libvpx-devel >= 0.9.6
%{?with_matroska:BuildRequires: matroska-foundation-devel}
BuildRequires: opus-devel >= 0.9.0
-BuildRequires: ortp-devel >= 0.24.0
+BuildRequires: ortp-devel >= 1.0.0
BuildRequires: pkgconfig
BuildRequires: polarssl-devel
%{?with_portaudio:BuildRequires: portaudio-devel}
BuildRequires: spandsp-devel >= 0.0.6
BuildRequires: speex-devel >= 1:1.2-beta3
BuildRequires: speexdsp-devel >= 1.2-beta3
-%{?with_srtp:BuildRequires: srtp-devel}
+%{?with_srtp:BuildRequires: libsrtp2-devel}
BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXv-devel
BuildRequires: xxd
%{?with_bcg729:Requires: bcg729 >= 1.0}
-%{?with_zrtp:Requires: bzrtp >= 1.0.0}
+%{?with_zrtp:Requires: bzrtp >= 1.0.6}
%{?with_opengl:Requires: glew >= 1.5}
Requires: libtheora >= 1.0-0.alpha7
Requires: libupnp >= 1.6
Requires: libvpx >= 0.9.6
Requires: opus >= 0.9.0
-Requires: ortp >= 0.24.0
+Requires: ortp >= 1.0.0
%{?with_pulseaudio:Requires: pulseaudio-libs >= 0.9.21}
Requires: spandsp >= 0.0.6
Requires: speex >= 1:1.2-beta3
%{?with_opengl:Requires: OpenGL-devel}
%{?with_alsa:Requires: alsa-lib-devel}
%{?with_bcg729:Requires: bcg729-devel >= 1.0}
-%{?with_zrtp:Requires: bzrtp-devel >= 1.0.0}
+%{?with_zrtp:Requires: bzrtp-devel >= 1.0.6}
Requires: ffmpeg-devel
%{?with_opengl:Requires: glew-devel >= 1.5}
Requires: libtheora-devel >= 1.0-0.alpha7
Requires: libvpx-devel >= 0.9.6
%{?with_matroska:Requires: matroska-foundation-devel}
Requires: opus-devel >= 0.9.0
-Requires: ortp-devel >= 0.24.0
+Requires: ortp-devel >= 1.0.0
Requires: polarssl-devel
%{?with_portaudio:Requires: portaudio-devel}
%{?with_pulseaudio:Requires: pulseaudio-devel >= 0.9.21}
Requires: spandsp-devel >= 0.0.6
Requires: speex-devel >= 1:1.2-beta3
Requires: speexdsp-devel >= 1.2-beta3
-%{?with_srtp:Requires: srtp-devel}
+%{?with_srtp:Requires: libsrtp2-devel}
Requires: xorg-lib-libX11-devel
Requires: xorg-lib-libXv-devel
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+
+[ ! -e gitversion.h ] && echo '#define MS2_GIT_VERSION "%{version}"' > src/gitversion.h
%build
%{__libtoolize}
+%{__gettextize}
+%{__intltoolize}
%{__aclocal}
%{__autoconf}
%{__autoheader}