From 5b7974a522abceba6bc7760ea33de3b94ef04434 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 9 Apr 2021 20:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9D=83=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTHORS | 3 ++- webrtc/DtlsTransport.cpp | 20 +++++++++++++++++++- webrtc/DtlsTransport.hpp | 20 +++++++++++++++++++- webrtc/IceServer.cpp | 20 +++++++++++++++++++- webrtc/IceServer.hpp | 20 +++++++++++++++++++- webrtc/Sdp.cpp | 12 +++++++++--- webrtc/Sdp.h | 12 +++++++++--- webrtc/SrtpSession.cpp | 20 +++++++++++++++++++- webrtc/SrtpSession.hpp | 20 +++++++++++++++++++- webrtc/StunPacket.cpp | 20 +++++++++++++++++++- webrtc/StunPacket.hpp | 20 +++++++++++++++++++- webrtc/Utils.hpp | 20 +++++++++++++++++++- webrtc/WebRtcTransport.cpp | 12 +++++++++++- webrtc/WebRtcTransport.h | 12 +++++++++++- webrtc/readme.md | 37 +++++++++++++++++++++++++++++++++++++ www/webrtc/readme.txt | 2 ++ 16 files changed, 252 insertions(+), 18 deletions(-) create mode 100644 webrtc/readme.md create mode 100644 www/webrtc/readme.txt diff --git a/AUTHORS b/AUTHORS index 2fbea1c9..3456f103 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,4 +31,5 @@ Luke 大裤衩 <3503207480@qq.com> droid.chow [陈晓林](https://github.com/musicwood) -[老衲不出家](https://github.com/monktan89) \ No newline at end of file +[老衲不出家](https://github.com/monktan89) +[big panda](<2381267071@qq.com>) \ No newline at end of file diff --git a/webrtc/DtlsTransport.cpp b/webrtc/DtlsTransport.cpp index 0dd9492c..8abb2a21 100644 --- a/webrtc/DtlsTransport.cpp +++ b/webrtc/DtlsTransport.cpp @@ -1,4 +1,22 @@ -#define MS_CLASS "RTC::DtlsTransport" +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define MS_CLASS "RTC::DtlsTransport" // #define MS_LOG_DEV_LEVEL 3 #include "DtlsTransport.hpp" diff --git a/webrtc/DtlsTransport.hpp b/webrtc/DtlsTransport.hpp index 2d324441..fb28a6a4 100644 --- a/webrtc/DtlsTransport.hpp +++ b/webrtc/DtlsTransport.hpp @@ -1,4 +1,22 @@ -#ifndef MS_RTC_DTLS_TRANSPORT_HPP +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MS_RTC_DTLS_TRANSPORT_HPP #define MS_RTC_DTLS_TRANSPORT_HPP #include "SrtpSession.hpp" diff --git a/webrtc/IceServer.cpp b/webrtc/IceServer.cpp index 15aeb0bd..c976bcf0 100644 --- a/webrtc/IceServer.cpp +++ b/webrtc/IceServer.cpp @@ -1,4 +1,22 @@ -#define MS_CLASS "RTC::IceServer" +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define MS_CLASS "RTC::IceServer" // #define MS_LOG_DEV_LEVEL 3 #include diff --git a/webrtc/IceServer.hpp b/webrtc/IceServer.hpp index 49045f43..8b9742ad 100644 --- a/webrtc/IceServer.hpp +++ b/webrtc/IceServer.hpp @@ -1,4 +1,22 @@ -#ifndef MS_RTC_ICE_SERVER_HPP +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MS_RTC_ICE_SERVER_HPP #define MS_RTC_ICE_SERVER_HPP #include "StunPacket.hpp" diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 410f6c53..89065ecc 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1,6 +1,12 @@ -// -// Created by xzl on 2021/3/27. -// +/* + * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. + * + * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). + * + * Use of this source code is governed by MIT license that can be found in the + * LICENSE file in the root of the source tree. All contributing project authors + * may be found in the AUTHORS file in the root of the source tree. + */ #include "Sdp.h" #include "Common/Parser.h" diff --git a/webrtc/Sdp.h b/webrtc/Sdp.h index 2a9eb6ee..9247018a 100644 --- a/webrtc/Sdp.h +++ b/webrtc/Sdp.h @@ -1,6 +1,12 @@ -// -// Created by xzl on 2021/3/27. -// +/* + * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. + * + * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). + * + * Use of this source code is governed by MIT license that can be found in the + * LICENSE file in the root of the source tree. All contributing project authors + * may be found in the AUTHORS file in the root of the source tree. + */ #ifndef ZLMEDIAKIT_SDP_H #define ZLMEDIAKIT_SDP_H diff --git a/webrtc/SrtpSession.cpp b/webrtc/SrtpSession.cpp index a73c5aaa..cf359b7e 100644 --- a/webrtc/SrtpSession.cpp +++ b/webrtc/SrtpSession.cpp @@ -1,4 +1,22 @@ -#define MS_CLASS "RTC::SrtpSession" +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define MS_CLASS "RTC::SrtpSession" // #define MS_LOG_DEV_LEVEL 3 #include "SrtpSession.hpp" diff --git a/webrtc/SrtpSession.hpp b/webrtc/SrtpSession.hpp index 988d730b..d9d73fbe 100644 --- a/webrtc/SrtpSession.hpp +++ b/webrtc/SrtpSession.hpp @@ -1,4 +1,22 @@ -#ifndef MS_RTC_SRTP_SESSION_HPP +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MS_RTC_SRTP_SESSION_HPP #define MS_RTC_SRTP_SESSION_HPP #include "Utils.hpp" diff --git a/webrtc/StunPacket.cpp b/webrtc/StunPacket.cpp index 223d3f57..50120a70 100644 --- a/webrtc/StunPacket.cpp +++ b/webrtc/StunPacket.cpp @@ -1,4 +1,22 @@ -#define MS_CLASS "RTC::StunPacket" +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define MS_CLASS "RTC::StunPacket" // #define MS_LOG_DEV_LEVEL 3 #include "StunPacket.hpp" diff --git a/webrtc/StunPacket.hpp b/webrtc/StunPacket.hpp index ebd1b1d0..a6b2c940 100644 --- a/webrtc/StunPacket.hpp +++ b/webrtc/StunPacket.hpp @@ -1,4 +1,22 @@ -#ifndef MS_RTC_STUN_PACKET_HPP +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MS_RTC_STUN_PACKET_HPP #define MS_RTC_STUN_PACKET_HPP diff --git a/webrtc/Utils.hpp b/webrtc/Utils.hpp index 0b1b66ad..1692ff50 100644 --- a/webrtc/Utils.hpp +++ b/webrtc/Utils.hpp @@ -1,4 +1,22 @@ -#ifndef MS_UTILS_HPP +/** +ISC License + +Copyright © 2015, Iñaki Baz Castillo + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MS_UTILS_HPP #define MS_UTILS_HPP #if defined(_WIN32) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 4084c610..342dabc0 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -1,4 +1,14 @@ -#include "WebRtcTransport.h" +/* + * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. + * + * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). + * + * Use of this source code is governed by MIT license that can be found in the + * LICENSE file in the root of the source tree. All contributing project authors + * may be found in the AUTHORS file in the root of the source tree. + */ + +#include "WebRtcTransport.h" #include #include "Rtcp/Rtcp.h" #include "Rtsp/RtpReceiver.h" diff --git a/webrtc/WebRtcTransport.h b/webrtc/WebRtcTransport.h index e418cdf8..2b8f8a2c 100644 --- a/webrtc/WebRtcTransport.h +++ b/webrtc/WebRtcTransport.h @@ -1,4 +1,14 @@ -#pragma once +/* + * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. + * + * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). + * + * Use of this source code is governed by MIT license that can be found in the + * LICENSE file in the root of the source tree. All contributing project authors + * may be found in the AUTHORS file in the root of the source tree. + */ + +#pragma once #include #include diff --git a/webrtc/readme.md b/webrtc/readme.md new file mode 100644 index 00000000..ff832278 --- /dev/null +++ b/webrtc/readme.md @@ -0,0 +1,37 @@ +# 致谢与声明 +本文件夹下部分文件提取自[MediaSoup](https://github.com/versatica/mediasoup) ,分别为: + +- ice相关功能: + - IceServer.cpp + - IceServer.hpp + - StunPacket.cpp + - StunPacket.hpp + - Utils.hpp + +- dtls相关功能: + - DtlsTransport.cpp + - DtlsTransport.hpp + +- srtp相关功能: + - SrtpSession.cpp + - SrtpSession.hpp + + +以上源码有一定的修改和裁剪,感谢MediaSoup开源项目及作者, +用户在使用本项目的同时,应该同时遵循MediaSoup的开源协议。 + +同时,在此也感谢开源项目[easy_webrtc_server](https://github.com/Mihawk086/easy_webrtc_server) 及作者, +在集成MediaSoup相关代码前期,主要参考这个项目。 + +另外,感谢[big panda](<2381267071@qq.com>) 开发并贡献的webrtc js测试客户端(www/webrtc目录下文件), +其开源项目地址为:https://gitee.com/xiongguangjie/zlmrtcclient.js + +# 现状与规划 +ZLMediaKit的WebRTC相关功能目前仅供测试与开发,现在还不成熟,后续主要工作有: + +- 1、完善webrtc rtcp相关功能,包括丢包重传、带宽检测等功能。 +- 2、实现rtp重传等相关功能。 +- 3、实现simulecast相关功能。 +- 4、fec、rtp扩展等其他功能。 +- 5、如果精力允许,逐步替换MediaSoup相关代码,改用自有版权代码。 + diff --git a/www/webrtc/readme.txt b/www/webrtc/readme.txt new file mode 100644 index 00000000..ba651b40 --- /dev/null +++ b/www/webrtc/readme.txt @@ -0,0 +1,2 @@ +感谢[big panda](<2381267071@qq.com>) 开发并贡献此webrtc js测试客户端, +其开源项目地址为:https://gitee.com/xiongguangjie/zlmrtcclient.js \ No newline at end of file