Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For #1653, #1500, Support GB28181, another solution. #1656

Merged
merged 37 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f911477
Merge pull request #2 from ossrs/3.0release
lam2003 Mar 19, 2020
bbfb03f
修复srs_write_large_iovs中nwrite未累加的错误
lam2003 Mar 19, 2020
cbe9c1d
Support gb28181 sip over udp, ps steam over rtp
xialixin Mar 19, 2020
8b4f84e
fix push.gb28181.conf, gb28181conn repeat call serve()
xialixin Mar 20, 2020
de9a004
Merge branch 'dev-28181' of https://github.com/xialixin/srs into feat…
winlinvip Mar 20, 2020
b6b5236
Update authors
winlinvip Mar 21, 2020
355f351
Merge pull request #1651 from lam2003/3.0release
winlinvip Mar 21, 2020
f89b4b3
For #1651, fix return pnwrite of srs_write_large_iovs. 3.0.135
winlinvip Mar 21, 2020
850a4bb
Fix #1619, configure without utest by default. 3.0.136
winlinvip Mar 21, 2020
0dd6c31
Fix #1629, fix kickoff FLV client bug. 3.0.137
winlinvip Mar 21, 2020
be746da
Merge branch '3.0release' into 4.0release
winlinvip Mar 21, 2020
b12f0e8
Update readme
winlinvip Mar 24, 2020
b3b76b0
Update readme
winlinvip Mar 24, 2020
c339542
Support macOS OSX
winlinvip Mar 28, 2020
3556da4
Fix #1250, Support macOS, OSX, MacbookPro, Apple Darwin. 3.0.138
winlinvip Mar 28, 2020
2d287e3
Merge branch 'feature/macos' into 3.0release
winlinvip Mar 28, 2020
0a030a4
Update
winlinvip Mar 28, 2020
217b8b9
Merge 3.0release
winlinvip Mar 28, 2020
218fe33
For #1250, support osx build
winlinvip Mar 28, 2020
9e8b888
Merge branch '3.0release' into 4.0release
winlinvip Mar 28, 2020
98a7195
Support multiple OS/Platform build cache. 3.0.139
winlinvip Mar 28, 2020
3e0a7ee
Merge branch '3.0release' into 4.0release
winlinvip Mar 28, 2020
f674cab
Release 3.0-b4, 3.0.139
winlinvip Mar 29, 2020
d5339ac
Update package script
winlinvip Mar 29, 2020
c0a8193
Update build script
winlinvip Mar 29, 2020
0081525
Update package script
winlinvip Mar 29, 2020
f8b0bc1
Update build script
winlinvip Mar 29, 2020
b9a3df5
Update utest script
winlinvip Mar 29, 2020
2ba8104
Update coverage script
winlinvip Mar 29, 2020
1c65987
Refine links use relative path
winlinvip Mar 29, 2020
22ec783
Merge branch '3.0release' into 4.0release
winlinvip Mar 29, 2020
80f315f
Support utest on mac osx
winlinvip Mar 29, 2020
6b8f0d8
Merge branch '3.0release' into 4.0release
winlinvip Mar 29, 2020
c99fb99
refactor gb28181, supporting SIP server enable, multiplex, API interface
xialixin Mar 30, 2020
3345586
Merge branch 'dev-28181' of https://github.com/xialixin/srs into xial…
winlinvip Mar 31, 2020
a342f46
Merge branch '4.0release' into xialixin-dev-28181
winlinvip Mar 31, 2020
6012ac4
Refine code
winlinvip Mar 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ jobs:
- image: ossrs/srs:dev
steps:
- checkout
- run: cd trunk && ./configure && make
- run: cd trunk && ./configure --with-utest && make
test:
docker:
- image: ossrs/srs:dev
steps:
- checkout
- run: cd trunk && ./configure --gcov && make && ./objs/srs_utest && bash auto/coverage.sh
- run: cd trunk && ./configure --with-utest --gcov && make && ./objs/srs_utest && bash auto/coverage.sh
workflows:
version: 2
build_and_test:
Expand Down
3 changes: 2 additions & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ CONTRIBUTORS ordered by first contribution.
* lam2003<linmin3@yy.com>
* runner365<shi.weibd@hotmail.com>
* XiaofengWang<wasphin@gmail.com>
* XiaLixin<xialx@yuntongxun.com>
* XiaLixin<xialx@yuntongxun.com>
* yanghuiwen<cainiaodj@qq.com>
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ SRS is a RTMP/HLS/WebRTC/SRT/GB28181 streaming cluster, high efficiency, stable
<a name="product"></a>
## Usage

**Step 1:** Get SRS.
**>>> Step 1:** Get SRS.

