Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Nimrod A. Abing (on kohima)
2015-03-09 13:21:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
winlin
2015-03-16 15:35:01 +0800
Commit
bc9314742681897db8c7d64410983f2f47501fd9
bc931474
1 parent
d8f52918
for #308, disable st examples. for #334, refine the st init and event select.
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
109 行增加
和
31 行删除
trunk/3rdparty/patches/1.st.arm.patch
trunk/3rdparty/patches/2.http.parser.patch
trunk/3rdparty/patches/3.st.osx.kqueue.patch
trunk/3rdparty/patches/4.st.disable.examples.patch
trunk/auto/depends.sh
trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
trunk/src/app/srs_app_st.cpp
trunk/3rdparty/patches/1.st.arm.patch
查看文件 @
bc93147
Only in .: 1.st.arm.patch
diff -r -c ./md.h ../st-1.9-patch-arm/md.h
*** ./md.h 2009-10-02 02:46:43.000000000 +0800
--- ../st-1.9-patch-arm/md.h 2014-03-16 20:49:03.845344804 +0800
*** md.h Fri Oct 2 02:46:43 2009
--- ../st-1.9-patch/md.h Mon Mar 16 15:11:49 2015
***************
*** 422,428 ****
#define MD_STACK_GROWS_DOWN
...
...
trunk/3rdparty/patches/2.http.parser.patch
查看文件 @
bc93147
diff -r -c ./Makefile ../http-parser-2.1/Makefile
*** ./Makefile Tue Mar 10 10:44:19 2015
--- ../http-parser-2.1/Makefile Wed Mar 27 06:35:20 2013
*** Makefile Wed Mar 27 06:35:20 2013
--- ../http-parser-2.1-patch/Makefile Mon Mar 16 15:25:59 2015
***************
*** 12,22 ****
*** 12,17 ****
--- 12,22 ----
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
- # patch by winlin
- CPPFLAGS_FAST = $(CPPFLAGS_DEBUG)
- CFLAGS_FAST = $(CFLAGS_DEBUG)
- CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
-
+ # patch by winlin
+ CPPFLAGS_FAST = $(CPPFLAGS_DEBUG)
+ CFLAGS_FAST = $(CFLAGS_DEBUG)
+ CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
+
test: test_g test_fast
./test_g
./test_fast
--- 12,17 ----
...
...
trunk/3rdparty/patches/3.st.osx.kqueue.patch
0 → 100644
查看文件 @
bc93147
*** io.c Fri Oct 2 06:49:07 2009
--- ../st-1.9-patch/io.c Mon Mar 16 15:06:28 2015
***************
*** 89,94 ****
--- 89,102 ----
if (fdlim > 0 && rlim.rlim_max > (rlim_t) fdlim) {
rlim.rlim_max = fdlim;
}
+
+ /* when rlimit max is negative, for example, osx, use cur directly. */
+ /* @see https://github.com/winlinvip/simple-rtmp-server/issues/336 */
+ if ((int)rlim.rlim_max < 0) {
+ _st_osfd_limit = (int)(fdlim > 0? fdlim : rlim.rlim_cur);
+ return 0;
+ }
+
rlim.rlim_cur = rlim.rlim_max;
if (setrlimit(RLIMIT_NOFILE, &rlim) < 0)
return -1;
...
...
trunk/3rdparty/patches/4.st.disable.examples.patch
0 → 100644
查看文件 @
bc93147
*** Makefile Fri Oct 2 06:55:03 2009
--- ../st-1.9-patch/Makefile Mon Mar 16 15:30:35 2015
***************
*** 310,315 ****
--- 310,319 ----
EXAMPLES =
endif
+ # disable examples for ubuntu crossbuild failed.
+ # @see https://github.com/winlinvip/simple-rtmp-server/issues/308
+ EXAMPLES =
+
ifeq ($(OS), DARWIN)
LINKNAME = libst.$(DSO_SUFFIX)
SONAME = libst.$(MAJOR).$(DSO_SUFFIX)
...
...
trunk/auto/depends.sh
查看文件 @
bc93147
...
...
@@ -376,7 +376,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
_ST_MAKE
=
linux-debug
&&
_ST_EXTRA_CFLAGS
=
"EXTRA_CFLAGS=-DMD_HAVE_EPOLL"
# for osx, use darwin for st, donot use epoll.
if
[
$OS_IS_OSX
=
YES
]
;
then
_ST_MAKE
=
darwin-debug
&&
_ST_EXTRA_CFLAGS
=
""
_ST_MAKE
=
darwin-debug
&&
_ST_EXTRA_CFLAGS
=
"
EXTRA_CFLAGS=-DMD_HAVE_KQUEUE
"
fi
# memory leak for linux-optimized
# @see: https://github.com/winlinvip/simple-rtmp-server/issues/197
...
...
@@ -390,10 +390,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
echo
"build st-1.9t for arm"
;
(
rm -rf
${
SRS_OBJS
}
/st-1.9
&&
cd
${
SRS_OBJS
}
&&
unzip -q ../3rdparty/st-1.9.zip
&&
cd
st-1.9
&&
patch -p0 -R < ../../3rdparty/patches/1.st.arm.patch
&&
make
${
_ST_MAKE
}
CC
=
${
SrsArmCC
}
AR
=
${
SrsArmAR
}
LD
=
${
SrsArmLD
}
RANDLIB
=
${
SrsArmRANDLIB
}
\
EXTRA_CFLAGS
=
${
_ST_EXTRA_CFLAGS
}
&&
unzip -q ../3rdparty/st-1.9.zip
&&
cd
st-1.9
&&
chmod +w
*
&&
patch -p0 < ../../3rdparty/patches/1.st.arm.patch
&&
patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch
&&
patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch
&&
make
${
_ST_MAKE
}
CC
=
${
SrsArmCC
}
AR
=
${
SrsArmAR
}
LD
=
${
SrsArmLD
}
RANDLIB
=
${
SrsArmRANDLIB
}
${
_ST_EXTRA_CFLAGS
}
&&
cd
..
&&
rm -rf st
&&
ln -sf st-1.9/obj st
&&
cd
..
&&
touch
${
SRS_OBJS
}
/_flag.st.arm.tmp
)
...
...
@@ -405,7 +406,9 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
echo
"build st-1.9t"
;
(
rm -rf
${
SRS_OBJS
}
/st-1.9
&&
cd
${
SRS_OBJS
}
&&
unzip -q ../3rdparty/st-1.9.zip
&&
cd
st-1.9
&&
unzip -q ../3rdparty/st-1.9.zip
&&
cd
st-1.9
&&
chmod +w
*
&&
patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch
&&
patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch
&&
make
${
_ST_MAKE
}
${
_ST_EXTRA_CFLAGS
}
&&
cd
..
&&
rm -rf st
&&
ln -sf st-1.9/obj st
&&
cd
..
&&
rm -f
${
SRS_OBJS
}
/_flag.st.arm.tmp
...
...
@@ -431,7 +434,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then
(
rm -rf
${
SRS_OBJS
}
/http-parser-2.1
&&
cd
${
SRS_OBJS
}
&&
unzip -q ../3rdparty/http-parser-2.1.zip
&&
cd
http-parser-2.1
&&
patch -p0
-R
< ../../3rdparty/patches/2.http.parser.patch
&&
patch -p0 < ../../3rdparty/patches/2.http.parser.patch
&&
sed -i
"s/CPPFLAGS_FAST +=.*
$/
CPPFLAGS_FAST =
\$\(
CPPFLAGS_DEBUG
\)
/g"
Makefile
&&
sed -i
"s/CFLAGS_FAST =.*
$/
CFLAGS_FAST =
\$\(
CFLAGS_DEBUG
\)
/g"
Makefile
&&
make
CC
=
${
SrsArmCC
}
AR
=
${
SrsArmAR
}
package
&&
...
...
@@ -448,7 +451,7 @@ if [ $SRS_HTTP_PARSER = YES ]; then
(
rm -rf
${
SRS_OBJS
}
/http-parser-2.1
&&
cd
${
SRS_OBJS
}
&&
unzip -q ../3rdparty/http-parser-2.1.zip
&&
cd
http-parser-2.1
&&
patch -p0
-R
< ../../3rdparty/patches/2.http.parser.patch
&&
patch -p0 < ../../3rdparty/patches/2.http.parser.patch
&&
make package
&&
cd
..
&&
rm -rf hp
&&
ln -sf http-parser-2.1 hp
&&
cd
..
&&
rm -f
${
SRS_OBJS
}
/_flag.st.hp.tmp
...
...
trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
查看文件 @
bc93147
...
...
@@ -87,6 +87,13 @@
3C663F181AB0155100286D8B /* srs_play.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0B1AB0155100286D8B /* srs_play.c */; };
3C663F191AB0155100286D8B /* srs_publish.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0C1AB0155100286D8B /* srs_publish.c */; };
3C663F1A1AB0155100286D8B /* srs_rtmp_dump.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */; };
3C689F961AB6AAAC00C9CEEE /* event.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F921AB6AAAC00C9CEEE /* event.c */; };
3C689F971AB6AAAC00C9CEEE /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F931AB6AAAC00C9CEEE /* io.c */; };
3C689F981AB6AAAC00C9CEEE /* key.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F941AB6AAAC00C9CEEE /* key.c */; };
3C689F9E1AB6AAC800C9CEEE /* md.S in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F991AB6AAC800C9CEEE /* md.S */; };
3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9B1AB6AAC800C9CEEE /* sched.c */; };
3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9C1AB6AAC800C9CEEE /* stk.c */; };
3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9D1AB6AAC800C9CEEE /* sync.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -311,6 +318,16 @@
3C663F0B1AB0155100286D8B /* srs_play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_play.c; path = ../../../research/librtmp/srs_play.c; sourceTree = "<group>"; };
3C663F0C1AB0155100286D8B /* srs_publish.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_publish.c; path = ../../../research/librtmp/srs_publish.c; sourceTree = "<group>"; };
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>"; };
3C689F911AB6AAAC00C9CEEE /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../../objs/st-1.9/common.h"; sourceTree = "<group>"; };
3C689F921AB6AAAC00C9CEEE /* event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = event.c; path = "../../objs/st-1.9/event.c"; sourceTree = "<group>"; };
3C689F931AB6AAAC00C9CEEE /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = "../../objs/st-1.9/io.c"; sourceTree = "<group>"; };
3C689F941AB6AAAC00C9CEEE /* key.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = key.c; path = "../../objs/st-1.9/key.c"; sourceTree = "<group>"; };
3C689F951AB6AAAC00C9CEEE /* md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = md.h; path = "../../objs/st-1.9/md.h"; sourceTree = "<group>"; };
3C689F991AB6AAC800C9CEEE /* md.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = md.S; path = "../../objs/st-1.9/md.S"; sourceTree = "<group>"; };
3C689F9A1AB6AAC800C9CEEE /* public.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = public.h; path = "../../objs/st-1.9/public.h"; sourceTree = "<group>"; };
3C689F9B1AB6AAC800C9CEEE /* sched.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sched.c; path = "../../objs/st-1.9/sched.c"; sourceTree = "<group>"; };
3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; };
3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -331,6 +348,7 @@
3C1231DC1AAE64A400CE8F6C = {
isa = PBXGroup;
children = (
3C689F901AB6AA9100C9CEEE /* st-1.9 */,
3C1EE6D21AB1366500576EE9 /* doc */,
3C1231E61AAE64A400CE8F6C /* Products */,
3C1232EE1AAEA71C00CE8F6C /* links */,
...
...
@@ -672,6 +690,23 @@
path = srs_xcode;
sourceTree = "<group>";
};
3C689F901AB6AA9100C9CEEE /* st-1.9 */ = {
isa = PBXGroup;
children = (
3C689F991AB6AAC800C9CEEE /* md.S */,
3C689F9A1AB6AAC800C9CEEE /* public.h */,
3C689F9B1AB6AAC800C9CEEE /* sched.c */,
3C689F9C1AB6AAC800C9CEEE /* stk.c */,
3C689F9D1AB6AAC800C9CEEE /* sync.c */,
3C689F911AB6AAAC00C9CEEE /* common.h */,
3C689F921AB6AAAC00C9CEEE /* event.c */,
3C689F931AB6AAAC00C9CEEE /* io.c */,
3C689F941AB6AAAC00C9CEEE /* key.c */,
3C689F951AB6AAAC00C9CEEE /* md.h */,
);
name = "st-1.9";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
...
...
@@ -730,6 +765,7 @@
files = (
3C1232951AAE81D900CE8F6C /* srs_app_config.cpp in Sources */,
3C663F0F1AB0155100286D8B /* srs_aac_raw_publish.c in Sources */,
3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */,
3C1232961AAE81D900CE8F6C /* srs_app_conn.cpp in Sources */,
3C12322A1AAE814D00CE8F6C /* srs_kernel_ts.cpp in Sources */,
3C12329E1AAE81D900CE8F6C /* srs_app_hls.cpp in Sources */,
...
...
@@ -737,6 +773,7 @@
3C663F131AB0155100286D8B /* srs_flv_injecter.c in Sources */,
3C1232971AAE81D900CE8F6C /* srs_app_dvr.cpp in Sources */,
3C1232271AAE814D00CE8F6C /* srs_kernel_log.cpp in Sources */,
3C689F961AB6AAAC00C9CEEE /* event.c in Sources */,
3C1232A81AAE81D900CE8F6C /* srs_app_log.cpp in Sources */,
3C1232A41AAE81D900CE8F6C /* srs_app_ingest.cpp in Sources */,
3C1232B41AAE81D900CE8F6C /* srs_app_st.cpp in Sources */,
...
...
@@ -764,6 +801,7 @@
3C1232491AAE81A400CE8F6C /* srs_rtmp_utility.cpp in Sources */,
3C663F191AB0155100286D8B /* srs_publish.c in Sources */,
3C1232A01AAE81D900CE8F6C /* srs_app_http_client.cpp in Sources */,
3C689F981AB6AAAC00C9CEEE /* key.c in Sources */,
3C12329B1AAE81D900CE8F6C /* srs_app_ffmpeg.cpp in Sources */,
3C1232421AAE81A400CE8F6C /* srs_rtmp_amf0.cpp in Sources */,
3C1232AA1AAE81D900CE8F6C /* srs_app_pithy_print.cpp in Sources */,
...
...
@@ -774,12 +812,14 @@
3C1232A21AAE81D900CE8F6C /* srs_app_http_hooks.cpp in Sources */,
3C663F121AB0155100286D8B /* srs_detect_rtmp.c in Sources */,
3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */,
3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */,
3C1232B31AAE81D900CE8F6C /* srs_app_st_socket.cpp in Sources */,
3C1232061AAE812C00CE8F6C /* srs_main_server.cpp in Sources */,
3C1232281AAE814D00CE8F6C /* srs_kernel_mp3.cpp in Sources */,
3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */,
3C1231F71AAE652D00CE8F6C /* srs_core_performance.cpp in Sources */,
3C1232981AAE81D900CE8F6C /* srs_app_edge.cpp in Sources */,
3C689F9E1AB6AAC800C9CEEE /* md.S in Sources */,
3C1232461AAE81A400CE8F6C /* srs_rtmp_msg_array.cpp in Sources */,
3C1232A71AAE81D900CE8F6C /* srs_app_listener.cpp in Sources */,
3C1232261AAE814D00CE8F6C /* srs_kernel_flv.cpp in Sources */,
...
...
@@ -788,6 +828,7 @@
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
3C1232291AAE814D00CE8F6C /* srs_kernel_stream.cpp in Sources */,
3C663F181AB0155100286D8B /* srs_play.c in Sources */,
3C689F971AB6AAAC00C9CEEE /* io.c in Sources */,
3C1232B61AAE81D900CE8F6C /* srs_app_thread.cpp in Sources */,
3C1232A91AAE81D900CE8F6C /* srs_app_mpegts_udp.cpp in Sources */,
3C1232AE1AAE81D900CE8F6C /* srs_app_rtmp_conn.cpp in Sources */,
...
...
@@ -802,6 +843,7 @@
3C12329D1AAE81D900CE8F6C /* srs_app_heartbeat.cpp in Sources */,
3C1232231AAE814D00CE8F6C /* srs_kernel_consts.cpp in Sources */,
3C1232AF1AAE81D900CE8F6C /* srs_app_rtsp.cpp in Sources */,
3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */,
3C1232A31AAE81D900CE8F6C /* srs_app_http.cpp in Sources */,
3C12329A1AAE81D900CE8F6C /* srs_app_encoder.cpp in Sources */,
);
...
...
trunk/src/app/srs_app_st.cpp
查看文件 @
bc93147
...
...
@@ -26,8 +26,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#if
ndef SRS_OSX
#if
def __linux__
#include <sys/epoll.h>
bool
srs_st_epoll_is_supported
(
void
)
{
struct
epoll_event
ev
;
...
...
@@ -45,30 +46,31 @@ int srs_init_st()
{
int
ret
=
ERROR_SUCCESS
;
#if
ndef SRS_OSX
#if
def __linux__
// check epoll, some old linux donot support epoll.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/162
if
(
!
srs_st_epoll_is_supported
())
{
ret
=
ERROR_ST_SET_EPOLL
;
srs_error
(
"epoll required. ret=%d"
,
ret
);
srs_error
(
"epoll required
on Linux
. ret=%d"
,
ret
);
return
ret
;
}
#endif
// use linux epoll.
// Select the best event system available on the OS. In Linux this is
// epoll(). On BSD it will be kqueue.
if
(
st_set_eventsys
(
ST_EVENTSYS_ALT
)
==
-
1
)
{
ret
=
ERROR_ST_SET_EPOLL
;
srs_error
(
"st_set_eventsys use
linux epoll failed. ret=%d"
,
ret
);
srs_error
(
"st_set_eventsys use
%s failed. ret=%d"
,
st_get_eventsys_name
()
,
ret
);
return
ret
;
}
srs_verbose
(
"st_set_eventsys use linux epoll success"
);
#endif
srs_trace
(
"st_set_eventsys to %s"
,
st_get_eventsys_name
());
if
(
st_init
()
!=
0
){
ret
=
ERROR_ST_INITIALIZE
;
srs_error
(
"st_init failed. ret=%d"
,
ret
);
return
ret
;
}
srs_
verbose
(
"st_init success"
);
srs_
trace
(
"st_init success, use %s"
,
st_get_eventsys_name
()
);
return
ret
;
}
...
...
请
注册
或
登录
后发表评论