From dae7af8444f78ad8c7116227b11fdff6395d58aa Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 28 Mar 2020 20:52:42 +0800 Subject: [PATCH] For #307, rtc support osx --- trunk/3rdparty/ffmpeg-4.2-fit/libavutil/avconfig.h | 6 ------ trunk/auto/depends.sh | 2 +- trunk/configure | 5 +++++ trunk/src/app/srs_app_rtc_conn.cpp | 7 +++++++ 4 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 trunk/3rdparty/ffmpeg-4.2-fit/libavutil/avconfig.h diff --git a/trunk/3rdparty/ffmpeg-4.2-fit/libavutil/avconfig.h b/trunk/3rdparty/ffmpeg-4.2-fit/libavutil/avconfig.h deleted file mode 100644 index 8558b3502..000000000 --- a/trunk/3rdparty/ffmpeg-4.2-fit/libavutil/avconfig.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Generated by ffmpeg configure */ -#ifndef AVUTIL_AVCONFIG_H -#define AVUTIL_AVCONFIG_H -#define AV_HAVE_BIGENDIAN 0 -#define AV_HAVE_FAST_UNALIGNED 0 -#endif /* AVUTIL_AVCONFIG_H */ diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index f9f7aa1da..0b0682237 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -365,7 +365,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then echo "Building srtp2."; ( rm -rf ${SRS_OBJS}/srtp2 && cd ${SRS_OBJS} && - unzip -q ../3rdparty/libsrtp-2.0.0.zip && cd libsrtp-2.0.0 && + rm -rf libsrtp-2.0.0 && unzip -q ../3rdparty/libsrtp-2.0.0.zip && cd libsrtp-2.0.0 && ./configure --prefix=`pwd`/_release && make ${SRS_JOBS} && make install && cd .. && rm -f srtp2 && ln -sf libsrtp-2.0.0/_release srtp2 ) diff --git a/trunk/configure b/trunk/configure index 3b07b394c..99852914d 100755 --- a/trunk/configure +++ b/trunk/configure @@ -684,6 +684,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then else echo -e "${GREEN}Warning: SRT is disabled.${BLACK}" fi + if [ $SRS_RTC = YES ]; then + echo -e "${YELLOW}Experiment: RTC is enabled. https://github.com/ossrs/srs/issues/307${BLACK}" + else + echo -e "${GREEN}Warning: RTC is disabled.${BLACK}" + fi if [ $SRS_DVR = YES ]; then echo -e "${GREEN}DVR is enabled.${BLACK}" else diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index da08a5cf3..d02e1ca43 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -810,6 +810,13 @@ srs_error_t SrsRtcSession::check_source() return err; } +#ifdef SRS_AUTO_OSX +// These functions are similar to the older byteorder(3) family of functions. +// For example, be32toh() is identical to ntohl(). +// @see https://linux.die.net/man/3/be32toh +#define be32toh ntohl +#endif + srs_error_t SrsRtcSession::on_binding_request(SrsUdpMuxSocket* udp_mux_skt, SrsStunPacket* stun_req) { srs_error_t err = srs_success;