diff --git a/AnyCore/anyrtmpush.cc b/AnyCore/anyrtmpush.cc index 256d22c1057478a89e8bf49a172b33b908a186f6..e277ce55e0fcef7d0b97c793b4da9a54eb578d02 100644 --- a/AnyCore/anyrtmpush.cc +++ b/AnyCore/anyrtmpush.cc @@ -33,7 +33,7 @@ AnyRtmpPush::AnyRtmpPush(AnyRtmpushCallback&callback, const std::string&url) , sound_rate_(3) // 3 = 44 kHz , sound_size_(1) // 1 = 16-bit samples , sound_type_(1) // 0 = Mono sound; 1 = Stereo sound -, rtmp_status_(RS_Init) +, rtmp_status_(RS_STM_Init) , rtmp_(NULL) { str_url_ = url; @@ -46,7 +46,7 @@ AnyRtmpPush::AnyRtmpPush(AnyRtmpushCallback&callback, const std::string&url) AnyRtmpPush::~AnyRtmpPush(void) { running_ = false; - rtmp_status_ = RS_Closed; + rtmp_status_ = RS_STM_Closed; rtc::Thread::SleepMs(100); { rtc::CritScope l(&cs_rtmp_); @@ -368,33 +368,33 @@ void AnyRtmpPush::Run() if(rtmp_ != NULL) { switch (rtmp_status_) { - case RS_Init: + case RS_STM_Init: { if (srs_rtmp_handshake(rtmp_) == 0) { srs_human_trace("SRS: simple handshake ok."); - rtmp_status_ = RS_Handshaked; + rtmp_status_ = RS_STM_Handshaked; } else { CallDisconnect(); } } break; - case RS_Handshaked: + case RS_STM_Handshaked: { if (srs_rtmp_connect_app(rtmp_) == 0) { srs_human_trace("SRS: connect vhost/app ok."); - rtmp_status_ = RS_Connected; + rtmp_status_ = RS_STM_Connected; } else { CallDisconnect(); } } break; - case RS_Connected: + case RS_STM_Connected: { if (srs_rtmp_publish_stream(rtmp_) == 0) { srs_human_trace("SRS: publish stream ok."); - rtmp_status_ = RS_Published; + rtmp_status_ = RS_STM_Published; CallConnect(); } else { @@ -402,7 +402,7 @@ void AnyRtmpPush::Run() } } break; - case RS_Published: + case RS_STM_Published: { DoSendData(); } @@ -439,8 +439,8 @@ void AnyRtmpPush::CallDisconnect() srs_rtmp_destroy(rtmp_); rtmp_ = NULL; } - if(rtmp_status_ != RS_Closed) { - rtmp_status_ = RS_Init; + if(rtmp_status_ != RS_STM_Closed) { + rtmp_status_ = RS_STM_Init; retrys_ ++; if(retrys_ <= MAX_RETRY_TIME) { diff --git a/AnyCore/anyrtmpush.h b/AnyCore/anyrtmpush.h index 58553d7fca43b5d2cb6a07b2ef17ee0035260a05..3af20faf003a159dbce350ed5bf526d8f49544f0 100644 --- a/AnyCore/anyrtmpush.h +++ b/AnyCore/anyrtmpush.h @@ -22,11 +22,11 @@ enum RTMP_STATUS { - RS_Init, - RS_Handshaked, - RS_Connected, - RS_Published, - RS_Closed + RS_STM_Init, + RS_STM_Handshaked, + RS_STM_Connected, + RS_STM_Published, + RS_STM_Closed }; enum ENC_DATA_TYPE{ diff --git a/LICENSE b/LICENSE index 2599f25eb72a32ac283c45a25972641d88f9036d..9cecc1d4669ee8af2ca727a5d8cde10cd8b2d7cc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/] + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {fullname} + Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see [http://www.gnu.org/licenses/]. + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - AnyRTC-RTMP Copyright (C) 2016 Eric涓嶇埍 + {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -[http://www.gnu.org/licenses/]. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -[http://www.gnu.org/philosophy/why-not-lgpl.html]. \ No newline at end of file +. diff --git a/Pictures/IMG_0777.png b/Pictures/IMG_0777.png new file mode 100644 index 0000000000000000000000000000000000000000..6e4f412891c659f35a695a76e27eb57882ce94f1 Binary files /dev/null and b/Pictures/IMG_0777.png differ diff --git a/Pictures/IMG_0778.png b/Pictures/IMG_0778.png new file mode 100644 index 0000000000000000000000000000000000000000..ae6fca0642669ae2c47d8b2855c6c6f8bb5f215c Binary files /dev/null and b/Pictures/IMG_0778.png differ diff --git a/Pictures/IMG_0779.png b/Pictures/IMG_0779.png new file mode 100644 index 0000000000000000000000000000000000000000..8d4c3bf50892fe98c6fb84c923f064d5208d8fc6 Binary files /dev/null and b/Pictures/IMG_0779.png differ diff --git a/Prj-iOS/AnyRtmp/ViewController.m b/Prj-iOS/AnyRtmp/ViewController.m index 836cea452720e9df84d78755e68ff65ddb6f1e64..2c1f184516460f21cc0db2833896d59027dd8789 100644 --- a/Prj-iOS/AnyRtmp/ViewController.m +++ b/Prj-iOS/AnyRtmp/ViewController.m @@ -97,7 +97,7 @@ - (UILabel*)powerLabel { if (!_powerLabel) { _powerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)- 40, CGRectGetWidth(self.view.frame), 35)]; - _powerLabel.text = @"Powered by Shanghai Boyuan(DYNC) Electronic Technology CO...LTD"; + _powerLabel.text = @"Powered by Shanghai Boyuan(DYNC) Information Technology CO...LTD"; _powerLabel.numberOfLines = 0; _powerLabel.textAlignment = NSTextAlignmentCenter; _powerLabel.font = [UIFont systemFontOfSize:12]; diff --git a/README.md b/README.md index 82483be7d10244b809dfb3a144625c1ced05e902..ee7e0370af12640f9be339012df941a6f68918cc 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,62 @@ # AnyRTC-RTMP AnyRTC-RTMP
-本次开源的客户端基于RTMP协议的推流拉流客户端,由我司CTO亲自操刀设计,采用跨平台架构一套代码支持Android、iOS、Windows等平台。
-直播涉及的流程:『音视频采集->编码->传输->解码->音视频渲染』本项目统统包含,这不是软文,这是实实在在的商业级实战代码;无论是你新手还是老司机,我们都热烈欢迎您前来筑码。 - -# 项目特点 -**1,商业级开源代码,高效稳定**
-**2,超小内存占有率,移动直播针对性极致优化,代码冗余率极低**
-**3,打破平台壁垒,真正的跨平台,一套核心代码支持Android、iOS、Windows等**
-**4,超过200+Android手机、iOS全平台适配,硬件编解码可保证99%的可用性**
-**5,接口极简,推流:2个 拉流:2个**
-**6,底层库C++核心库代码风格采用:Google code style**
-**7,极简内核,无需再去深扒复杂的FFMpeg代码**
-**8,实用主义,那些什么坑什么优化等概念请搜索相关文章**
-**9,OpenH264软件编码,FFMpeg软件解码,FAAC/FAAD软件编解码,适配不同系统的硬件编解码统统包含**
-**10,支持SRS、Nginx-RTMP等标准RTMP服务;同时支持各大CDN厂商的接入**
- -# 为什么开源? -本公司此次开源移动直播解决方案的根本目的:回馈开源社区,特别是SRS和WebRTC项目,大家也可以看到本次开源项目的框架使用了WebRTC,RTMP协议部分使用的是srs_librtmp;这两个开源项目可以说在流媒体领域给予了大家太多,所以适当的回馈是理所应当。 - -##编译环境 -Android Studio、NDK
+鏈寮婧愮殑瀹㈡埛绔熀浜嶳TMP鍗忚鐨勬帹娴佹媺娴佸鎴风锛岀敱鎴戝徃CTO浜茶嚜鎿嶅垁璁捐锛岄噰鐢ㄨ法骞冲彴鏋舵瀯涓濂椾唬鐮佹敮鎸丄ndroid銆乮OS銆乄indows绛夊钩鍙般
+鐩存挱娑夊強鐨勬祦绋嬶細銆庨煶瑙嗛閲囬泦->缂栫爜->浼犺緭->瑙g爜->闊宠棰戞覆鏌撱忔湰椤圭洰缁熺粺鍖呭惈锛岃繖涓嶆槸杞枃锛岃繖鏄疄瀹炲湪鍦ㄧ殑鍟嗕笟绾у疄鎴樹唬鐮侊紱鏃犺鏄綘鏂版墜杩樻槸鑰佸徃鏈猴紝鎴戜滑閮界儹鐑堟杩庢偍鍓嶆潵绛戠爜銆 + +# 椤圭洰鐗圭偣 +**1锛屽晢涓氱骇寮婧愪唬鐮侊紝楂樻晥绋冲畾**
+**2锛岃秴灏忓唴瀛樺崰鏈夌巼锛岀Щ鍔ㄧ洿鎾拡瀵规ф瀬鑷翠紭鍖栵紝浠g爜鍐椾綑鐜囨瀬浣**
+**3锛屾墦鐮村钩鍙板鍨掞紝鐪熸鐨勮法骞冲彴锛屼竴濂楁牳蹇冧唬鐮佹敮鎸丄ndroid銆乮OS銆乄indows绛**
+**4锛岃秴杩200+Android鎵嬫満銆乮OS鍏ㄥ钩鍙伴傞厤锛岀‖浠剁紪瑙g爜鍙繚璇99%鐨勫彲鐢ㄦ**
+**5锛屾帴鍙f瀬绠锛屾帹娴侊細2涓 鎷夋祦锛2涓**
+**6锛屽簳灞傚簱C++鏍稿績搴撲唬鐮侀鏍奸噰鐢細Google code style**
+**7锛屾瀬绠鍐呮牳锛屾棤闇鍐嶅幓娣辨墥澶嶆潅鐨凢FMpeg浠g爜**
+**8锛屽疄鐢ㄤ富涔夛紝閭d簺浠涔堝潙浠涔堜紭鍖栫瓑姒傚康璇锋悳绱㈢浉鍏虫枃绔**
+**9锛孫penH264杞欢缂栫爜锛孎FMpeg杞欢瑙g爜锛孎AAC/FAAD杞欢缂栬В鐮侊紝閫傞厤涓嶅悓绯荤粺鐨勭‖浠剁紪瑙g爜缁熺粺鍖呭惈**
+**10锛屾敮鎸丼RS銆丯ginx-RTMP绛夋爣鍑哛TMP鏈嶅姟锛涘悓鏃舵敮鎸佸悇澶DN鍘傚晢鐨勬帴鍏**
+## 椤圭洰灞曠ず + +![Chat](http://git.oschina.net/dynctm/AnyRTC-RTMP/raw/master/Pictures/IMG_0777.png) ![Chat](http://git.oschina.net/dynctm/AnyRTC-RTMP/raw/master/Pictures/IMG_0778.png)![Chat](http://git.oschina.net/dynctm/AnyRTC-RTMP/raw/master/Pictures/IMG_0779.png) + +# 涓轰粈涔堝紑婧愶紵 +鏈叕鍙告娆″紑婧愮Щ鍔ㄧ洿鎾В鍐虫柟妗堢殑鏍规湰鐩殑锛氬洖棣堝紑婧愮ぞ鍖猴紝鐗瑰埆鏄疭RS鍜學ebRTC椤圭洰锛屽ぇ瀹朵篃鍙互鐪嬪埌鏈寮婧愰」鐩殑妗嗘灦浣跨敤浜哤ebRTC锛孯TMP鍗忚閮ㄥ垎浣跨敤鐨勬槸srs_librtmp锛涜繖涓や釜寮婧愰」鐩彲浠ヨ鍦ㄦ祦濯掍綋棰嗗煙缁欎簣浜嗗ぇ瀹跺お澶氾紝鎵浠ラ傚綋鐨勫洖棣堟槸鐞嗘墍搴斿綋銆 + +##缂栬瘧鐜 +Android Studio銆丯DK
XCode
VS2015
-##支持的系统平台 -Android 4.0及以上
-iOS 8.0及以上
-Windows 7及以上
+##鏀寔鐨勭郴缁熷钩鍙 +Android 4.0鍙婁互涓
+iOS 8.0鍙婁互涓
+Windows 7鍙婁互涓
-##支持的CPU架构 +##鏀寔鐨凜PU鏋舵瀯 Android armv7 arm64
iOS armv7 armv7s arm64
-Windows win32、x64
+Windows win32銆亁64
-##第三方库版本 +##绗笁鏂瑰簱鐗堟湰 libfaac 1.28
libfaad2 2.7
ffmpeg 3.0
libyuv newest
openh264 1.6.0
-##技术交流 -直播技术QQ群:554714720
-连麦技术QQ群:580477436(即将满员)
+##鎶鏈氦娴 +鐩存挱鎶鏈疩Q缇わ細554714720
+杩為害鎶鏈疩Q缇わ細580477436(鍗冲皢婊″憳)
-##授权声明 -本次开源在未授权情况下不可应用于任何的闭源商业项目,具体请参照GNU License中的声明。
-咨询QQ:2628840833
-联系电话:021-65650071
+##鎺堟潈澹版槑 +鏈寮婧愬湪鏈巿鏉冩儏鍐典笅涓嶅彲搴旂敤浜庝换浣曠殑闂簮鍟嗕笟椤圭洰锛屽叿浣撹鍙傜収GNU License涓殑澹版槑銆
+鍜ㄨQQ:2628840833
+鑱旂郴鐢佃瘽:021-65650071
-##版权声明 -若本开源项目涉及到其他软件的版权,请及时联系作者进行修正。
+##鐗堟潈澹版槑 +鑻ユ湰寮婧愰」鐩秹鍙婂埌鍏朵粬杞欢鐨勭増鏉冿紝璇峰強鏃惰仈绯讳綔鑰呰繘琛屼慨姝c
-##捐赠 -本项目不接受任何形式的捐赠,您的支持就是最大的动力。
+##鎹愯禒 +鏈」鐩笉鎺ュ彈浠讳綍褰㈠紡鐨勬崘璧狅紝鎮ㄧ殑鏀寔灏辨槸鏈澶х殑鍔ㄥ姏銆
## License AnyRTC-RTMP is available under the GNU license. See the LICENSE file for more info. -