提交 4f5b02af authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Move RTC/REMB to RTC/RembServer and remove ugly availableIncomingBitrate and…

Move RTC/REMB to RTC/RembServer and remove ugly availableIncomingBitrate and availableOutgoingBitrate from Transport.hpp
上级 268d4092
...@@ -207,8 +207,6 @@ test('webRtcTransport.getStats() succeeds', async () => ...@@ -207,8 +207,6 @@ test('webRtcTransport.getStats() succeeds', async () =>
expect(data[0].bytesReceived).toBe(0); expect(data[0].bytesReceived).toBe(0);
expect(data[0].bytesSent).toBe(0); expect(data[0].bytesSent).toBe(0);
expect(data[0].iceSelectedTuple).toBe(undefined); expect(data[0].iceSelectedTuple).toBe(undefined);
expect(data[0].availableIncomingBitrate).toBe(0);
expect(data[0].availableOutgoingBitrate).toBe(0);
expect(data[0].maxIncomingBitrate).toBe(undefined); expect(data[0].maxIncomingBitrate).toBe(undefined);
}, 2000); }, 2000);
......
...@@ -405,34 +405,34 @@ ...@@ -405,34 +405,34 @@
"file": "PATH/src/RTC/RTCP/FeedbackPsRemb.cpp" "file": "PATH/src/RTC/RTCP/FeedbackPsRemb.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/AimdRateControl.o PATH/src/RTC/REMB/AimdRateControl.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/AimdRateControl.o PATH/src/RTC/RembServer/AimdRateControl.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/AimdRateControl.cpp" "file": "PATH/src/RTC/RembServer/AimdRateControl.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/InterArrival.o PATH/src/RTC/REMB/InterArrival.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/InterArrival.o PATH/src/RTC/RembServer/InterArrival.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/InterArrival.cpp" "file": "PATH/src/RTC/RembServer/InterArrival.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/OveruseDetector.o PATH/src/RTC/REMB/OveruseDetector.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/OveruseDetector.o PATH/src/RTC/RembServer/OveruseDetector.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/OveruseDetector.cpp" "file": "PATH/src/RTC/RembServer/OveruseDetector.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/OveruseEstimator.o PATH/src/RTC/REMB/OveruseEstimator.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/OveruseEstimator.o PATH/src/RTC/RembServer/OveruseEstimator.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/OveruseEstimator.cpp" "file": "PATH/src/RTC/RembServer/OveruseEstimator.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.o PATH/src/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.o PATH/src/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.cpp" "file": "PATH/src/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/REMB/RemoteBitrateEstimatorSingleStream.o PATH/src/RTC/REMB/RemoteBitrateEstimatorSingleStream.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/RemoteBitrateEstimatorSingleStream.o PATH/src/RTC/RembServer/RemoteBitrateEstimatorSingleStream.cpp",
"directory": "PATH/out", "directory": "PATH/out",
"file": "PATH/src/RTC/REMB/RemoteBitrateEstimatorSingleStream.cpp" "file": "PATH/src/RTC/RembServer/RemoteBitrateEstimatorSingleStream.cpp"
}, },
{ {
"command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/main.o PATH/src/main.cpp", "command": "c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/main.o PATH/src/main.cpp",
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_AIMD_RATE_CONTROL_HPP #ifndef MS_RTC_REMB_SERVER_AIMD_RATE_CONTROL_HPP
#define MS_RTC_REMB_AIMD_RATE_CONTROL_HPP #define MS_RTC_REMB_SERVER_AIMD_RATE_CONTROL_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/OveruseDetector.hpp" #include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/REMB/RateControlInput.hpp" #include "RTC/RembServer/RateControlInput.hpp"
#include "RTC/REMB/RateControlRegion.hpp" #include "RTC/RembServer/RateControlRegion.hpp"
// A rate control implementation based on additive increases of // A rate control implementation based on additive increases of
// bitrate when no over-use is detected and multiplicative decreases when // bitrate when no over-use is detected and multiplicative decreases when
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
class AimdRateControl class AimdRateControl
{ {
...@@ -175,7 +175,7 @@ namespace RTC ...@@ -175,7 +175,7 @@ namespace RTC
{ {
this->rateControlState = newState; this->rateControlState = newState;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
#ifndef MS_RTC_REMB_BANDWIDTH_USAGE_HPP #ifndef MS_RTC_REMB_SERVER_BANDWIDTH_USAGE_HPP
#define MS_RTC_REMB_BANDWIDTH_USAGE_HPP #define MS_RTC_REMB_SERVER_BANDWIDTH_USAGE_HPP
// webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h // webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
enum BandwidthUsage enum BandwidthUsage
{ {
...@@ -13,7 +13,7 @@ namespace RTC ...@@ -13,7 +13,7 @@ namespace RTC
BW_UNDERUSING, BW_UNDERUSING,
BW_OVERUSING BW_OVERUSING
}; };
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_INTER_ARRIVAL_HPP #ifndef MS_RTC_REMB_SERVER_INTER_ARRIVAL_HPP
#define MS_RTC_REMB_INTER_ARRIVAL_HPP #define MS_RTC_REMB_SERVER_INTER_ARRIVAL_HPP
#include "common.hpp" #include "common.hpp"
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
// Helper class to compute the inter-arrival time delta and the size delta // Helper class to compute the inter-arrival time delta and the size delta
// between two timestamp groups. A timestamp is a 32 bit unsigned number with // between two timestamp groups. A timestamp is a 32 bit unsigned number with
...@@ -99,7 +99,7 @@ namespace RTC ...@@ -99,7 +99,7 @@ namespace RTC
burstGrouping(enableBurstGrouping), numConsecutiveReorderedPackets(0) burstGrouping(enableBurstGrouping), numConsecutiveReorderedPackets(0)
{ {
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_OVERUSE_DETECTOR_HPP #ifndef MS_RTC_REMB_SERVER_OVERUSE_DETECTOR_HPP
#define MS_RTC_REMB_OVERUSE_DETECTOR_HPP #define MS_RTC_REMB_SERVER_OVERUSE_DETECTOR_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp" #include "RTC/RembServer/BandwidthUsage.hpp"
#include "RTC/REMB/RateControlRegion.hpp" #include "RTC/RembServer/RateControlRegion.hpp"
#include <list> #include <list>
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
class OveruseDetector class OveruseDetector
{ {
...@@ -57,7 +57,7 @@ namespace RTC ...@@ -57,7 +57,7 @@ namespace RTC
{ {
return this->hypothesis; return this->hypothesis;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_OVERUSE_ESTIMATOR_HPP #ifndef MS_RTC_REMB_SERVER_OVERUSE_ESTIMATOR_HPP
#define MS_RTC_REMB_OVERUSE_ESTIMATOR_HPP #define MS_RTC_REMB_SERVER_OVERUSE_ESTIMATOR_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp" #include "RTC/RembServer/BandwidthUsage.hpp"
#include <cstring> // std::memcpy() #include <cstring> // std::memcpy()
#include <deque> #include <deque>
#include <utility> #include <utility>
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
// (jmillan) borrowed from webrtc/common_types.h // (jmillan) borrowed from webrtc/common_types.h
// //
...@@ -118,7 +118,7 @@ namespace RTC ...@@ -118,7 +118,7 @@ namespace RTC
{ {
return this->numOfDeltas; return this->numOfDeltas;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
#ifndef MS_RTC_REMB_RATE_CONTROL_INPUT_HPP #ifndef MS_RTC_REMB_SERVER_RATE_CONTROL_INPUT_HPP
#define MS_RTC_REMB_RATE_CONTROL_INPUT_HPP #define MS_RTC_REMB_SERVER_RATE_CONTROL_INPUT_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp" #include "RTC/RembServer/BandwidthUsage.hpp"
// webrtc/modules/remote_bitrate_estimator/include/bweDefines.h // webrtc/modules/remote_bitrate_estimator/include/bweDefines.h
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
struct RateControlInput struct RateControlInput
{ {
...@@ -26,7 +26,7 @@ namespace RTC ...@@ -26,7 +26,7 @@ namespace RTC
: bwState(bwState), incomingBitrate(incomingBitrate), noiseVar(noiseVar) : bwState(bwState), incomingBitrate(incomingBitrate), noiseVar(noiseVar)
{ {
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
#ifndef MS_RTC_REMB_RATE_CONTROL_REGION_HPP #ifndef MS_RTC_REMB_SERVER_RATE_CONTROL_REGION_HPP
#define MS_RTC_REMB_RATE_CONTROL_REGION_HPP #define MS_RTC_REMB_SERVER_RATE_CONTROL_REGION_HPP
// webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h // webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
enum RateControlRegion enum RateControlRegion
{ {
...@@ -13,7 +13,7 @@ namespace RTC ...@@ -13,7 +13,7 @@ namespace RTC
RC_ABOVE_MAX, RC_ABOVE_MAX,
RC_MAX_UNKNOWN RC_MAX_UNKNOWN
}; };
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
// This class estimates the incoming available bandwidth. // This class estimates the incoming available bandwidth.
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_HPP #ifndef MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_HPP
#define MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_HPP #define MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
// (jmillan) borrowed from webrtc/modules/include/module_common_types.h // (jmillan) borrowed from webrtc/modules/include/module_common_types.h
// //
...@@ -76,8 +76,20 @@ namespace RTC ...@@ -76,8 +76,20 @@ namespace RTC
// Process any pending tasks such as timeouts. // Process any pending tasks such as timeouts.
// Called on a worker thread. // Called on a worker thread.
virtual void Process() = 0; virtual void Process() = 0;
uint32_t GetAvailableBitrate() const;
protected:
uint32_t availableBitrate{ 0 };
}; };
} // namespace REMB
/* Inline methods. */
inline uint32_t RemoteBitrateEstimator::GetAvailableBitrate() const
{
return this->availableBitrate;
}
} // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP #ifndef MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP
#define MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP #define MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/AimdRateControl.hpp" #include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp" #include "RTC/RembServer/InterArrival.hpp"
#include "RTC/REMB/OveruseDetector.hpp" #include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/REMB/OveruseEstimator.hpp" #include "RTC/RembServer/OveruseEstimator.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp" #include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include "RTC/RtpDataCounter.hpp" #include "RTC/RtpDataCounter.hpp"
#include <cassert> #include <cassert>
#include <list> #include <list>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
struct Probe struct Probe
{ {
...@@ -152,7 +152,7 @@ namespace RTC ...@@ -152,7 +152,7 @@ namespace RTC
{ {
this->remoteRate.SetMinBitrate(minBitrateBps); this->remoteRate.SetMinBitrate(minBitrateBps);
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP #ifndef MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#define MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP #define MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#include "common.hpp" #include "common.hpp"
#include "RTC/REMB/AimdRateControl.hpp" #include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp" #include "RTC/RembServer/InterArrival.hpp"
#include "RTC/REMB/OveruseEstimator.hpp" #include "RTC/RembServer/OveruseEstimator.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp" #include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include "RTC/RtpDataCounter.hpp" #include "RTC/RtpDataCounter.hpp"
#include <cassert> #include <cassert>
#include <map> #include <map>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator
{ {
...@@ -145,7 +145,7 @@ namespace RTC ...@@ -145,7 +145,7 @@ namespace RTC
{ {
this->remoteRate->SetMinBitrate(minBitrateBps); this->remoteRate->SetMinBitrate(minBitrateBps);
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
#endif #endif
...@@ -123,8 +123,6 @@ namespace RTC ...@@ -123,8 +123,6 @@ namespace RTC
// Others. // Others.
RtpListener rtpListener; RtpListener rtpListener;
struct RTC::RtpHeaderExtensionIds rtpHeaderExtensionIds; struct RTC::RtpHeaderExtensionIds rtpHeaderExtensionIds;
uint32_t availableIncomingBitrate{ 0 };
uint32_t availableOutgoingBitrate{ 0 };
private: private:
// Passed by argument. // Passed by argument.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "RTC/DtlsTransport.hpp" #include "RTC/DtlsTransport.hpp"
#include "RTC/IceCandidate.hpp" #include "RTC/IceCandidate.hpp"
#include "RTC/IceServer.hpp" #include "RTC/IceServer.hpp"
#include "RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp" #include "RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "RTC/SrtpSession.hpp" #include "RTC/SrtpSession.hpp"
#include "RTC/StunMessage.hpp" #include "RTC/StunMessage.hpp"
#include "RTC/TcpConnection.hpp" #include "RTC/TcpConnection.hpp"
...@@ -22,7 +22,7 @@ namespace RTC ...@@ -22,7 +22,7 @@ namespace RTC
public RTC::TcpConnection::Listener, public RTC::TcpConnection::Listener,
public RTC::IceServer::Listener, public RTC::IceServer::Listener,
public RTC::DtlsTransport::Listener, public RTC::DtlsTransport::Listener,
public RTC::REMB::RemoteBitrateEstimator::Listener public RTC::RembServer::RemoteBitrateEstimator::Listener
{ {
private: private:
struct ListenIp struct ListenIp
...@@ -93,10 +93,10 @@ namespace RTC ...@@ -93,10 +93,10 @@ namespace RTC
void OnDtlsApplicationData( void OnDtlsApplicationData(
const RTC::DtlsTransport* dtlsTransport, const uint8_t* data, size_t len) override; const RTC::DtlsTransport* dtlsTransport, const uint8_t* data, size_t len) override;
/* Pure virtual methods inherited from RTC::REMB::RemoteBitrateEstimator::Listener. */ /* Pure virtual methods inherited from RTC::RembServer::RemoteBitrateEstimator::Listener. */
public: public:
void OnRemoteBitrateEstimatorValue( void OnRemoteBitrateEstimatorValue(
const RTC::REMB::RemoteBitrateEstimator* remoteBitrateEstimator, const RTC::RembServer::RemoteBitrateEstimator* remoteBitrateEstimator,
const std::vector<uint32_t>& ssrcs, const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate) override; uint32_t availableBitrate) override;
...@@ -114,7 +114,7 @@ namespace RTC ...@@ -114,7 +114,7 @@ namespace RTC
std::vector<RTC::IceCandidate> iceCandidates; std::vector<RTC::IceCandidate> iceCandidates;
RTC::TransportTuple* iceSelectedTuple{ nullptr }; RTC::TransportTuple* iceSelectedTuple{ nullptr };
RTC::DtlsTransport::Role dtlsRole{ RTC::DtlsTransport::Role::AUTO }; RTC::DtlsTransport::Role dtlsRole{ RTC::DtlsTransport::Role::AUTO };
std::unique_ptr<RTC::REMB::RemoteBitrateEstimatorAbsSendTime> rembRemoteBitrateEstimator; std::unique_ptr<RTC::RembServer::RemoteBitrateEstimatorAbsSendTime> rembServerBitrateEstimator;
uint32_t maxIncomingBitrate{ 0 }; uint32_t maxIncomingBitrate{ 0 };
}; };
} // namespace RTC } // namespace RTC
......
...@@ -97,12 +97,12 @@ ...@@ -97,12 +97,12 @@
'src/RTC/RTCP/FeedbackPsLei.cpp', 'src/RTC/RTCP/FeedbackPsLei.cpp',
'src/RTC/RTCP/FeedbackPsAfb.cpp', 'src/RTC/RTCP/FeedbackPsAfb.cpp',
'src/RTC/RTCP/FeedbackPsRemb.cpp', 'src/RTC/RTCP/FeedbackPsRemb.cpp',
'src/RTC/REMB/AimdRateControl.cpp', 'src/RTC/RembServer/AimdRateControl.cpp',
'src/RTC/REMB/InterArrival.cpp', 'src/RTC/RembServer/InterArrival.cpp',
'src/RTC/REMB/OveruseDetector.cpp', 'src/RTC/RembServer/OveruseDetector.cpp',
'src/RTC/REMB/OveruseEstimator.cpp', 'src/RTC/RembServer/OveruseEstimator.cpp',
'src/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.cpp', 'src/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.cpp',
'src/RTC/REMB/RemoteBitrateEstimatorSingleStream.cpp', 'src/RTC/RembServer/RemoteBitrateEstimatorSingleStream.cpp',
# C++ include files. # C++ include files.
'include/DepLibSRTP.hpp', 'include/DepLibSRTP.hpp',
'include/DepLibUV.hpp', 'include/DepLibUV.hpp',
...@@ -185,13 +185,13 @@ ...@@ -185,13 +185,13 @@
'include/RTC/RTCP/FeedbackPsLei.hpp', 'include/RTC/RTCP/FeedbackPsLei.hpp',
'include/RTC/RTCP/FeedbackPsAfb.hpp', 'include/RTC/RTCP/FeedbackPsAfb.hpp',
'include/RTC/RTCP/FeedbackPsRemb.hpp', 'include/RTC/RTCP/FeedbackPsRemb.hpp',
'include/RTC/REMB/AimdRateControl.hpp', 'include/RTC/RembServer/AimdRateControl.hpp',
'include/RTC/REMB/InterArrival.hpp', 'include/RTC/RembServer/InterArrival.hpp',
'include/RTC/REMB/OveruseDetector.hpp', 'include/RTC/RembServer/OveruseDetector.hpp',
'include/RTC/REMB/OveruseEstimator.hpp', 'include/RTC/RembServer/OveruseEstimator.hpp',
'include/RTC/REMB/RemoteBitrateEstimator.hpp', 'include/RTC/RembServer/RemoteBitrateEstimator.hpp',
'include/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp', 'include/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp',
'include/RTC/REMB/RemoteBitrateEstimatorSingleStream.hpp' 'include/RTC/RembServer/RemoteBitrateEstimatorSingleStream.hpp'
], ],
'include_dirs': 'include_dirs':
[ [
......
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::AimdRateControl" #define MS_CLASS "RTC::RembServer::AimdRateControl"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/AimdRateControl.hpp" #include "RTC/RembServer/AimdRateControl.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp" #include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> // std::lround() #include <cmath> // std::lround()
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
static constexpr int64_t MaxFeedbackIntervalMs{ 1000 }; static constexpr int64_t MaxFeedbackIntervalMs{ 1000 };
...@@ -324,5 +324,5 @@ namespace RTC ...@@ -324,5 +324,5 @@ namespace RTC
} }
} }
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::InterArrival" #define MS_CLASS "RTC::RembServer::InterArrival"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/InterArrival.hpp" #include "RTC/RembServer/InterArrival.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include "Utils.hpp" // LatestTimestamp #include "Utils.hpp" // LatestTimestamp
#include <algorithm> #include <algorithm>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
static constexpr int BurstDeltaThresholdMs{ 5 }; static constexpr int BurstDeltaThresholdMs{ 5 };
...@@ -188,5 +188,5 @@ namespace RTC ...@@ -188,5 +188,5 @@ namespace RTC
this->currentTimestampGroup = TimestampGroup(); this->currentTimestampGroup = TimestampGroup();
this->prevTimestampGroup = TimestampGroup(); this->prevTimestampGroup = TimestampGroup();
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::OveruseDetector" #define MS_CLASS "RTC::RembServer::OveruseDetector"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/OveruseDetector.hpp" #include "RTC/RembServer/OveruseDetector.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
constexpr double MaxAdaptOffsetMs{ 15.0 }; constexpr double MaxAdaptOffsetMs{ 15.0 };
constexpr int MinNumDeltas{ 60 }; constexpr int MinNumDeltas{ 60 };
...@@ -111,5 +111,5 @@ namespace RTC ...@@ -111,5 +111,5 @@ namespace RTC
this->threshold = std::min(std::max(this->threshold, minThreshold), maxThreshold); this->threshold = std::min(std::max(this->threshold, minThreshold), maxThreshold);
this->lastUpdateMs = nowMs; this->lastUpdateMs = nowMs;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::OveruseEstimator" #define MS_CLASS "RTC::RembServer::OveruseEstimator"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/OveruseEstimator.hpp" #include "RTC/RembServer/OveruseEstimator.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
constexpr size_t MinFramePeriodHistoryLength{ 60 }; constexpr size_t MinFramePeriodHistoryLength{ 60 };
constexpr uint16_t DeltaCounterMax{ 1000 }; constexpr uint16_t DeltaCounterMax{ 1000 };
...@@ -142,5 +142,5 @@ namespace RTC ...@@ -142,5 +142,5 @@ namespace RTC
if (this->varNoise < 1) if (this->varNoise < 1)
this->varNoise = 1; this->varNoise = 1;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::RemoteBitrateEstimatorAbsSendTime" #define MS_CLASS "RTC::RembServer::RemoteBitrateEstimatorAbsSendTime"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp" #include "RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "DepLibUV.hpp" #include "DepLibUV.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp" #include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
static constexpr int TimestampGroupLengthMs{ 5 }; static constexpr int TimestampGroupLengthMs{ 5 };
static constexpr uint32_t AbsSendTimeFraction{ 18 }; static constexpr uint32_t AbsSendTimeFraction{ 18 };
...@@ -374,7 +374,9 @@ namespace RTC ...@@ -374,7 +374,9 @@ namespace RTC
if (updateEstimate) if (updateEstimate)
{ {
this->lastUpdateMs = nowMs; this->lastUpdateMs = nowMs;
this->availableBitrate = targetBitrateBps;
this->observer->OnRemoteBitrateEstimatorValue(this, ssrcs, targetBitrateBps); this->observer->OnRemoteBitrateEstimatorValue(this, ssrcs, targetBitrateBps);
} }
} }
...@@ -422,5 +424,5 @@ namespace RTC ...@@ -422,5 +424,5 @@ namespace RTC
return true; return true;
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#define MS_CLASS "RTC::REMB::RemoteBitrateEstimatorSingleStream" #define MS_CLASS "RTC::RembServer::RemoteBitrateEstimatorSingleStream"
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/REMB/RemoteBitrateEstimatorSingleStream.hpp" #include "RTC/RembServer/RemoteBitrateEstimatorSingleStream.hpp"
#include "DepLibUV.hpp" #include "DepLibUV.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include "RTC/REMB/AimdRateControl.hpp" #include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp" #include "RTC/RembServer/InterArrival.hpp"
#include "RTC/REMB/OveruseDetector.hpp" #include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/REMB/OveruseEstimator.hpp" #include "RTC/RembServer/OveruseEstimator.hpp"
#include <utility> // std::make_pair() #include <utility> // std::make_pair()
namespace RTC namespace RTC
{ {
namespace REMB namespace RembServer
{ {
void RemoteBitrateEstimatorSingleStream::IncomingPacket( void RemoteBitrateEstimatorSingleStream::IncomingPacket(
int64_t arrivalTimeMs, int64_t arrivalTimeMs,
...@@ -160,6 +160,8 @@ namespace RTC ...@@ -160,6 +160,8 @@ namespace RTC
// MS_ASSERT(this->processIntervalMs > 0); // MS_ASSERT(this->processIntervalMs > 0);
this->availableBitrate = targetBitrate;
std::vector<uint32_t> ssrcs; std::vector<uint32_t> ssrcs;
GetSsrcs(&ssrcs); GetSsrcs(&ssrcs);
...@@ -203,5 +205,5 @@ namespace RTC ...@@ -203,5 +205,5 @@ namespace RTC
(*ssrcs)[i] = it->first; (*ssrcs)[i] = it->first;
} }
} }
} // namespace REMB } // namespace RembServer
} // namespace RTC } // namespace RTC
...@@ -527,9 +527,10 @@ namespace RTC ...@@ -527,9 +527,10 @@ namespace RTC
// Store REMB info. // Store REMB info.
if (afb->GetApplication() == RTC::RTCP::FeedbackPsAfbPacket::Application::REMB) if (afb->GetApplication() == RTC::RTCP::FeedbackPsAfbPacket::Application::REMB)
{ {
auto* remb = static_cast<RTC::RTCP::FeedbackPsRembPacket*>(afb); // auto* remb = static_cast<RTC::RTCP::FeedbackPsRembPacket*>(afb);
this->availableOutgoingBitrate = remb->GetBitrate(); // TOO: NO. Must pass the packet to the subclass.
// this->availableOutgoingBitrate = remb->GetBitrate();
break; break;
} }
......
...@@ -461,10 +461,15 @@ namespace RTC ...@@ -461,10 +461,15 @@ namespace RTC
} }
// Add availableIncomingBitrate. // Add availableIncomingBitrate.
jsonObject["availableIncomingBitrate"] = this->availableIncomingBitrate; if (this->rembServerBitrateEstimator)
{
jsonObject["availableIncomingBitrate"] =
this->rembServerBitrateEstimator->GetAvailableBitrate();
}
// TODO: We do not have this yet.
// Add availableOutgoingBitrate. // Add availableOutgoingBitrate.
jsonObject["availableOutgoingBitrate"] = this->availableOutgoingBitrate; // jsonObject["availableOutgoingBitrate"] = this->availableOutgoingBitrate;
// Add maxIncomingBitrate. // Add maxIncomingBitrate.
if (this->maxIncomingBitrate != 0u) if (this->maxIncomingBitrate != 0u)
...@@ -582,8 +587,9 @@ namespace RTC ...@@ -582,8 +587,9 @@ namespace RTC
MayRunDtlsTransport(); MayRunDtlsTransport();
} }
// Set remote bitrate estimator. // Set REMB server bitrate estimator.
this->rembRemoteBitrateEstimator.reset(new RTC::REMB::RemoteBitrateEstimatorAbsSendTime(this)); this->rembServerBitrateEstimator.reset(
new RTC::RembServer::RemoteBitrateEstimatorAbsSendTime(this));
// Tell the caller about the selected local DTLS role. // Tell the caller about the selected local DTLS role.
json data(json::object()); json data(json::object());
...@@ -970,7 +976,7 @@ namespace RTC ...@@ -970,7 +976,7 @@ namespace RTC
if (packet->ReadAbsSendTime(absSendTime)) if (packet->ReadAbsSendTime(absSendTime))
{ {
this->rembRemoteBitrateEstimator->IncomingPacket( this->rembServerBitrateEstimator->IncomingPacket(
DepLibUV::GetTime(), packet->GetPayloadLength(), *packet, absSendTime); DepLibUV::GetTime(), packet->GetPayloadLength(), *packet, absSendTime);
} }
...@@ -1308,14 +1314,12 @@ namespace RTC ...@@ -1308,14 +1314,12 @@ namespace RTC
} }
inline void WebRtcTransport::OnRemoteBitrateEstimatorValue( inline void WebRtcTransport::OnRemoteBitrateEstimatorValue(
const RTC::REMB::RemoteBitrateEstimator* /*remoteBitrateEstimator*/, const RTC::RembServer::RemoteBitrateEstimator* /*remoteBitrateEstimator*/,
const std::vector<uint32_t>& ssrcs, const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate) uint32_t availableBitrate)
{ {
MS_TRACE(); MS_TRACE();
this->availableIncomingBitrate = availableBitrate;
uint32_t effectiveMaxBitrate{ 0u }; uint32_t effectiveMaxBitrate{ 0u };
// Limit announced available bitrate if requested via API. // Limit announced available bitrate if requested via API.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论