提交 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 () =>
expect(data[0].bytesReceived).toBe(0);
expect(data[0].bytesSent).toBe(0);
expect(data[0].iceSelectedTuple).toBe(undefined);
expect(data[0].availableIncomingBitrate).toBe(0);
expect(data[0].availableOutgoingBitrate).toBe(0);
expect(data[0].maxIncomingBitrate).toBe(undefined);
}, 2000);
......
......@@ -405,34 +405,34 @@
"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",
"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",
"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",
"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",
"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",
"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",
"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",
......
......@@ -8,13 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_AIMD_RATE_CONTROL_HPP
#define MS_RTC_REMB_AIMD_RATE_CONTROL_HPP
#ifndef MS_RTC_REMB_SERVER_AIMD_RATE_CONTROL_HPP
#define MS_RTC_REMB_SERVER_AIMD_RATE_CONTROL_HPP
#include "common.hpp"
#include "RTC/REMB/OveruseDetector.hpp"
#include "RTC/REMB/RateControlInput.hpp"
#include "RTC/REMB/RateControlRegion.hpp"
#include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/RembServer/RateControlInput.hpp"
#include "RTC/RembServer/RateControlRegion.hpp"
// A rate control implementation based on additive increases of
// bitrate when no over-use is detected and multiplicative decreases when
......@@ -24,7 +24,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
class AimdRateControl
{
......@@ -175,7 +175,7 @@ namespace RTC
{
this->rateControlState = newState;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
#ifndef MS_RTC_REMB_BANDWIDTH_USAGE_HPP
#define MS_RTC_REMB_BANDWIDTH_USAGE_HPP
#ifndef MS_RTC_REMB_SERVER_BANDWIDTH_USAGE_HPP
#define MS_RTC_REMB_SERVER_BANDWIDTH_USAGE_HPP
// webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h
namespace RTC
{
namespace REMB
namespace RembServer
{
enum BandwidthUsage
{
......@@ -13,7 +13,7 @@ namespace RTC
BW_UNDERUSING,
BW_OVERUSING
};
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_INTER_ARRIVAL_HPP
#define MS_RTC_REMB_INTER_ARRIVAL_HPP
#ifndef MS_RTC_REMB_SERVER_INTER_ARRIVAL_HPP
#define MS_RTC_REMB_SERVER_INTER_ARRIVAL_HPP
#include "common.hpp"
namespace RTC
{
namespace REMB
namespace RembServer
{
// 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
......@@ -99,7 +99,7 @@ namespace RTC
burstGrouping(enableBurstGrouping), numConsecutiveReorderedPackets(0)
{
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -8,17 +8,17 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_OVERUSE_DETECTOR_HPP
#define MS_RTC_REMB_OVERUSE_DETECTOR_HPP
#ifndef MS_RTC_REMB_SERVER_OVERUSE_DETECTOR_HPP
#define MS_RTC_REMB_SERVER_OVERUSE_DETECTOR_HPP
#include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp"
#include "RTC/REMB/RateControlRegion.hpp"
#include "RTC/RembServer/BandwidthUsage.hpp"
#include "RTC/RembServer/RateControlRegion.hpp"
#include <list>
namespace RTC
{
namespace REMB
namespace RembServer
{
class OveruseDetector
{
......@@ -57,7 +57,7 @@ namespace RTC
{
return this->hypothesis;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -8,18 +8,18 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_OVERUSE_ESTIMATOR_HPP
#define MS_RTC_REMB_OVERUSE_ESTIMATOR_HPP
#ifndef MS_RTC_REMB_SERVER_OVERUSE_ESTIMATOR_HPP
#define MS_RTC_REMB_SERVER_OVERUSE_ESTIMATOR_HPP
#include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp"
#include "RTC/RembServer/BandwidthUsage.hpp"
#include <cstring> // std::memcpy()
#include <deque>
#include <utility>
namespace RTC
{
namespace REMB
namespace RembServer
{
// (jmillan) borrowed from webrtc/common_types.h
//
......@@ -118,7 +118,7 @@ namespace RTC
{
return this->numOfDeltas;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
#ifndef MS_RTC_REMB_RATE_CONTROL_INPUT_HPP
#define MS_RTC_REMB_RATE_CONTROL_INPUT_HPP
#ifndef MS_RTC_REMB_SERVER_RATE_CONTROL_INPUT_HPP
#define MS_RTC_REMB_SERVER_RATE_CONTROL_INPUT_HPP
#include "common.hpp"
#include "RTC/REMB/BandwidthUsage.hpp"
#include "RTC/RembServer/BandwidthUsage.hpp"
// webrtc/modules/remote_bitrate_estimator/include/bweDefines.h
namespace RTC
{
namespace REMB
namespace RembServer
{
struct RateControlInput
{
......@@ -26,7 +26,7 @@ namespace RTC
: bwState(bwState), incomingBitrate(incomingBitrate), noiseVar(noiseVar)
{
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
#ifndef MS_RTC_REMB_RATE_CONTROL_REGION_HPP
#define MS_RTC_REMB_RATE_CONTROL_REGION_HPP
#ifndef MS_RTC_REMB_SERVER_RATE_CONTROL_REGION_HPP
#define MS_RTC_REMB_SERVER_RATE_CONTROL_REGION_HPP
// webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h
namespace RTC
{
namespace REMB
namespace RembServer
{
enum RateControlRegion
{
......@@ -13,7 +13,7 @@ namespace RTC
RC_ABOVE_MAX,
RC_MAX_UNKNOWN
};
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -10,8 +10,8 @@
// This class estimates the incoming available bandwidth.
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_HPP
#define MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_HPP
#ifndef MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_HPP
#define MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_HPP
#include "common.hpp"
#include "RTC/RtpPacket.hpp"
......@@ -20,7 +20,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
// (jmillan) borrowed from webrtc/modules/include/module_common_types.h
//
......@@ -76,8 +76,20 @@ namespace RTC
// Process any pending tasks such as timeouts.
// Called on a worker thread.
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
#endif
......@@ -8,15 +8,15 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP
#define 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_SERVER_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_HPP
#include "common.hpp"
#include "RTC/REMB/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp"
#include "RTC/REMB/OveruseDetector.hpp"
#include "RTC/REMB/OveruseEstimator.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp"
#include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/RembServer/InterArrival.hpp"
#include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/RembServer/OveruseEstimator.hpp"
#include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include "RTC/RtpDataCounter.hpp"
#include <cassert>
#include <list>
......@@ -26,7 +26,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
struct Probe
{
......@@ -152,7 +152,7 @@ namespace RTC
{
this->remoteRate.SetMinBitrate(minBitrateBps);
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#define MS_RTC_REMB_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#ifndef MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#define MS_RTC_REMB_SERVER_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_HPP
#include "common.hpp"
#include "RTC/REMB/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp"
#include "RTC/REMB/OveruseEstimator.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp"
#include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/RembServer/InterArrival.hpp"
#include "RTC/RembServer/OveruseEstimator.hpp"
#include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include "RTC/RtpDataCounter.hpp"
#include <cassert>
#include <map>
......@@ -24,7 +24,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator
{
......@@ -145,7 +145,7 @@ namespace RTC
{
this->remoteRate->SetMinBitrate(minBitrateBps);
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
#endif
......@@ -123,8 +123,6 @@ namespace RTC
// Others.
RtpListener rtpListener;
struct RTC::RtpHeaderExtensionIds rtpHeaderExtensionIds;
uint32_t availableIncomingBitrate{ 0 };
uint32_t availableOutgoingBitrate{ 0 };
private:
// Passed by argument.
......
......@@ -4,7 +4,7 @@
#include "RTC/DtlsTransport.hpp"
#include "RTC/IceCandidate.hpp"
#include "RTC/IceServer.hpp"
#include "RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "RTC/SrtpSession.hpp"
#include "RTC/StunMessage.hpp"
#include "RTC/TcpConnection.hpp"
......@@ -22,7 +22,7 @@ namespace RTC
public RTC::TcpConnection::Listener,
public RTC::IceServer::Listener,
public RTC::DtlsTransport::Listener,
public RTC::REMB::RemoteBitrateEstimator::Listener
public RTC::RembServer::RemoteBitrateEstimator::Listener
{
private:
struct ListenIp
......@@ -93,10 +93,10 @@ namespace RTC
void OnDtlsApplicationData(
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:
void OnRemoteBitrateEstimatorValue(
const RTC::REMB::RemoteBitrateEstimator* remoteBitrateEstimator,
const RTC::RembServer::RemoteBitrateEstimator* remoteBitrateEstimator,
const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate) override;
......@@ -114,7 +114,7 @@ namespace RTC
std::vector<RTC::IceCandidate> iceCandidates;
RTC::TransportTuple* iceSelectedTuple{ nullptr };
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 };
};
} // namespace RTC
......
......@@ -97,12 +97,12 @@
'src/RTC/RTCP/FeedbackPsLei.cpp',
'src/RTC/RTCP/FeedbackPsAfb.cpp',
'src/RTC/RTCP/FeedbackPsRemb.cpp',
'src/RTC/REMB/AimdRateControl.cpp',
'src/RTC/REMB/InterArrival.cpp',
'src/RTC/REMB/OveruseDetector.cpp',
'src/RTC/REMB/OveruseEstimator.cpp',
'src/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.cpp',
'src/RTC/REMB/RemoteBitrateEstimatorSingleStream.cpp',
'src/RTC/RembServer/AimdRateControl.cpp',
'src/RTC/RembServer/InterArrival.cpp',
'src/RTC/RembServer/OveruseDetector.cpp',
'src/RTC/RembServer/OveruseEstimator.cpp',
'src/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.cpp',
'src/RTC/RembServer/RemoteBitrateEstimatorSingleStream.cpp',
# C++ include files.
'include/DepLibSRTP.hpp',
'include/DepLibUV.hpp',
......@@ -185,13 +185,13 @@
'include/RTC/RTCP/FeedbackPsLei.hpp',
'include/RTC/RTCP/FeedbackPsAfb.hpp',
'include/RTC/RTCP/FeedbackPsRemb.hpp',
'include/RTC/REMB/AimdRateControl.hpp',
'include/RTC/REMB/InterArrival.hpp',
'include/RTC/REMB/OveruseDetector.hpp',
'include/RTC/REMB/OveruseEstimator.hpp',
'include/RTC/REMB/RemoteBitrateEstimator.hpp',
'include/RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp',
'include/RTC/REMB/RemoteBitrateEstimatorSingleStream.hpp'
'include/RTC/RembServer/AimdRateControl.hpp',
'include/RTC/RembServer/InterArrival.hpp',
'include/RTC/RembServer/OveruseDetector.hpp',
'include/RTC/RembServer/OveruseEstimator.hpp',
'include/RTC/RembServer/RemoteBitrateEstimator.hpp',
'include/RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp',
'include/RTC/RembServer/RemoteBitrateEstimatorSingleStream.hpp'
],
'include_dirs':
[
......
......@@ -8,18 +8,18 @@
* 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
#include "RTC/REMB/AimdRateControl.hpp"
#include "RTC/RembServer/AimdRateControl.hpp"
#include "Logger.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp"
#include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include <algorithm>
#include <cmath> // std::lround()
namespace RTC
{
namespace REMB
namespace RembServer
{
static constexpr int64_t MaxFeedbackIntervalMs{ 1000 };
......@@ -324,5 +324,5 @@ namespace RTC
}
}
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -8,10 +8,10 @@
* 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
#include "RTC/REMB/InterArrival.hpp"
#include "RTC/RembServer/InterArrival.hpp"
#include "Logger.hpp"
#include "Utils.hpp" // LatestTimestamp
#include <algorithm>
......@@ -19,7 +19,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
static constexpr int BurstDeltaThresholdMs{ 5 };
......@@ -188,5 +188,5 @@ namespace RTC
this->currentTimestampGroup = TimestampGroup();
this->prevTimestampGroup = TimestampGroup();
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -8,10 +8,10 @@
* 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
#include "RTC/REMB/OveruseDetector.hpp"
#include "RTC/RembServer/OveruseDetector.hpp"
#include "Logger.hpp"
#include <algorithm>
#include <cmath>
......@@ -21,7 +21,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
constexpr double MaxAdaptOffsetMs{ 15.0 };
constexpr int MinNumDeltas{ 60 };
......@@ -111,5 +111,5 @@ namespace RTC
this->threshold = std::min(std::max(this->threshold, minThreshold), maxThreshold);
this->lastUpdateMs = nowMs;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -8,10 +8,10 @@
* 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
#include "RTC/REMB/OveruseEstimator.hpp"
#include "RTC/RembServer/OveruseEstimator.hpp"
#include "Logger.hpp"
#include <algorithm>
#include <cmath>
......@@ -20,7 +20,7 @@
namespace RTC
{
namespace REMB
namespace RembServer
{
constexpr size_t MinFramePeriodHistoryLength{ 60 };
constexpr uint16_t DeltaCounterMax{ 1000 };
......@@ -142,5 +142,5 @@ namespace RTC
if (this->varNoise < 1)
this->varNoise = 1;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -8,19 +8,19 @@
* 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
#include "RTC/REMB/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "RTC/RembServer/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "DepLibUV.hpp"
#include "Logger.hpp"
#include "RTC/REMB/RemoteBitrateEstimator.hpp"
#include "RTC/RembServer/RemoteBitrateEstimator.hpp"
#include <algorithm>
#include <cmath>
namespace RTC
{
namespace REMB
namespace RembServer
{
static constexpr int TimestampGroupLengthMs{ 5 };
static constexpr uint32_t AbsSendTimeFraction{ 18 };
......@@ -374,7 +374,9 @@ namespace RTC
if (updateEstimate)
{
this->lastUpdateMs = nowMs;
this->lastUpdateMs = nowMs;
this->availableBitrate = targetBitrateBps;
this->observer->OnRemoteBitrateEstimatorValue(this, ssrcs, targetBitrateBps);
}
}
......@@ -422,5 +424,5 @@ namespace RTC
return true;
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -8,21 +8,21 @@
* 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
#include "RTC/REMB/RemoteBitrateEstimatorSingleStream.hpp"
#include "RTC/RembServer/RemoteBitrateEstimatorSingleStream.hpp"
#include "DepLibUV.hpp"
#include "Logger.hpp"
#include "RTC/REMB/AimdRateControl.hpp"
#include "RTC/REMB/InterArrival.hpp"
#include "RTC/REMB/OveruseDetector.hpp"
#include "RTC/REMB/OveruseEstimator.hpp"
#include "RTC/RembServer/AimdRateControl.hpp"
#include "RTC/RembServer/InterArrival.hpp"
#include "RTC/RembServer/OveruseDetector.hpp"
#include "RTC/RembServer/OveruseEstimator.hpp"
#include <utility> // std::make_pair()
namespace RTC
{
namespace REMB
namespace RembServer
{
void RemoteBitrateEstimatorSingleStream::IncomingPacket(
int64_t arrivalTimeMs,
......@@ -160,6 +160,8 @@ namespace RTC
// MS_ASSERT(this->processIntervalMs > 0);
this->availableBitrate = targetBitrate;
std::vector<uint32_t> ssrcs;
GetSsrcs(&ssrcs);
......@@ -203,5 +205,5 @@ namespace RTC
(*ssrcs)[i] = it->first;
}
}
} // namespace REMB
} // namespace RembServer
} // namespace RTC
......@@ -527,9 +527,10 @@ namespace RTC
// Store REMB info.
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;
}
......
......@@ -461,10 +461,15 @@ namespace RTC
}
// Add availableIncomingBitrate.
jsonObject["availableIncomingBitrate"] = this->availableIncomingBitrate;
if (this->rembServerBitrateEstimator)
{
jsonObject["availableIncomingBitrate"] =
this->rembServerBitrateEstimator->GetAvailableBitrate();
}
// TODO: We do not have this yet.
// Add availableOutgoingBitrate.
jsonObject["availableOutgoingBitrate"] = this->availableOutgoingBitrate;
// jsonObject["availableOutgoingBitrate"] = this->availableOutgoingBitrate;
// Add maxIncomingBitrate.
if (this->maxIncomingBitrate != 0u)
......@@ -582,8 +587,9 @@ namespace RTC
MayRunDtlsTransport();
}
// Set remote bitrate estimator.
this->rembRemoteBitrateEstimator.reset(new RTC::REMB::RemoteBitrateEstimatorAbsSendTime(this));
// Set REMB server bitrate estimator.
this->rembServerBitrateEstimator.reset(
new RTC::RembServer::RemoteBitrateEstimatorAbsSendTime(this));
// Tell the caller about the selected local DTLS role.
json data(json::object());
......@@ -970,7 +976,7 @@ namespace RTC
if (packet->ReadAbsSendTime(absSendTime))
{
this->rembRemoteBitrateEstimator->IncomingPacket(
this->rembServerBitrateEstimator->IncomingPacket(
DepLibUV::GetTime(), packet->GetPayloadLength(), *packet, absSendTime);
}
......@@ -1308,14 +1314,12 @@ namespace RTC
}
inline void WebRtcTransport::OnRemoteBitrateEstimatorValue(
const RTC::REMB::RemoteBitrateEstimator* /*remoteBitrateEstimator*/,
const RTC::RembServer::RemoteBitrateEstimator* /*remoteBitrateEstimator*/,
const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate)
{
MS_TRACE();
this->availableIncomingBitrate = availableBitrate;
uint32_t effectiveMaxBitrate{ 0u };
// Limit announced available bitrate if requested via API.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论