Nimrod A. Abing (on kohima)
Committed by winlin

for #308, disable st examples. for #334, refine the st init and event select.

1 -Only in .: 1.st.arm.patch  
2 -diff -r -c ./md.h ../st-1.9-patch-arm/md.h  
3 -*** ./md.h 2009-10-02 02:46:43.000000000 +0800  
4 ---- ../st-1.9-patch-arm/md.h 2014-03-16 20:49:03.845344804 +0800 1 +*** md.h Fri Oct 2 02:46:43 2009
  2 +--- ../st-1.9-patch/md.h Mon Mar 16 15:11:49 2015
5 *************** 3 ***************
6 *** 422,428 **** 4 *** 422,428 ****
7 #define MD_STACK_GROWS_DOWN 5 #define MD_STACK_GROWS_DOWN
1 -diff -r -c ./Makefile ../http-parser-2.1/Makefile  
2 -*** ./Makefile Tue Mar 10 10:44:19 2015  
3 ---- ../http-parser-2.1/Makefile Wed Mar 27 06:35:20 2013 1 +*** Makefile Wed Mar 27 06:35:20 2013
  2 +--- ../http-parser-2.1-patch/Makefile Mon Mar 16 15:25:59 2015
4 *************** 3 ***************
5 -*** 12,22 **** 4 +*** 12,17 ****
  5 +--- 12,22 ----
6 CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA) 6 CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
7 CFLAGS_LIB = $(CFLAGS_FAST) -fPIC 7 CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
8 8
9 -- # patch by winlin  
10 -- CPPFLAGS_FAST = $(CPPFLAGS_DEBUG)  
11 -- CFLAGS_FAST = $(CFLAGS_DEBUG)  
12 -- CFLAGS_LIB = $(CFLAGS_FAST) -fPIC  
13 -- 9 ++ # patch by winlin
  10 ++ CPPFLAGS_FAST = $(CPPFLAGS_DEBUG)
  11 ++ CFLAGS_FAST = $(CFLAGS_DEBUG)
  12 ++ CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
  13 ++
14 test: test_g test_fast 14 test: test_g test_fast
15 ./test_g 15 ./test_g
16 ./test_fast 16 ./test_fast
17 ---- 12,17 ----  
  1 +*** io.c Fri Oct 2 06:49:07 2009
  2 +--- ../st-1.9-patch/io.c Mon Mar 16 15:06:28 2015
  3 +***************
  4 +*** 89,94 ****
  5 +--- 89,102 ----
  6 + if (fdlim > 0 && rlim.rlim_max > (rlim_t) fdlim) {
  7 + rlim.rlim_max = fdlim;
  8 + }
  9 ++
  10 ++ /* when rlimit max is negative, for example, osx, use cur directly. */
  11 ++ /* @see https://github.com/winlinvip/simple-rtmp-server/issues/336 */
  12 ++ if ((int)rlim.rlim_max < 0) {
  13 ++ _st_osfd_limit = (int)(fdlim > 0? fdlim : rlim.rlim_cur);
  14 ++ return 0;
  15 ++ }
  16 ++
  17 + rlim.rlim_cur = rlim.rlim_max;
  18 + if (setrlimit(RLIMIT_NOFILE, &rlim) < 0)
  19 + return -1;
  1 +*** Makefile Fri Oct 2 06:55:03 2009
  2 +--- ../st-1.9-patch/Makefile Mon Mar 16 15:30:35 2015
  3 +***************
  4 +*** 310,315 ****
  5 +--- 310,319 ----
  6 + EXAMPLES =
  7 + endif
  8 +
  9 ++ # disable examples for ubuntu crossbuild failed.
  10 ++ # @see https://github.com/winlinvip/simple-rtmp-server/issues/308
  11 ++ EXAMPLES =
  12 ++
  13 + ifeq ($(OS), DARWIN)
  14 + LINKNAME = libst.$(DSO_SUFFIX)
  15 + SONAME = libst.$(MAJOR).$(DSO_SUFFIX)
