Commit 9b1a1f53 authored by Simon Morlat's avatar Simon Morlat

fix srtp support on windows

parent 76062079
...@@ -107,6 +107,7 @@ case "$target_os" in ...@@ -107,6 +107,7 @@ case "$target_os" in
*mingw*) *mingw*)
CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC" CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm" LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm"
mingw_found=yes
;; ;;
esac esac
...@@ -166,8 +167,8 @@ AC_ARG_WITH( srtp, ...@@ -166,8 +167,8 @@ AC_ARG_WITH( srtp,
[ --with-srtp Set prefix where libsrtp can be found or "none" to disable (ex:/usr or /usr/local)[default=/usr] ], [ --with-srtp Set prefix where libsrtp can be found or "none" to disable (ex:/usr or /usr/local)[default=/usr] ],
[ srtp_prefix=${withval}],[ srtp_prefix=/usr ]) [ srtp_prefix=${withval}],[ srtp_prefix=/usr ])
if test "${srtp_prefix}" != "none"; then if test "${srtp_prefix}" != "none" ; then
if test "${srtp_prefix}" != "/usr" ; then if test "${srtp_prefix}" != "/usr" || test "$mingw_found" = "yes" ; then
SRTP_CFLAGS="-I${srtp_prefix}/include -I${srtp_prefix}/include/srtp" SRTP_CFLAGS="-I${srtp_prefix}/include -I${srtp_prefix}/include/srtp"
SRTP_LIBS="-L${srtp_prefix}/lib" SRTP_LIBS="-L${srtp_prefix}/lib"
fi fi
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#endif #endif
#include "ortp/ortp.h" #include "ortp/ortp.h"
#include "ortp/ortp_srtp.h"
#ifdef HAVE_SRTP #ifdef HAVE_SRTP
#undef PACKAGE_NAME #undef PACKAGE_NAME
...@@ -33,6 +31,7 @@ ...@@ -33,6 +31,7 @@
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
#include "ortp/ortp_srtp.h"
#include "ortp/b64.h" #include "ortp/b64.h"
...@@ -47,7 +46,7 @@ static int srtp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct sock ...@@ -47,7 +46,7 @@ static int srtp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct sock
slen=m->b_wptr-m->b_rptr; slen=m->b_wptr-m->b_rptr;
err=srtp_protect(srtp,m->b_rptr,&slen); err=srtp_protect(srtp,m->b_rptr,&slen);
if (err==err_status_ok){ if (err==err_status_ok){
return sendto(t->session->rtp.socket,m->b_rptr,slen,flags,to,tolen); return sendto(t->session->rtp.socket,(void*)m->b_rptr,slen,flags,to,tolen);
} }
ortp_error("srtp_protect() failed (%d)", err); ortp_error("srtp_protect() failed (%d)", err);
return -1; return -1;
...@@ -57,7 +56,7 @@ static int srtp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr ...@@ -57,7 +56,7 @@ static int srtp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr
srtp_t srtp=(srtp_t)t->data; srtp_t srtp=(srtp_t)t->data;
int err; int err;
int slen; int slen;
err=recvfrom(t->session->rtp.socket,m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen); err=recvfrom(t->session->rtp.socket,(void*)m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen);
if (err>0){ if (err>0){
err_status_t srtp_err; err_status_t srtp_err;
/* keep NON-RTP data unencrypted */ /* keep NON-RTP data unencrypted */
...@@ -92,7 +91,7 @@ static int srtcp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct soc ...@@ -92,7 +91,7 @@ static int srtcp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct soc
slen=m->b_wptr-m->b_rptr; slen=m->b_wptr-m->b_rptr;
srtp_err=srtp_protect_rtcp(srtp,m->b_rptr,&slen); srtp_err=srtp_protect_rtcp(srtp,m->b_rptr,&slen);
if (srtp_err==err_status_ok){ if (srtp_err==err_status_ok){
return sendto(t->session->rtcp.socket,m->b_rptr,slen,flags,to,tolen); return sendto(t->session->rtcp.socket,(void*)m->b_rptr,slen,flags,to,tolen);
} }
ortp_error("srtp_protect_rtcp() failed (%d)", srtp_err); ortp_error("srtp_protect_rtcp() failed (%d)", srtp_err);
return -1; return -1;
...@@ -102,7 +101,7 @@ static int srtcp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr ...@@ -102,7 +101,7 @@ static int srtcp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr
srtp_t srtp=(srtp_t)t->data; srtp_t srtp=(srtp_t)t->data;
int err; int err;
int slen; int slen;
err=recvfrom(t->session->rtcp.socket,m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen); err=recvfrom(t->session->rtcp.socket,(void*)m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen);
if (err>0){ if (err>0){
err_status_t srtp_err; err_status_t srtp_err;
slen=err; slen=err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment