* update mediastreamer to 5.3.5-1
This commit is contained in:
parent
743e88000b
commit
6b22259109
28
mediastreamer/.SRCINFO
Normal file
28
mediastreamer/.SRCINFO
Normal file
@ -0,0 +1,28 @@
|
||||
pkgbase = mediastreamer
|
||||
pkgdesc = A library written in C that allows you to create and run audio and video streams
|
||||
pkgver = 5.3.5
|
||||
pkgrel = 1
|
||||
url = https://gitlab.linphone.org/
|
||||
arch = x86_64
|
||||
arch = powerpc64le
|
||||
arch = powerpc64
|
||||
arch = powerpc
|
||||
arch = riscv64
|
||||
license = AGPL3
|
||||
makedepends = cmake
|
||||
makedepends = python
|
||||
makedepends = bcunit
|
||||
makedepends = doxygen
|
||||
depends = bcmatroska2
|
||||
depends = bcg729
|
||||
depends = bzrtp
|
||||
depends = ffmpeg4.4
|
||||
depends = glew
|
||||
depends = libsrtp
|
||||
depends = libyuv
|
||||
depends = ortp
|
||||
depends = zxing-cpp
|
||||
source = https://gitlab.linphone.org/BC/public/mediastreamer2/-/archive/5.3.5/mediastreamer2-5.3.5.tar.bz2
|
||||
sha256sums = 77c9d8d5cd2b599a6968b5f9a459ffc248b03b657cb004451b122fe8d853b7e9
|
||||
|
||||
pkgname = mediastreamer
|
@ -1,34 +1,31 @@
|
||||
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
|
||||
# Maintainer:
|
||||
# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
|
||||
# Contributor: Andrea Scarpino <andrea@archlinux.org>
|
||||
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
|
||||
# Contributor: Adrià Arrufat <swiftscythe@gmail.com>
|
||||
# Contributor: Mark Lee <mark@markelee.com>
|
||||
|
||||
pkgname=mediastreamer
|
||||
pkgver=5.1.67
|
||||
pkgver=5.3.5
|
||||
pkgrel=1
|
||||
pkgdesc='A library written in C that allows you to create and run audio and video streams'
|
||||
arch=(x86_64 powerpc64le powerpc riscv64)
|
||||
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
|
||||
url='https://gitlab.linphone.org/'
|
||||
license=(GPL)
|
||||
depends=(ortp ffmpeg bzrtp glew libsrtp bcg729)
|
||||
makedepends=(cmake python bcunit doxygen libyuv)
|
||||
source=(https://gitlab.linphone.org/BC/public/${pkgname}2/-/archive/$pkgver/${pkgname}2-$pkgver.tar.bz2
|
||||
ffmpeg5.patch)
|
||||
sha256sums=('aca02aa0519afe64fad83cf520eeb6da98e78878467cf486963f1bcddaf5a45d'
|
||||
'e97e029cbbafe5245eaa6f92664224e4381eea5f45e403d5bfa6b0e5c2be0341')
|
||||
validpgpkeys=('9774BC1725758EB16D639F8B3ECD52DEE2F56985')
|
||||
|
||||
prepare() {
|
||||
patch -d ${pkgname}2-$pkgver -p1 < ffmpeg5.patch
|
||||
}
|
||||
license=(AGPL3)
|
||||
depends=(bcmatroska2 bcg729 bzrtp ffmpeg4.4 glew libsrtp libyuv ortp zxing-cpp)
|
||||
makedepends=(cmake python bcunit doxygen)
|
||||
source=(https://gitlab.linphone.org/BC/public/${pkgname}2/-/archive/$pkgver/${pkgname}2-$pkgver.tar.bz2)
|
||||
sha256sums=('77c9d8d5cd2b599a6968b5f9a459ffc248b03b657cb004451b122fe8d853b7e9')
|
||||
|
||||
build() {
|
||||
cmake -B build -S ${pkgname}2-$pkgver \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DENABLE_STATIC=OFF \
|
||||
-DENABLE_STRICT=OFF
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DENABLE_STRICT=OFF \
|
||||
-DENABLE_UNIT_TESTS=OFF \
|
||||
-DENABLE_MKV=ON \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON \
|
||||
-Wno-dev
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
|
@ -1,208 +0,0 @@
|
||||
diff --git a/src/utils/ffmpeg-priv.c b/src/utils/ffmpeg-priv.c
|
||||
index a3a801a9..9d696f17 100644
|
||||
--- a/src/utils/ffmpeg-priv.c
|
||||
+++ b/src/utils/ffmpeg-priv.c
|
||||
@@ -23,31 +23,22 @@
|
||||
|
||||
#ifndef HAVE_FUN_avcodec_encode_video2
|
||||
int avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) {
|
||||
- int error=avcodec_encode_video(avctx, avpkt->data, avpkt->size,frame);
|
||||
- if (error<0){
|
||||
- return error;
|
||||
- }else{
|
||||
- if (error>0) {
|
||||
- *got_packet_ptr=1;
|
||||
- avpkt->size=error;
|
||||
- }else *got_packet_ptr=0;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-#endif
|
||||
+ int ret;
|
||||
|
||||
+ *got_packet_ptr = 0;
|
||||
|
||||
+ ret = avcodec_send_frame(avctx, frame);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
|
||||
-#ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
|
||||
-int avcodec_get_context_defaults3 (AVCodecContext *s, AVCodec *codec) {
|
||||
- avcodec_get_context_defaults(s);
|
||||
- return 0;
|
||||
-}
|
||||
+ ret = avcodec_receive_packet(avctx, avpkt);
|
||||
+ if (!ret)
|
||||
+ *got_packet_ptr = 1;
|
||||
+ if (ret == AVERROR(EAGAIN))
|
||||
+ return 0;
|
||||
|
||||
-AVCodecContext *avcodec_alloc_context3(AVCodec *codec){
|
||||
- return avcodec_alloc_context();
|
||||
+ return ret;
|
||||
}
|
||||
-
|
||||
#endif
|
||||
|
||||
|
||||
diff --git a/src/utils/ffmpeg-priv.h b/src/utils/ffmpeg-priv.h
|
||||
index 18338201..3ffeb088 100644
|
||||
--- a/src/utils/ffmpeg-priv.h
|
||||
+++ b/src/utils/ffmpeg-priv.h
|
||||
@@ -79,6 +79,29 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
|
||||
AVPacket *avpkt){
|
||||
return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
|
||||
}
|
||||
+#else
|
||||
+static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ *got_frame = 0;
|
||||
+
|
||||
+ if (pkt) {
|
||||
+ ret = avcodec_send_packet(avctx, pkt);
|
||||
+ // In particular, we don't expect AVERROR(EAGAIN), because we read all
|
||||
+ // decoded frames with avcodec_receive_frame() until done.
|
||||
+ if (ret < 0)
|
||||
+ return ret == AVERROR_EOF ? 0 : ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = avcodec_receive_frame(avctx, frame);
|
||||
+ if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
|
||||
+ return ret;
|
||||
+ if (ret >= 0)
|
||||
+ *got_frame = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
#endif
|
||||
#if HAVE_AVCODEC_OLD_CODEC_IDS
|
||||
#include <libavcodec/old_codec_ids.h>
|
||||
@@ -119,11 +142,6 @@ extern "C" {
|
||||
int avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
|
||||
#endif
|
||||
|
||||
-#ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
|
||||
-int avcodec_get_context_defaults3 (AVCodecContext *s, AVCodec *codec);
|
||||
-AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
|
||||
-#endif
|
||||
-
|
||||
#ifndef HAVE_FUN_avcodec_open2 /**/
|
||||
int avcodec_open2 (AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
|
||||
#endif
|
||||
diff --git a/src/utils/jpgloader-ffmpeg.c b/src/utils/jpgloader-ffmpeg.c
|
||||
index 62cf41db..9952fab7 100644
|
||||
--- a/src/utils/jpgloader-ffmpeg.c
|
||||
+++ b/src/utils/jpgloader-ffmpeg.c
|
||||
@@ -75,7 +75,6 @@ mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- avcodec_get_context_defaults3(&av_context,NULL);
|
||||
if (avcodec_open2(&av_context,codec,NULL)<0){
|
||||
ms_error("jpeg2yuv: avcodec_open failed");
|
||||
return NULL;
|
||||
diff --git a/src/videofilters/ffmpegjpegwriter.c b/src/videofilters/ffmpegjpegwriter.c
|
||||
index 5ee16b8d..8d1638f6 100644
|
||||
--- a/src/videofilters/ffmpegjpegwriter.c
|
||||
+++ b/src/videofilters/ffmpegjpegwriter.c
|
||||
@@ -174,7 +174,7 @@ static void jpg_process(MSFilter *f){
|
||||
sws_freeContext(sws_ctx);
|
||||
|
||||
av_frame_unref(s->pict);
|
||||
- avpicture_fill((AVPicture*)s->pict,(uint8_t*)jpegm->b_rptr,avctx->pix_fmt,avctx->width,avctx->height);
|
||||
+ av_image_fill_arrays(s->pict->data,s->pict->linesize,(uint8_t*)jpegm->b_rptr,avctx->pix_fmt,avctx->width,avctx->height, 1);
|
||||
packet.data=comp_buf;
|
||||
packet.size=(int)comp_buf_sz;
|
||||
packet.pts = frame_ts;
|
||||
diff --git a/src/videofilters/h264dec.cpp b/src/videofilters/h264dec.cpp
|
||||
index e3cd82cc..bed94bb0 100644
|
||||
--- a/src/videofilters/h264dec.cpp
|
||||
+++ b/src/videofilters/h264dec.cpp
|
||||
@@ -66,17 +66,15 @@ typedef struct _DecData{
|
||||
static void ffmpeg_init(void){
|
||||
static bool_t done=FALSE;
|
||||
if (!done){
|
||||
- avcodec_register_all();
|
||||
done=TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void dec_open(DecData *d){
|
||||
- AVCodec *codec;
|
||||
+ const AVCodec *codec;
|
||||
int error;
|
||||
codec=avcodec_find_decoder(CODEC_ID_H264);
|
||||
if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
|
||||
- avcodec_get_context_defaults3(&d->av_context, NULL);
|
||||
error=avcodec_open2(&d->av_context,codec, NULL);
|
||||
if (error!=0){
|
||||
ms_fatal("avcodec_open() failed.");
|
||||
@@ -164,7 +162,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f, DecData *s, AVFrame *orig){
|
||||
ms_error("%s: error in sws_scale().",f->desc->name);
|
||||
}
|
||||
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50,43,0) // backward compatibility with Debian Squeeze (6.0)
|
||||
- mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pkt_pts);
|
||||
+ mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pts);
|
||||
#endif
|
||||
return yuv_msg;
|
||||
}
|
||||
diff --git a/src/videofilters/videodec.c b/src/videofilters/videodec.c
|
||||
index d5dbcaa2..2b223349 100644
|
||||
--- a/src/videofilters/videodec.c
|
||||
+++ b/src/videofilters/videodec.c
|
||||
@@ -69,7 +69,6 @@ static void dec_init(MSFilter *f, enum CodecID cid){
|
||||
DecState *s=(DecState *)ms_new0(DecState,1);
|
||||
ms_ffmpeg_check_init();
|
||||
|
||||
- avcodec_get_context_defaults3(&s->av_context, NULL);
|
||||
s->allocator = ms_yuv_buf_allocator_new();
|
||||
s->av_codec=NULL;
|
||||
s->codec=cid;
|
||||
@@ -661,7 +660,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig){
|
||||
#endif
|
||||
ms_error("%s: error in ms_sws_scale().",f->desc->name);
|
||||
}
|
||||
- mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pkt_pts);
|
||||
+ mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pts);
|
||||
return yuv_msg;
|
||||
}
|
||||
/* Bitmasks to select bits of a byte from low side */
|
||||
diff --git a/src/videofilters/videoenc.c b/src/videofilters/videoenc.c
|
||||
index 42d3a05e..7e3575d4 100644
|
||||
--- a/src/videofilters/videoenc.c
|
||||
+++ b/src/videofilters/videoenc.c
|
||||
@@ -128,7 +128,6 @@ void ms_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl)
|
||||
|
||||
void ms_ffmpeg_check_init(){
|
||||
if(!avcodec_initialized){
|
||||
- avcodec_register_all();
|
||||
avcodec_initialized=TRUE;
|
||||
#ifdef ENABLE_LOG_FFMPEG
|
||||
av_log_set_level(AV_LOG_WARNING);
|
||||
@@ -268,7 +267,6 @@ static void prepare(EncState *s){
|
||||
AVCodecContext *c=&s->av_context;
|
||||
const int max_br_vbv=128000;
|
||||
|
||||
- avcodec_get_context_defaults3(c, NULL);
|
||||
if (s->codec==CODEC_ID_MJPEG)
|
||||
{
|
||||
ms_message("Codec bitrate set to %i",(int)c->bit_rate);
|
||||
@@ -332,7 +330,6 @@ static void prepare_h263(EncState *s){
|
||||
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
|
||||
c->rtp_mode = 1;
|
||||
#endif
|
||||
- c->rtp_payload_size = s->mtu/2;
|
||||
if (s->profile==0){
|
||||
s->codec=CODEC_ID_H263;
|
||||
}else{
|
||||
@@ -815,7 +812,7 @@ static void process_frame(MSFilter *f, mblk_t *inm){
|
||||
ms_yuv_buf_init_from_mblk(&yuv, inm);
|
||||
/* convert image if necessary */
|
||||
av_frame_unref(s->pict);
|
||||
- avpicture_fill((AVPicture*)s->pict,yuv.planes[0],c->pix_fmt,c->width,c->height);
|
||||
+ av_image_fill_arrays(s->pict->data,s->pict->linesize,yuv.planes[0],c->pix_fmt,c->width,c->height,1);
|
||||
|
||||
/* timestamp used by ffmpeg, unset here */
|
||||
s->pict->pts=AV_NOPTS_VALUE;
|
@ -1,241 +0,0 @@
|
||||
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;
|
Loading…
x
Reference in New Issue
Block a user