@@ -376,7 +376,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -376,7 +376,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
376 _ST_MAKE=linux-debug && _ST_EXTRA_CFLAGS="EXTRA_CFLAGS=-DMD_HAVE_EPOLL" 376 _ST_MAKE=linux-debug && _ST_EXTRA_CFLAGS="EXTRA_CFLAGS=-DMD_HAVE_EPOLL"
377 # for osx, use darwin for st, donot use epoll. 377 # for osx, use darwin for st, donot use epoll.
378 if [ $OS_IS_OSX = YES ]; then 378 if [ $OS_IS_OSX = YES ]; then
379 - _ST_MAKE=darwin-debug && _ST_EXTRA_CFLAGS="" 379 + _ST_MAKE=darwin-debug && _ST_EXTRA_CFLAGS="EXTRA_CFLAGS=-DMD_HAVE_KQUEUE"
380 fi 380 fi
381 # memory leak for linux-optimized 381 # memory leak for linux-optimized
382 # @see: https://github.com/winlinvip/simple-rtmp-server/issues/197 382 # @see: https://github.com/winlinvip/simple-rtmp-server/issues/197
@@ -390,10 +390,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -390,10 +390,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
390 echo "build st-1.9t for arm"; 390 echo "build st-1.9t for arm";
391 ( 391 (
392 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && 392 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
393 - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&  
394 - patch -p0 -R < ../../3rdparty/patches/1.st.arm.patch &&  
395 - make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} \  
396 - EXTRA_CFLAGS=${_ST_EXTRA_CFLAGS} && 393 + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * &&
  394 + patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&
  395 + patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch &&
  396 + patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch &&
  397 + make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} ${_ST_EXTRA_CFLAGS} &&
397 cd .. && rm -rf st && ln -sf st-1.9/obj st && 398 cd .. && rm -rf st && ln -sf st-1.9/obj st &&
398 cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp 399 cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp
399 ) 400 )
@@ -405,7 +406,9 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -405,7 +406,9 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
405 echo "build st-1.9t"; 406 echo "build st-1.9t";
406 ( 407 (
407 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && 408 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
408 - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && 409 + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * &&
  410 + patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch &&
  411 + patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch &&
409 make ${_ST_MAKE} ${_ST_EXTRA_CFLAGS} && 412 make ${_ST_MAKE} ${_ST_EXTRA_CFLAGS} &&
410 cd .. && rm -rf st && ln -sf st-1.9/obj st && 413 cd .. && rm -rf st && ln -sf st-1.9/obj st &&
411 cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp 414 cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp
@@ -431,7 +434,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then @@ -431,7 +434,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then
431 ( 434 (
432 rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip && 435 rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip &&
433 cd http-parser-2.1 && 436 cd http-parser-2.1 &&
434 - patch -p0 -R < ../../3rdparty/patches/2.http.parser.patch && 437 + patch -p0 < ../../3rdparty/patches/2.http.parser.patch &&
435 sed -i "s/CPPFLAGS_FAST +=.*$/CPPFLAGS_FAST = \$\(CPPFLAGS_DEBUG\)/g" Makefile && 438 sed -i "s/CPPFLAGS_FAST +=.*$/CPPFLAGS_FAST = \$\(CPPFLAGS_DEBUG\)/g" Makefile &&
436 sed -i "s/CFLAGS_FAST =.*$/CFLAGS_FAST = \$\(CFLAGS_DEBUG\)/g" Makefile && 439 sed -i "s/CFLAGS_FAST =.*$/CFLAGS_FAST = \$\(CFLAGS_DEBUG\)/g" Makefile &&
437 make CC=${SrsArmCC} AR=${SrsArmAR} package && 440 make CC=${SrsArmCC} AR=${SrsArmAR} package &&
@@ -448,7 +451,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then @@ -448,7 +451,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then
448 ( 451 (
449 rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip && 452 rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip &&
450 cd http-parser-2.1 && 453 cd http-parser-2.1 &&
451 - patch -p0 -R < ../../3rdparty/patches/2.http.parser.patch && 454 + patch -p0 < ../../3rdparty/patches/2.http.parser.patch &&
452 make package && 455 make package &&
453 cd .. && rm -rf hp && ln -sf http-parser-2.1 hp && 456 cd .. && rm -rf hp && ln -sf http-parser-2.1 hp &&
454 cd .. && rm -f ${SRS_OBJS}/_flag.st.hp.tmp 457 cd .. && rm -f ${SRS_OBJS}/_flag.st.hp.tmp
@@ -87,6 +87,13 @@ @@ -87,6 +87,13 @@
87 3C663F181AB0155100286D8B /* srs_play.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0B1AB0155100286D8B /* srs_play.c */; }; 87 3C663F181AB0155100286D8B /* srs_play.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0B1AB0155100286D8B /* srs_play.c */; };
88 3C663F191AB0155100286D8B /* srs_publish.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0C1AB0155100286D8B /* srs_publish.c */; }; 88 3C663F191AB0155100286D8B /* srs_publish.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0C1AB0155100286D8B /* srs_publish.c */; };
89 3C663F1A1AB0155100286D8B /* srs_rtmp_dump.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */; }; 89 3C663F1A1AB0155100286D8B /* srs_rtmp_dump.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */; };
  90 + 3C689F961AB6AAAC00C9CEEE /* event.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F921AB6AAAC00C9CEEE /* event.c */; };
  91 + 3C689F971AB6AAAC00C9CEEE /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F931AB6AAAC00C9CEEE /* io.c */; };
  92 + 3C689F981AB6AAAC00C9CEEE /* key.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F941AB6AAAC00C9CEEE /* key.c */; };
  93 + 3C689F9E1AB6AAC800C9CEEE /* md.S in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F991AB6AAC800C9CEEE /* md.S */; };
  94 + 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9B1AB6AAC800C9CEEE /* sched.c */; };
  95 + 3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9C1AB6AAC800C9CEEE /* stk.c */; };
  96 + 3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9D1AB6AAC800C9CEEE /* sync.c */; };