```
git clone https://gitee.com/winlinvip/srs.oschina.git srs &&
cd srs/trunk && git remote set-url origin https://github.com/ossrs/srs.git && git pull
```

> Note: Repository too large? Please clone from these [mirrors](#mirrors) instead.
> Note: We use [mirrors(gitee)](#mirrors) here, but it's also ok to directly clone by `git clone https://github.com/ossrs/srs.git && cd srs/trunk`

**Step 2:** Build SRS.
**>>> Step 2:** Build SRS.

```
./configure && make
```

> Remark: Recommend Centos6 64bits, please read wiki([CN][v3_CN_Build],[EN][v3_EN_Build]).
> Remark: Recommend to use Centos7 64bits, please read wiki([CN][v3_CN_Build],[EN][v3_EN_Build]).

> Note: You can also build SRS in docker, please read [docker][docker-dev].

Expand All @@ -38,13 +38,16 @@ cd srs/trunk && git remote set-url origin https://github.com/ossrs/srs.git && gi
./objs/srs -c conf/srs.conf
```

**Whatever**, you can also directly run SRS in [docker][docker-srs3]:
**>>> Whatever**, you can also directly run SRS in [docker][docker-srs3]:

```
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 \
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:3
```

**From here,** strongly recommend to read bellow wikis:
> Note: Again, we use [ACR](https://cr.console.aliyun.com/) here, you can directly run in docker hub by `docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3`

**>>> From here,** strongly recommend to read bellow wikis:

* Usage: How to delivery RTMP?([CN][v1_CN_SampleRTMP], [EN][v1_EN_SampleRTMP])
* Usage: How to delivery RTMP-Edge Cluster?([CN][v3_CN_SampleRTMPCluster], [EN][v3_EN_SampleRTMPCluster])
Expand Down Expand Up @@ -169,6 +172,12 @@ For previous versions, please read:

## V3 changes

* <strong>v3.0, 2020-03-29, [3.0 beta4(3.0.139)][r3.0b4] released. 122674 lines.</strong>
* v3.0, 2020-03-28, Support multiple OS/Platform build cache. 3.0.139
* v3.0, 2020-03-28, For [#1250][bug #1250], support macOS, OSX, MacbookPro, Apple Darwin. 3.0.138
* v3.0, 2020-03-21, For [#1629][bug #1629], fix kickoff FLV client bug. 3.0.137
* v3.0, 2020-03-21, For [#1619][bug #1619], configure without utest by default. 3.0.136
* v3.0, 2020-03-21, For [#1651][bug #1651], fix return pnwrite of srs_write_large_iovs. 3.0.135
* <strong>v3.0, 2020-03-18, [3.0 beta3(3.0.134)][r3.0b3] released. 122509 lines.</strong>
* v3.0, 2020-03-12, For [#1635][bug #1635], inotify watch ConfigMap for reload. 3.0.134
* v3.0, 2020-03-12, For [#1635][bug #1635], support auto reaload config by inotify. 3.0.129
Expand Down Expand Up @@ -776,6 +785,7 @@ For previous versions, please read:

## Releases

* 2020-03-29, [Release v3.0-b3][r3.0b4], 3.0 beta4, 3.0.139, 122674 lines.
* 2020-03-18, [Release v3.0-b3][r3.0b3], 3.0 beta3, 3.0.134, 122509 lines.
* 2020-03-05, [Release v3.0-b2][r3.0b2], 3.0 beta2, 3.0.123, 122170 lines.
* 2020-02-14, [Release v3.0-b1][r3.0b1], 3.0 beta1, 3.0.117, 121964 lines.
Expand Down Expand Up @@ -1710,6 +1720,9 @@ Winlin
[bug #1594]: https://github.com/ossrs/srs/issues/1594
[bug #1630]: https://github.com/ossrs/srs/issues/1630
[bug #1635]: https://github.com/ossrs/srs/issues/1635
[bug #1651]: https://github.com/ossrs/srs/issues/1651
[bug #1619]: https://github.com/ossrs/srs/issues/1619
[bug #1629]: https://github.com/ossrs/srs/issues/1629
[bug #yyyyyyyyyyyyy]: https://github.com/ossrs/srs/issues/yyyyyyyyyyyyy

[bug #1631]: https://github.com/ossrs/srs/issues/1631
Expand All @@ -1718,6 +1731,7 @@ Winlin

[exo #828]: https://github.com/google/ExoPlayer/pull/828

[r3.0b4]: https://github.com/ossrs/srs/releases/tag/v3.0-b4
[r3.0b3]: https://github.com/ossrs/srs/releases/tag/v3.0-b3
[r3.0b2]: https://github.com/ossrs/srs/releases/tag/v3.0-b2
[r3.0b1]: https://github.com/ossrs/srs/releases/tag/v3.0-b1
Expand Down
1 change: 1 addition & 0 deletions trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ srs
*.ts
*.h264
*.264
3rdparty/ffmpeg-4.2-fit
12 changes: 9 additions & 3 deletions trunk/3rdparty/st-srs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ OTHER_FLAGS = -Wall
endif

ifeq ($(OS), DARWIN)
EXTRA_OBJS = $(TARGETDIR)/md_darwin.o
LD = cc
SFLAGS = -fPIC -fno-common
DSO_SUFFIX = dylib
Expand All @@ -139,8 +140,8 @@ CFLAGS += -arch ppc
LDFLAGS += -arch ppc
endif
ifeq ($(INTEL), yes)
CFLAGS += -arch i386 -arch x86_64
LDFLAGS += -arch i386 -arch x86_64
CFLAGS += -arch x86_64
LDFLAGS += -arch x86_64
endif
LDFLAGS += -dynamiclib -install_name /sw/lib/libst.$(MAJOR).$(DSO_SUFFIX) -compatibility_version $(MAJOR) -current_version $(VERSION)
OTHER_FLAGS = -Wall
Expand Down Expand Up @@ -313,7 +314,9 @@ endif
# for SRS
# disable examples for ubuntu crossbuild failed.
# @see https://github.com/winlinvip/simple-rtmp-server/issues/308
ifeq ($(OS), LINUX)
EXAMPLES =
endif

ifeq ($(OS), DARWIN)
LINKNAME = libst.$(DSO_SUFFIX)
Expand Down Expand Up @@ -369,10 +372,13 @@ $(HEADER): public.h
$(TARGETDIR)/md.o: md.S
$(CC) $(CFLAGS) -c $< -o $@

$(TARGETDIR)/md_darwin.o: md_darwin.S
$(CC) $(CFLAGS) -c $< -o $@

$(TARGETDIR)/%.o: %.c common.h md.h
$(CC) $(CFLAGS) -c $< -o $@

examples::
examples: $(SLIBRARY)
@echo Making $@
@cd $@; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" OS="$(OS)" TARGETDIR="$(TARGETDIR)"

Expand Down
32 changes: 18 additions & 14 deletions trunk/3rdparty/st-srs/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,30 @@
#define MD_ALWAYS_UNSERIALIZED_ACCEPT
#define MD_HAVE_SOCKLEN_T

#define MD_SETJMP(env) _setjmp(env)
#define MD_LONGJMP(env, val) _longjmp(env, val)
#define MD_USE_BUILTIN_SETJMP

#if defined(__ppc__)
#define MD_JB_SP 0
#elif defined(__i386__)
#define MD_JB_SP 9
#elif defined(__x86_64__)
#define MD_JB_SP 4
#if defined(__amd64__) || defined(__x86_64__)
#define JB_SP 12
#define MD_GET_SP(_t) *((long *)&((_t)->context[JB_SP]))
#else
#error Unknown CPU architecture
#endif

#define MD_INIT_CONTEXT(_thread, _sp, _main) \
ST_BEGIN_MACRO \
if (MD_SETJMP((_thread)->context)) \
_main(); \
*((long *)&((_thread)->context[MD_JB_SP])) = (long) (_sp); \
#define MD_INIT_CONTEXT(_thread, _sp, _main) \
ST_BEGIN_MACRO \
if (MD_SETJMP((_thread)->context)) \
_main(); \
MD_GET_SP(_thread) = (long) (_sp); \
ST_END_MACRO

#if defined(MD_USE_BUILTIN_SETJMP)
#define MD_SETJMP(env) _st_md_cxt_save(env)
#define MD_LONGJMP(env, val) _st_md_cxt_restore(env, val)

extern int _st_md_cxt_save(jmp_buf env);
extern void _st_md_cxt_restore(jmp_buf env, int val);
#endif

#define MD_GET_UTIME() \
struct timeval tv; \
(void) gettimeofday(&tv, NULL); \
Expand Down
76 changes: 76 additions & 0 deletions trunk/3rdparty/st-srs/md_darwin.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

/* If user disable the ASM, such as avoiding bugs in ASM, donot compile it. */
#if !defined(MD_ST_NO_ASM)

#if defined(__amd64__) || defined(__x86_64__)

/****************************************************************/

/*
* Internal __jmp_buf layout
*/
#define JB_RBX 0
#define JB_RBP 1
#define JB_R12 2 /* Backup IP, https://www.cnblogs.com/Five100Miles/p/8458561.html */
#define JB_R13 3 /* Backup SP, https://www.cnblogs.com/Five100Miles/p/8458561.html */
#define JB_R14 4 /* Backup LR, https://www.cnblogs.com/Five100Miles/p/8458561.html */
#define JB_R15 5 /* Backup PC, https://www.cnblogs.com/Five100Miles/p/8458561.html */
#define JB_RSP 6
#define JB_PC 7

.file "md_darwin.S"
.text

/* _st_md_cxt_save(__jmp_buf env) */ /* The env is rdi, http://blog.chinaunix.net/uid-20157960-id-1974354.html */
.globl __st_md_cxt_save
.align 16
__st_md_cxt_save:
/*
* Save registers.
*/
movq %rbx, (JB_RBX*8)(%rdi) /* Save rbx to env[0], *(int64_t*)(rdi+0)=rbx */
movq %rbp, (JB_RBP*8)(%rdi) /* Save rbp to env[1], *(int64_t*)(rdi+1)=rbp */
movq %r12, (JB_R12*8)(%rdi) /* Save r12 to env[2], *(int64_t*)(rdi+2)=r12 */
movq %r13, (JB_R13*8)(%rdi) /* Save r13 to env[3], *(int64_t*)(rdi+3)=r13 */
movq %r14, (JB_R14*8)(%rdi) /* Save r14 to env[4], *(int64_t*)(rdi+4)=r14 */
movq %r15, (JB_R15*8)(%rdi) /* Save r15 to env[5], *(int64_t*)(rdi+5)=r15 */
/* Save SP */
leaq 8(%rsp), %rdx /* Save *(int64_t*)(rsp+8) to rdx, https://my.oschina.net/guonaihong/blog/508907 */
movq %rdx, (JB_RSP*8)(%rdi) /* Save rdx(rsp) to env[6], *(int64_t*)(rdi+6)=rdx */
/* Save PC we are returning to */
movq (%rsp), %rax /* Save PC(parent function address) %(rsp) to rax */
movq %rax, (JB_PC*8)(%rdi) /* Save rax(PC) to env[7], *(int64_t*)(rdi+7)=rax */
xorq %rax, %rax /* Reset rax to 0 */
ret


/****************************************************************/

/* _st_md_cxt_restore(__jmp_buf env, int val) */ /* The env is rdi, val is esi/rsi, http://blog.chinaunix.net/uid-20157960-id-1974354.html */
.globl __st_md_cxt_restore
.align 16
__st_md_cxt_restore:
/*
* Restore registers.
*/
movq (JB_RBX*8)(%rdi), %rbx /* Load rbx from env[0] */
movq (JB_RBP*8)(%rdi), %rbp /* Load rbp from env[1] */
movq (JB_R12*8)(%rdi), %r12 /* Load r12 from env[2] */
movq (JB_R13*8)(%rdi), %r13 /* Load r13 from env[3] */
movq (JB_R14*8)(%rdi), %r14 /* Load r14 from env[4] */
movq (JB_R15*8)(%rdi), %r15 /* Load r15 from env[5] */
/* Set return value */ /* The esi is param1 val, the eax is return value */
test %esi, %esi /* if (!val) { */
mov $01, %eax /* val=1; */
cmove %eax, %esi /* } */
mov %esi, %eax /* return val; */
movq (JB_PC*8)(%rdi), %rdx /* Load rdx(PC) from env[7] */
movq (JB_RSP*8)(%rdi), %rsp /* Load rsp from env[6] */
/* Jump to saved PC */
jmpq *%rdx /* Jump to rdx(PC) */

/****************************************************************/

#endif

#endif
5 changes: 5 additions & 0 deletions trunk/auto/auto_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ if [ $SRS_CROSS_BUILD = YES ]; then
else
srs_undefine_macro "SRS_AUTO_CROSSBUILD" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_OSX = YES ]; then
srs_define_macro "SRS_AUTO_OSX" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_OSX" $SRS_AUTO_HEADERS_H
fi

# prefix
echo "" >> $SRS_AUTO_HEADERS_H
Expand Down
2 changes: 1 addition & 1 deletion trunk/auto/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir -p $workdir && cd $workdir
ret=$?; if [[ $ret -ne 0 ]]; then echo "Enter workdir failed, ret=$ret"; exit $ret; fi

# Collect all *.gcno and *.gcda to objs/cover.
cd $workdir && (rm -rf src && cp -R ../../src . && cp -R ../src .)
cd $workdir && (rm -rf src && cp -R ../../src . && cp -R ../src/* src/)
ret=$?; if [[ $ret -ne 0 ]]; then echo "Collect *.gcno and *.gcda failed, ret=$ret"; exit $ret; fi

# Generate *.gcov for coverage.
Expand Down
Loading