Skip to content

Commit 659e173

Browse files
committed
RTC: Refine for writing doc. 4.0.92
1 parent f4f616d commit 659e173

File tree

7 files changed

+67
-84
lines changed

7 files changed

+67
-84
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \
2222
ossrs/srs:v4.0.85
2323
```
2424

25-
> To enable WebRTC, user MUST set the env `CANDIDATE`, see [#307](https://github.com/ossrs/srs/issues/307#issue-76908382).
25+
> To enable WebRTC, user MUST set the env `CANDIDATE`, see [wiki](https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate).
2626
2727
Open [http://localhost:8080/](http://localhost:8080/) to check it, then publish
2828
[stream](https://github.com/ossrs/srs/blob/3.0release/trunk/doc/source.flv) by:
@@ -67,8 +67,7 @@ Fast index for Wikis:
6767
* How to deliver HTTP-FLV streaming?([CN][v4_CN_SampleHttpFlv], [EN][v4_EN_SampleHttpFlv])
6868
* How to deliver HLS streaming?([CN][v4_CN_SampleHLS], [EN][v4_EN_SampleHLS])
6969
* How to deliver low-latency streaming?([CN][v4_CN_SampleRealtime], [EN][v4_EN_SampleRealtime])
70-
* Usage: How to play WebRTC from SRS? [#307](https://github.com/ossrs/srs/issues/307)
71-
* Usage: How to publish WebRTC to SRS? [#307](https://github.com/ossrs/srs/issues/307)
70+
* How to use WebRTC? ([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC])
7271

7372
Other important wiki:
7473

@@ -1258,8 +1257,8 @@ Maintainers of SRS project:
12581257
* [Winlin](https://github.com/winlinvip): All areas of streaming server and documents.
12591258
* [Wenjie](https://github.com/wenjiegit): The focus of his work is on the [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module.
12601259
* [Runner365](https://github.com/runner365): The focus of his work is on the [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) module.
1261-
* [John](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_RTCWiki) module.
1262-
* [B.P.Y(Bepartofyou)](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_RTCWiki) module.
1260+
* [John](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module.
1261+
* [B.P.Y(Bepartofyou)](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module.
12631262
* [Lixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) module.
12641263

12651264
A big THANK YOU goes to:
@@ -1382,6 +1381,8 @@ Winlin
13821381
[v4_EN_SampleForward]: https://github.com/ossrs/srs/wiki/v4_EN_SampleForward
13831382
[v4_CN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_CN_SampleRealtime
13841383
[v4_EN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_EN_SampleRealtime
1384+
[v4_CN_WebRTC]: https://github.com/ossrs/srs/wiki/v4_CN_WebRTC
1385+
[v4_EN_WebRTC]: https://github.com/ossrs/srs/wiki/v4_EN_WebRTC
13851386
[v4_CN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_CN_SampleARM
13861387
[v4_EN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_EN_SampleARM
13871388
[v4_CN_SampleIngest]: https://github.com/ossrs/srs/wiki/v4_CN_SampleIngest
@@ -1812,7 +1813,6 @@ Winlin
18121813
[bug #1543]: https://github.com/ossrs/srs/issues/1543
18131814
[bug #1509]: https://github.com/ossrs/srs/issues/1509
18141815
[bug #1575]: https://github.com/ossrs/srs/issues/1575
1815-
[bug #307]: https://github.com/ossrs/srs/issues/307
18161816
[bug #1070]: https://github.com/ossrs/srs/issues/1070
18171817
[bug #1580]: https://github.com/ossrs/srs/issues/1580
18181818
[bug #1547]: https://github.com/ossrs/srs/issues/1547

trunk/conf/full.conf

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -446,52 +446,53 @@ srt_server {
446446
rtc_server {
447447
# Whether enable WebRTC server.
448448
# default: off
449-
enabled on;
449+
enabled on;
450450
# The udp listen port, we will reuse it for connections.
451451
# default: 8000
452-
listen 8000;
452+
listen 8000;
453453
# The exposed candidate IPs, response in SDP candidate line. It can be:
454454
# * Retrieve server IP automatically, from all network interfaces.
455455
# eth0 Retrieve server IP by specified network interface name. # TODO: Implements it.
456-
# $CANDIDATE Read the IP from ENV variable, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
456+
# $CANDIDATE Read the IP from ENV variable, use * if not set.
457457
# x.x.x.x A specified IP address or DNS name, which can be access by client such as Chrome.
458458
# You can specific more than one interface name:
459459
# eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it.
460460
# Also by IP or DNS names:
461461
# 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it.
462462
# And by multiple ENV variables:
463463
# $CANDIDATE $EIP # TODO: Implements it.
464-
# @remark For Firefox, the candidate MUST be IP, MUST NOT be DNS name, see also https://github.com/ossrs/srs/pull/1998#issuecomment-726442999
464+
# @remark For Firefox, the candidate MUST be IP, MUST NOT be DNS name.
465+
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
465466
# default: *
466-
candidate *;
467-
# The IP family filter for candidate, it can be:
467+
candidate *;
468+
# The IP family filter for auto discover candidate, it can be:
468469
# ipv4 Filter IP v4 candidates.
469470
# ipv6 Filter IP v6 candidates.
470471
# all Filter all IP v4 or v6 candidates.
471472
# For example, if set to ipv4, we only use the IPv4 address as candidate.
472473
# default: ipv4
473-
ip_family ipv4;
474+
ip_family ipv4;
474475
# Whether use ECDSA certificate.
475476
# If not, use RSA certificate.
476477
# default: on
477-
ecdsa on;
478+
ecdsa on;
478479
# Whether encrypt RTP packet by SRTP.
479480
# @remark Should always turn it on, or Chrome will fail.
480481
# default: on
481-
encrypt on;
482+
encrypt on;
482483
# We listen multiple times at the same port, by REUSEPORT, to increase the UDP queue.
483484
# Note that you can set to 1 and increase the system UDP buffer size by net.core.rmem_max
484485
# and net.core.rmem_default or just increase this to get larger UDP recv and send buffer.
485486
# default: 1
486-
reuseport 1;
487+
reuseport 1;
487488
# Whether merge multiple NALUs into one.
488489
# @see https://github.com/ossrs/srs/issues/307#issuecomment-612806318
489490
# default: off
490-
merge_nalus off;
491+
merge_nalus off;
491492
# Whether enable the perf stat at http://localhost:1985/api/v1/perf
492493
# TODO: FIXME: We should enable it when refined.
493494
# default: off
494-
perf_stat off;
495+
perf_stat off;
495496
# For RTP packet and its payload cache.
496497
rtp_cache {
497498
# Whether enable the RTP packet cache.
@@ -533,61 +534,58 @@ vhost rtc.vhost.srs.com {
533534
rtc {
534535
# Whether enable WebRTC server.
535536
# default: off
536-
enabled on;
537-
# The strategy for bframe.
538-
# keep Keep bframe, which may make browser with playing problems.
539-
# discard Discard bframe, maybe cause browser with little problems.
540-
# default: keep
541-
bframe discard;
542-
# The strategy for aac audio.
543-
# transcode Transcode aac to opus.
544-
# discard Discard aac audio packet.
545-
# default: transcode
546-
aac transcode;
537+
enabled on;
538+
# Whether support NACK.
539+
# default: on
540+
nack on;
541+
# Whether directly use the packet, avoid copy.
542+
# default: on
543+
nack_no_copy on;
544+
# Whether support TWCC.
545+
# default: on
546+
twcc on;
547547
# The timeout in seconds for session timeout.
548548
# Client will send ping(STUN binding request) to server, we use it as heartbeat.
549549
# default: 30
550-
stun_timeout 30;
551-
# The strick check when process stun.
550+
stun_timeout 30;
551+
# The strict check when process stun.
552552
# default: off
553553
stun_strict_check on;
554554
# The role of dtls when peer is actpass: passive or active
555555
# default: passive
556-
dtls_role passive;
556+
dtls_role passive;
557557
# The version of dtls, support dtls1.0, dtls1.2, and auto
558558
# default: auto
559559
dtls_version auto;
560560
# Drop the packet with the pt(payload type), 0 never drop.
561561
# default: 0
562562
drop_for_pt 0;
563+
###############################################################
564+
# For transmuxing RTMP to RTC, the strategy for bframe.
565+
# keep Keep bframe, which may make browser with playing problems.
566+
# discard Discard bframe, maybe cause browser with little problems.
567+
# default: discard
568+
bframe discard;
569+
# For transmuxing RTMP to RTC, the strategy for aac audio.
570+
# transcode Transcode aac to opus.
571+
# discard Discard aac audio packet.
572+
# default: transcode
573+
aac transcode;
563574
}
564-
# whether enable min delay mode for vhost.
575+
###############################################################
576+
# For transmuxing RTMP to RTC, it will impact the default values if RTC is on.
577+
# Whether enable min delay mode for vhost.
565578
# default: on, for RTC.
566-
min_latency on;
579+
min_latency on;
567580
play {
568581
# set the MW(merged-write) latency in ms.
569582
# @remark For WebRTC, we enable pass-timestamp mode, so we ignore this config.
570583
# default: 0 (For WebRTC)
571-
mw_latency 0;
584+
mw_latency 0;
572585
# Set the MW(merged-write) min messages.
573-
# default: 0 (For Real-Time, min_latency on)
574-
# default: 1 (For WebRTC, min_latency off)
575-
mw_msgs 0;
576-
}
577-
# For NACK.
578-
nack {
579-
# Whether support NACK.
580-
# default: on
581-
enabled on;
582-
# Whether directly use the packet, avoid copy.
583-
# default: on
584-
no_copy on;
585-
}
586-
# For TWCC.
587-
twcc {
588-
# Whether support TWCC.
589-
# default: on
590-
enabled on;
586+
# default: 0 (For Real-Time, that is min_latency on)
587+
# default: 1 (For WebRTC, that is min_latency off)
588+
mw_msgs 0;
591589
}
592590
}
593591

trunk/conf/rtc.conf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@ stats {
1818
network 0;
1919
}
2020
rtc_server {
21-
enabled on;
21+
enabled on;
2222
# Listen at udp://8000
23-
listen 8000;
23+
listen 8000;
2424
#
2525
# The $CANDIDATE means fetch from env, if not configed, use * as default.
2626
#
2727
# The * means retrieving server IP automatically, from all network interfaces,
28-
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
29-
candidate $CANDIDATE;
28+
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
29+
candidate $CANDIDATE;
3030
}
3131

3232
vhost __defaultVhost__ {
3333
rtc {
3434
enabled on;
35-
bframe discard;
3635
}
3736
http_remux {
3837
enabled on;

trunk/src/app/srs_app_config.cpp

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3789,8 +3789,7 @@ srs_error_t SrsConfig::check_normal_config()
37893789
&& n != "play" && n != "publish" && n != "cluster"
37903790
&& n != "security" && n != "http_remux" && n != "dash"
37913791
&& n != "http_static" && n != "hds" && n != "exec"
3792-
&& n != "in_ack_size" && n != "out_ack_size" && n != "rtc" && n != "nack"
3793-
&& n != "twcc") {
3792+
&& n != "in_ack_size" && n != "out_ack_size" && n != "rtc") {
37943793
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.%s", n.c_str());
37953794
}
37963795
// for each sub directives of vhost.
@@ -5104,7 +5103,7 @@ bool SrsConfig::get_rtc_enabled(string vhost)
51045103

51055104
bool SrsConfig::get_rtc_bframe_discard(string vhost)
51065105
{
5107-
static bool DEFAULT = false;
5106+
static bool DEFAULT = true;
51085107

51095108
SrsConfDirective* conf = get_rtc(vhost);
51105109

@@ -5117,7 +5116,7 @@ bool SrsConfig::get_rtc_bframe_discard(string vhost)
51175116
return DEFAULT;
51185117
}
51195118

5120-
return conf->arg0() == "discard";
5119+
return conf->arg0() != "keep";
51215120
}
51225121

51235122
bool SrsConfig::get_rtc_aac_discard(string vhost)
@@ -5214,7 +5213,7 @@ int SrsConfig::get_rtc_drop_for_pt(string vhost)
52145213
{
52155214
static int DEFAULT = 0;
52165215

5217-
SrsConfDirective* conf = get_vhost(vhost);
5216+
SrsConfDirective* conf = get_rtc(vhost);
52185217
if (!conf) {
52195218
return DEFAULT;
52205219
}
@@ -5231,7 +5230,7 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
52315230
{
52325231
static bool DEFAULT = true;
52335232

5234-
SrsConfDirective* conf = get_vhost(vhost);
5233+
SrsConfDirective* conf = get_rtc(vhost);
52355234
if (!conf) {
52365235
return DEFAULT;
52375236
}
@@ -5241,29 +5240,19 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
52415240
return DEFAULT;
52425241
}
52435242

5244-
conf = conf->get("enabled");
5245-
if (!conf || conf->arg0().empty()) {
5246-
return DEFAULT;
5247-
}
5248-
52495243
return SRS_CONF_PERFER_TRUE(conf->arg0());
52505244
}
52515245

52525246
bool SrsConfig::get_rtc_nack_no_copy(string vhost)
52535247
{
52545248
static bool DEFAULT = true;
52555249

5256-
SrsConfDirective* conf = get_vhost(vhost);
5257-
if (!conf) {
5258-
return DEFAULT;
5259-
}
5260-
5261-
conf = conf->get("nack");
5250+
SrsConfDirective* conf = get_rtc(vhost);
52625251
if (!conf) {
52635252
return DEFAULT;
52645253
}
52655254

5266-
conf = conf->get("no_copy");
5255+
conf = conf->get("nack_no_copy");
52675256
if (!conf || conf->arg0().empty()) {
52685257
return DEFAULT;
52695258
}
@@ -5275,7 +5264,7 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost)
52755264
{
52765265
static bool DEFAULT = true;
52775266

5278-
SrsConfDirective* conf = get_vhost(vhost);
5267+
SrsConfDirective* conf = get_rtc(vhost);
52795268
if (!conf) {
52805269
return DEFAULT;
52815270
}
@@ -5285,11 +5274,6 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost)
52855274
return DEFAULT;
52865275
}
52875276

5288-
conf = conf->get("enabled");
5289-
if (!conf || conf->arg0().empty()) {
5290-
return DEFAULT;
5291-
}
5292-
52935277
return SRS_CONF_PERFER_TRUE(conf->arg0());
52945278
}
52955279

trunk/src/app/srs_app_http_stream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ class SrsBufferWriter : public SrsFileWriter
179179
};
180180

181181
// HTTP Live Streaming, to transmux RTMP to HTTP FLV or other format.
182+
// TODO: FIXME: Rename to SrsHttpLive
182183
class SrsLiveStream : public ISrsHttpHandler
183184
{
184185
private:

trunk/src/app/srs_app_source.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ class ISrsSourceBridger
500500
virtual void on_unpublish() = 0;
501501
};
502502

503-
// live streaming source.
503+
// The live streaming source.
504+
// TODO: FIXME: Rename to SrsLiveStream.
504505
class SrsSource : public ISrsReloadHandler
505506
{
506507
friend class SrsOriginHub;

trunk/src/core/srs_core_version4.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626

2727
#define VERSION_MAJOR 4
2828
#define VERSION_MINOR 0
29-
#define VERSION_REVISION 91
29+
#define VERSION_REVISION 92
3030

3131
#endif

0 commit comments

Comments
 (0)