90 /* End PBXBuildFile section */ 97 /* End PBXBuildFile section */
91 98
92 /* Begin PBXCopyFilesBuildPhase section */ 99 /* Begin PBXCopyFilesBuildPhase section */
@@ -311,6 +318,16 @@ @@ -311,6 +318,16 @@
311 3C663F0B1AB0155100286D8B /* srs_play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_play.c; path = ../../../research/librtmp/srs_play.c; sourceTree = "<group>"; }; 318 3C663F0B1AB0155100286D8B /* srs_play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_play.c; path = ../../../research/librtmp/srs_play.c; sourceTree = "<group>"; };
312 3C663F0C1AB0155100286D8B /* srs_publish.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_publish.c; path = ../../../research/librtmp/srs_publish.c; sourceTree = "<group>"; }; 319 3C663F0C1AB0155100286D8B /* srs_publish.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_publish.c; path = ../../../research/librtmp/srs_publish.c; sourceTree = "<group>"; };
313 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_rtmp_dump.c; path = ../../../research/librtmp/srs_rtmp_dump.c; sourceTree = "<group>"; }; 320 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_rtmp_dump.c; path = ../../../research/librtmp/srs_rtmp_dump.c; sourceTree = "<group>"; };
  321 + 3C689F911AB6AAAC00C9CEEE /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../../objs/st-1.9/common.h"; sourceTree = "<group>"; };
  322 + 3C689F921AB6AAAC00C9CEEE /* event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = event.c; path = "../../objs/st-1.9/event.c"; sourceTree = "<group>"; };
  323 + 3C689F931AB6AAAC00C9CEEE /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = "../../objs/st-1.9/io.c"; sourceTree = "<group>"; };
  324 + 3C689F941AB6AAAC00C9CEEE /* key.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = key.c; path = "../../objs/st-1.9/key.c"; sourceTree = "<group>"; };
  325 + 3C689F951AB6AAAC00C9CEEE /* md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = md.h; path = "../../objs/st-1.9/md.h"; sourceTree = "<group>"; };
  326 + 3C689F991AB6AAC800C9CEEE /* md.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = md.S; path = "../../objs/st-1.9/md.S"; sourceTree = "<group>"; };
  327 + 3C689F9A1AB6AAC800C9CEEE /* public.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = public.h; path = "../../objs/st-1.9/public.h"; sourceTree = "<group>"; };
  328 + 3C689F9B1AB6AAC800C9CEEE /* sched.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sched.c; path = "../../objs/st-1.9/sched.c"; sourceTree = "<group>"; };
  329 + 3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; };
  330 + 3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; };
314 /* End PBXFileReference section */ 331 /* End PBXFileReference section */
315 332
316 /* Begin PBXFrameworksBuildPhase section */ 333 /* Begin PBXFrameworksBuildPhase section */
@@ -331,6 +348,7 @@ @@ -331,6 +348,7 @@
331 3C1231DC1AAE64A400CE8F6C = { 348 3C1231DC1AAE64A400CE8F6C = {
332 isa = PBXGroup; 349 isa = PBXGroup;
333 children = ( 350 children = (
  351 + 3C689F901AB6AA9100C9CEEE /* st-1.9 */,
334 3C1EE6D21AB1366500576EE9 /* doc */, 352 3C1EE6D21AB1366500576EE9 /* doc */,
335 3C1231E61AAE64A400CE8F6C /* Products */, 353 3C1231E61AAE64A400CE8F6C /* Products */,
336 3C1232EE1AAEA71C00CE8F6C /* links */, 354 3C1232EE1AAEA71C00CE8F6C /* links */,
@@ -672,6 +690,23 @@ @@ -672,6 +690,23 @@
672 path = srs_xcode; 690 path = srs_xcode;
673 sourceTree = "<group>"; 691 sourceTree = "<group>";
674 }; 692 };
  693 + 3C689F901AB6AA9100C9CEEE /* st-1.9 */ = {
  694 + isa = PBXGroup;
  695 + children = (
  696 + 3C689F991AB6AAC800C9CEEE /* md.S */,
  697 + 3C689F9A1AB6AAC800C9CEEE /* public.h */,
  698 + 3C689F9B1AB6AAC800C9CEEE /* sched.c */,
  699 + 3C689F9C1AB6AAC800C9CEEE /* stk.c */,
  700 + 3C689F9D1AB6AAC800C9CEEE /* sync.c */,
  701 + 3C689F911AB6AAAC00C9CEEE /* common.h */,
  702 + 3C689F921AB6AAAC00C9CEEE /* event.c */,
  703 + 3C689F931AB6AAAC00C9CEEE /* io.c */,
  704 + 3C689F941AB6AAAC00C9CEEE /* key.c */,
  705 + 3C689F951AB6AAAC00C9CEEE /* md.h */,
  706 + );
  707 + name = "st-1.9";
  708 + sourceTree = "<group>";
  709 + };
675 /* End PBXGroup section */ 710 /* End PBXGroup section */
676 711
677 /* Begin PBXNativeTarget section */ 712 /* Begin PBXNativeTarget section */
@@ -730,6 +765,7 @@ @@ -730,6 +765,7 @@
730 files = ( 765 files = (
731 3C1232951AAE81D900CE8F6C /* srs_app_config.cpp in Sources */, 766 3C1232951AAE81D900CE8F6C /* srs_app_config.cpp in Sources */,
732 3C663F0F1AB0155100286D8B /* srs_aac_raw_publish.c in Sources */, 767 3C663F0F1AB0155100286D8B /* srs_aac_raw_publish.c in Sources */,
  768 + 3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */,
733 3C1232961AAE81D900CE8F6C /* srs_app_conn.cpp in Sources */, 769 3C1232961AAE81D900CE8F6C /* srs_app_conn.cpp in Sources */,
734 3C12322A1AAE814D00CE8F6C /* srs_kernel_ts.cpp in Sources */, 770 3C12322A1AAE814D00CE8F6C /* srs_kernel_ts.cpp in Sources */,
735 3C12329E1AAE81D900CE8F6C /* srs_app_hls.cpp in Sources */, 771 3C12329E1AAE81D900CE8F6C /* srs_app_hls.cpp in Sources */,
@@ -737,6 +773,7 @@ @@ -737,6 +773,7 @@
737 3C663F131AB0155100286D8B /* srs_flv_injecter.c in Sources */, 773 3C663F131AB0155100286D8B /* srs_flv_injecter.c in Sources */,
738 3C1232971AAE81D900CE8F6C /* srs_app_dvr.cpp in Sources */, 774 3C1232971AAE81D900CE8F6C /* srs_app_dvr.cpp in Sources */,
739 3C1232271AAE814D00CE8F6C /* srs_kernel_log.cpp in Sources */, 775 3C1232271AAE814D00CE8F6C /* srs_kernel_log.cpp in Sources */,
  776 + 3C689F961AB6AAAC00C9CEEE /* event.c in Sources */,
740 3C1232A81AAE81D900CE8F6C /* srs_app_log.cpp in Sources */, 777 3C1232A81AAE81D900CE8F6C /* srs_app_log.cpp in Sources */,
741 3C1232A41AAE81D900CE8F6C /* srs_app_ingest.cpp in Sources */, 778 3C1232A41AAE81D900CE8F6C /* srs_app_ingest.cpp in Sources */,
742 3C1232B41AAE81D900CE8F6C /* srs_app_st.cpp in Sources */, 779 3C1232B41AAE81D900CE8F6C /* srs_app_st.cpp in Sources */,
@@ -764,6 +801,7 @@ @@ -764,6 +801,7 @@
764 3C1232491AAE81A400CE8F6C /* srs_rtmp_utility.cpp in Sources */, 801 3C1232491AAE81A400CE8F6C /* srs_rtmp_utility.cpp in Sources */,
765 3C663F191AB0155100286D8B /* srs_publish.c in Sources */, 802 3C663F191AB0155100286D8B /* srs_publish.c in Sources */,
766 3C1232A01AAE81D900CE8F6C /* srs_app_http_client.cpp in Sources */, 803 3C1232A01AAE81D900CE8F6C /* srs_app_http_client.cpp in Sources */,
  804 + 3C689F981AB6AAAC00C9CEEE /* key.c in Sources */,
767 3C12329B1AAE81D900CE8F6C /* srs_app_ffmpeg.cpp in Sources */, 805 3C12329B1AAE81D900CE8F6C /* srs_app_ffmpeg.cpp in Sources */,
768 3C1232421AAE81A400CE8F6C /* srs_rtmp_amf0.cpp in Sources */, 806 3C1232421AAE81A400CE8F6C /* srs_rtmp_amf0.cpp in Sources */,
769 3C1232AA1AAE81D900CE8F6C /* srs_app_pithy_print.cpp in Sources */, 807 3C1232AA1AAE81D900CE8F6C /* srs_app_pithy_print.cpp in Sources */,
@@ -774,12 +812,14 @@ @@ -774,12 +812,14 @@
774 3C1232A21AAE81D900CE8F6C /* srs_app_http_hooks.cpp in Sources */, 812 3C1232A21AAE81D900CE8F6C /* srs_app_http_hooks.cpp in Sources */,
775 3C663F121AB0155100286D8B /* srs_detect_rtmp.c in Sources */, 813 3C663F121AB0155100286D8B /* srs_detect_rtmp.c in Sources */,
776 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */, 814 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */,
  815 + 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */,
777 3C1232B31AAE81D900CE8F6C /* srs_app_st_socket.cpp in Sources */, 816 3C1232B31AAE81D900CE8F6C /* srs_app_st_socket.cpp in Sources */,
778 3C1232061AAE812C00CE8F6C /* srs_main_server.cpp in Sources */, 817 3C1232061AAE812C00CE8F6C /* srs_main_server.cpp in Sources */,
779 3C1232281AAE814D00CE8F6C /* srs_kernel_mp3.cpp in Sources */, 818 3C1232281AAE814D00CE8F6C /* srs_kernel_mp3.cpp in Sources */,
780 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */, 819 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */,
781 3C1231F71AAE652D00CE8F6C /* srs_core_performance.cpp in Sources */, 820 3C1231F71AAE652D00CE8F6C /* srs_core_performance.cpp in Sources */,
782 3C1232981AAE81D900CE8F6C /* srs_app_edge.cpp in Sources */, 821 3C1232981AAE81D900CE8F6C /* srs_app_edge.cpp in Sources */,
  822 + 3C689F9E1AB6AAC800C9CEEE /* md.S in Sources */,
783 3C1232461AAE81A400CE8F6C /* srs_rtmp_msg_array.cpp in Sources */, 823 3C1232461AAE81A400CE8F6C /* srs_rtmp_msg_array.cpp in Sources */,
784 3C1232A71AAE81D900CE8F6C /* srs_app_listener.cpp in Sources */, 824 3C1232A71AAE81D900CE8F6C /* srs_app_listener.cpp in Sources */,
785 3C1232261AAE814D00CE8F6C /* srs_kernel_flv.cpp in Sources */, 825 3C1232261AAE814D00CE8F6C /* srs_kernel_flv.cpp in Sources */,
@@ -788,6 +828,7 @@ @@ -788,6 +828,7 @@
788 3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */, 828 3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
789 3C1232291AAE814D00CE8F6C /* srs_kernel_stream.cpp in Sources */, 829 3C1232291AAE814D00CE8F6C /* srs_kernel_stream.cpp in Sources */,
790 3C663F181AB0155100286D8B /* srs_play.c in Sources */, 830 3C663F181AB0155100286D8B /* srs_play.c in Sources */,
  831 + 3C689F971AB6AAAC00C9CEEE /* io.c in Sources */,
791 3C1232B61AAE81D900CE8F6C /* srs_app_thread.cpp in Sources */, 832 3C1232B61AAE81D900CE8F6C /* srs_app_thread.cpp in Sources */,
792 3C1232A91AAE81D900CE8F6C /* srs_app_mpegts_udp.cpp in Sources */, 833 3C1232A91AAE81D900CE8F6C /* srs_app_mpegts_udp.cpp in Sources */,
793 3C1232AE1AAE81D900CE8F6C /* srs_app_rtmp_conn.cpp in Sources */, 834 3C1232AE1AAE81D900CE8F6C /* srs_app_rtmp_conn.cpp in Sources */,
@@ -802,6 +843,7 @@ @@ -802,6 +843,7 @@
802 3C12329D1AAE81D900CE8F6C /* srs_app_heartbeat.cpp in Sources */, 843 3C12329D1AAE81D900CE8F6C /* srs_app_heartbeat.cpp in Sources */,
803 3C1232231AAE814D00CE8F6C /* srs_kernel_consts.cpp in Sources */, 844 3C1232231AAE814D00CE8F6C /* srs_kernel_consts.cpp in Sources */,
804 3C1232AF1AAE81D900CE8F6C /* srs_app_rtsp.cpp in Sources */, 845 3C1232AF1AAE81D900CE8F6C /* srs_app_rtsp.cpp in Sources */,
  846 + 3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */,
805 3C1232A31AAE81D900CE8F6C /* srs_app_http.cpp in Sources */, 847 3C1232A31AAE81D900CE8F6C /* srs_app_http.cpp in Sources */,
806 3C12329A1AAE81D900CE8F6C /* srs_app_encoder.cpp in Sources */, 848 3C12329A1AAE81D900CE8F6C /* srs_app_encoder.cpp in Sources */,
807 ); 849 );
@@ -26,8 +26,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -26,8 +26,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 #include <srs_kernel_error.hpp> 26 #include <srs_kernel_error.hpp>
27 #include <srs_kernel_log.hpp> 27 #include <srs_kernel_log.hpp>
28 28
29 -#ifndef SRS_OSX 29 +#ifdef __linux__
30 #include <sys/epoll.h> 30 #include <sys/epoll.h>
  31 +
31 bool srs_st_epoll_is_supported(void) 32 bool srs_st_epoll_is_supported(void)
32 { 33 {
33 struct epoll_event ev; 34 struct epoll_event ev;
@@ -45,30 +46,31 @@ int srs_init_st() @@ -45,30 +46,31 @@ int srs_init_st()
45 { 46 {
46 int ret = ERROR_SUCCESS; 47 int ret = ERROR_SUCCESS;
47 48
48 -#ifndef SRS_OSX 49 +#ifdef __linux__
49 // check epoll, some old linux donot support epoll. 50 // check epoll, some old linux donot support epoll.
50 // @see https://github.com/winlinvip/simple-rtmp-server/issues/162 51 // @see https://github.com/winlinvip/simple-rtmp-server/issues/162
51 if (!srs_st_epoll_is_supported()) { 52 if (!srs_st_epoll_is_supported()) {
52 ret = ERROR_ST_SET_EPOLL; 53 ret = ERROR_ST_SET_EPOLL;
53 - srs_error("epoll required. ret=%d", ret); 54 + srs_error("epoll required on Linux. ret=%d", ret);
54 return ret; 55 return ret;
55 } 56 }
  57 +#endif
56 58
57 - // use linux epoll. 59 + // Select the best event system available on the OS. In Linux this is
  60 + // epoll(). On BSD it will be kqueue.
58 if (st_set_eventsys(ST_EVENTSYS_ALT) == -1) { 61 if (st_set_eventsys(ST_EVENTSYS_ALT) == -1) {
59 ret = ERROR_ST_SET_EPOLL; 62 ret = ERROR_ST_SET_EPOLL;
60 - srs_error("st_set_eventsys use linux epoll failed. ret=%d", ret); 63 + srs_error("st_set_eventsys use %s failed. ret=%d", st_get_eventsys_name(), ret);
61 return ret; 64 return ret;
62 } 65 }
63 - srs_verbose("st_set_eventsys use linux epoll success");  
64 -#endif 66 + srs_trace("st_set_eventsys to %s", st_get_eventsys_name());
65 67
66 if(st_init() != 0){ 68 if(st_init() != 0){
67 ret = ERROR_ST_INITIALIZE; 69 ret = ERROR_ST_INITIALIZE;
68 srs_error("st_init failed. ret=%d", ret); 70 srs_error("st_init failed. ret=%d", ret);
69 return ret; 71 return ret;
70 } 72 }
71 - srs_verbose("st_init success"); 73 + srs_trace("st_init success, use %s", st_get_eventsys_name());
72 74
73 return ret; 75 return ret;
74 } 76 }