+1683
-17
lines changedFilter options
+1683
-17
lines changed Original file line number Diff line number Diff line change
@@ -151,6 +151,7 @@ option(USE_OPENSSL_PC "Use pkg-config to find OpenSSL libraries" ON)
151
151
option(USE_BUSY_WAITING "Enable more accurate sending times at a cost of potentially higher CPU load" OFF)
152
152
option(USE_GNUSTL "Get c++ library/headers from the gnustl.pc" OFF)
153
153
option(ENABLE_SOCK_CLOEXEC "Enable setting SOCK_CLOEXEC on a socket" ON)
154
+
option(ENABLE_NEW_RCVBUFFER "Enable new receiver buffer implementation" ON)
154
155
155
156
option(ENABLE_CLANG_TSA "Enable Clang Thread Safety Analysis" OFF)
156
157
@@ -204,7 +205,6 @@ if (NOT USE_ENCLIB)
204
205
else()
205
206
set (USE_ENCLIB openssl)
206
207
endif()
207
-
208
208
endif()
209
209
210
210
set(USE_ENCLIB "${USE_ENCLIB}" CACHE STRING "The crypto library that SRT uses")
@@ -486,6 +486,14 @@ if (ENABLE_SOCK_CLOEXEC)
486
486
add_definitions(-DENABLE_SOCK_CLOEXEC=1)
487
487
endif()
488
488
489
+
if (ENABLE_NEW_RCVBUFFER)
490
+
add_definitions(-DENABLE_NEW_RCVBUFFER=1)
491
+
message(STATUS "RECEIVER_BUFFER: NEW")
492
+
else()
493
+
remove_definitions(-DENABLE_NEW_RCVBUFFER)
494
+
message(STATUS "RECEIVER_BUFFER: OLD")
495
+
endif()
496
+
489
497
if (CMAKE_MAJOR_VERSION LESS 3)
490
498
set (FORCE_CXX_STANDARD_GNUONLY 1)
491
499
endif()
@@ -1291,6 +1299,7 @@ if (ENABLE_UNITTESTS AND ENABLE_CXX11)
1291
1299
endif()
1292
1300
1293
1301
MafReadDir(test filelist.maf
1302
+
HEADERS SOURCES_unittests
1294
1303
SOURCES SOURCES_unittests
1295
1304
)
1296
1305
Original file line number Diff line number Diff line change
@@ -192,6 +192,11 @@ will be removed when the problem is fixed globally.
192
192
This option enables the standard C++ `thread` and `chrono` libraries (available since C++11)
193
193
to be used by SRT instead of the `pthreads`.
194
194
195
+
**`--enable-new-rcvbuffer`** (default: ON)
196
+
197
+
This option enables the new implementation of the receiver buffer with behavior and code improvements.
198
+
The new receiver buffer is to remain the only one. For the transition period there is a possibility to
199
+
fall back to the old one.
195
200
196
201
**`--enable-profile`** (default: OFF)
197
202
Original file line number Diff line number Diff line change
@@ -151,8 +151,10 @@ void srt::CUDTSocket::setBrokenClosed()
151
151
152
152
bool srt::CUDTSocket::readReady()
153
153
{
154
+
// TODO: Use m_RcvBufferLock here (CUDT::isRcvReadReady())?
154
155
if (m_UDT.m_bConnected && m_UDT.m_pRcvBuffer->isRcvDataReady())
155
156
return true;
157
+
156
158
if (m_UDT.m_bListening)
157
159
return !m_QueuedSockets.empty();
158
160
@@ -2622,7 +2624,11 @@ void srt::CUDTUnited::checkBrokenSockets()
2622
2624
// NOT WHETHER THEY ARE ALSO READY TO PLAY at the time when
2623
2625
// this function is called (isRcvDataReady also checks if the
2624
2626
// available data is "ready to play").
2627
+
#if ENABLE_NEW_RCVBUFFER
2628
+
&& s->core().m_pRcvBuffer->hasAvailablePackets())
2629
+
#else
2625
2630
&& s->core().m_pRcvBuffer->isRcvDataAvailable())
2631
+
#endif
2626
2632
{
2627
2633
const int bc = s->core().m_iBrokenCounter.load();
2628
2634
if (bc > 0)
Original file line number Diff line number Diff line change
@@ -792,6 +792,8 @@ void CSndBuffer::increase()
792
792
793
793
////////////////////////////////////////////////////////////////////////////////
794
794
795
+
#if (!ENABLE_NEW_RCVBUFFER)
796
+
795
797
/*
796
798
* RcvBuffer (circular buffer):
797
799
*
@@ -2289,4 +2291,6 @@ bool CRcvBuffer::scanMsg(int& w_p, int& w_q, bool& w_passack)
2289
2291
return found;
2290
2292
}
2291
2293
2294
+
#endif // !ENABLE_NEW_RCVBUFFER
2295
+
2292
2296
} // namespace srt
Original file line number Diff line number Diff line change
@@ -272,6 +272,8 @@ class CSndBuffer
272
272
273
273
////////////////////////////////////////////////////////////////////////////////
274
274
275
+
#if (!ENABLE_NEW_RCVBUFFER)
276
+
275
277
class CRcvBuffer
276
278
{
277
279
typedef sync::steady_clock::time_point time_point;
@@ -562,6 +564,8 @@ class CRcvBuffer
562
564
CRcvBuffer& operator=(const CRcvBuffer&);
563
565
};
564
566
567
+
#endif // !ENABLE_NEW_RCVBUFFER
568
+
565
569
} // namespace srt
566
570
567
571
#endif
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4