From f2d0c34244006dbc9f206a3bbe2401e038471085 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 31 Mar 2021 17:46:45 +0800 Subject: [PATCH 1/2] RTC: Refine comments for SrsRtpPacket2 --- trunk/src/kernel/srs_kernel_rtc_rtp.cpp | 1 + trunk/src/kernel/srs_kernel_rtc_rtp.hpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/trunk/src/kernel/srs_kernel_rtc_rtp.cpp b/trunk/src/kernel/srs_kernel_rtc_rtp.cpp index 73ba782e0..4b60ca353 100644 --- a/trunk/src/kernel/srs_kernel_rtc_rtp.cpp +++ b/trunk/src/kernel/srs_kernel_rtc_rtp.cpp @@ -1040,6 +1040,7 @@ srs_error_t SrsRtpPacket2::decode(SrsBuffer* buf) nalu_type = SrsAvcNaluType((uint8_t)(buf->head()[0] & kNalTypeMask)); } + // TODO: FIXME: We should keep payload to NULL and return if buffer is empty. // If user set the decode handler, call it to set the payload. if (decode_handler) { decode_handler->on_before_decode_payload(this, buf, &payload_, &payload_type_); diff --git a/trunk/src/kernel/srs_kernel_rtc_rtp.hpp b/trunk/src/kernel/srs_kernel_rtc_rtp.hpp index 7b1fe5d24..09ce5c716 100644 --- a/trunk/src/kernel/srs_kernel_rtc_rtp.hpp +++ b/trunk/src/kernel/srs_kernel_rtc_rtp.hpp @@ -294,8 +294,10 @@ private: private: // The original shared message, all RTP packets can refer to its data. // Note that the size of shared msg, is not the packet size, it's a larger aligned buffer. + // @remark Note that it may point to the whole RTP packet(for RTP parser, which decode RTP packet from buffer), + // and it may point to the RTP payload(for RTMP to RTP, which build RTP header and payload). SrsSharedPtrMessage* shared_buffer_; - // The size of original packet. + // The size of RTP packet or RTP payload. int actual_buffer_size_; // Helper fields. public: @@ -333,6 +335,7 @@ public: // Parse the TWCC extension, ignore by default. void enable_twcc_decode() { header.enable_twcc_decode(); } // SrsRtpPacket2::enable_twcc_decode // Get and set the payload of packet. + // @remark Note that return NULL if no payload. void set_payload(ISrsRtpPayloader* p, SrsRtpPacketPayloadType pt) { payload_ = p; payload_type_ = pt; } ISrsRtpPayloader* payload() { return payload_; } // Set the padding of RTP packet. From 3d4d250eb96107b751ed0305e10cc1cfa5838162 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 31 Mar 2021 18:22:28 +0800 Subject: [PATCH 2/2] RTC: Update performance data --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 7875a5b09..ae624f9a0 100755 --- a/README.md +++ b/README.md @@ -1061,6 +1061,7 @@ The performance benchmark data and corelative commits are listed here. * See also: [Performance for x86/x64 Test Guide][v1_CN_Performance]. * See also: [Performance for RaspberryPi][v1_CN_RaspberryPi]. * For multiple processes performance, read [#775: REUSEPORT][bug #775] or OriginCluster([CN][v3_EN_OriginCluster]/[EN][v3_EN_OriginCluster]) or [go-oryx][oryx]. +* For RTC benchmark, please use [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage). **Play RTMP benchmark** @@ -1114,6 +1115,19 @@ The data for playing HTTP FLV was benchmarked by [SB][srs-bench]: | 2014-05-24 | 2.0.168 | 2.3k(2300) | players | 92% | 276MB | [code][p17] | | 2014-05-24 | 2.0.167 | 1.0k(1000) | players | 82% | 86MB | - | + +**RTC benchmark** + +The RTC benchmark data, by [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage): + + +| Update | SRS | Clients | Type | CPU | Memory | Threads | +| ------------- | --------- | ------------- | ------------- | --------- | -------- | ------- | +| 2021-03-31 | 4.0.87 | 550 | publishers | ~86% | 1.3GB | 1 | +| 2021-03-31 | 4.0.87 | 800 | players | ~94% | 444MB | 1 | + +> Note: CentOS7, 500Kbps, 4CPU, 2.5 GHz Intel Xeon Platinum 8163/8269CY. + **Latency benchmark**