Unverified 提交 8d41bbae authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi 提交者: GitHub

C++ cleanup (#605)

上级 c014484e
......@@ -27,20 +27,20 @@ namespace mediasoup_helpers
}
return receivedPackets;
};
}
// Get the reference time in microseconds, including any precision loss.
int64_t GetBaseTimeUs(const RTC::RTCP::FeedbackRtpTransportPacket* packet)
{
return packet->GetReferenceTimestamp() * 1000;
};
}
// Get the unwrapped delta between current base time and |prev_timestamp_us|.
int64_t GetBaseDeltaUs(
const RTC::RTCP::FeedbackRtpTransportPacket* packet, int64_t prev_timestamp_us)
{
return GetBaseTimeUs(packet) - prev_timestamp_us;
};
}
} // namespace FeedbackRtpTransport
} // namespace mediasoup_helpers
......
......@@ -13,6 +13,9 @@ namespace Channel
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnConsumerSocketMessage(ConsumerSocket* consumerSocket, char* msg, size_t msgLen) = 0;
virtual void OnConsumerSocketClosed(ConsumerSocket* consumerSocket) = 0;
......@@ -52,6 +55,9 @@ namespace Channel
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnChannelRequest(
Channel::ChannelSocket* channel, Channel::ChannelRequest* request) = 0;
......
......@@ -14,6 +14,9 @@ namespace PayloadChannel
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnConsumerSocketMessage(ConsumerSocket* consumerSocket, char* msg, size_t msgLen) = 0;
virtual void OnConsumerSocketClosed(ConsumerSocket* consumerSocket) = 0;
......@@ -57,6 +60,9 @@ namespace PayloadChannel
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnPayloadChannelNotification(
PayloadChannel::PayloadChannelSocket* payloadChannel,
......
......@@ -28,6 +28,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnConsumerSendRtpPacket(RTC::Consumer* consumer, RTC::RtpPacket* packet) = 0;
virtual void OnConsumerRetransmitRtpPacket(RTC::Consumer* consumer, RTC::RtpPacket* packet) = 0;
......
......@@ -18,6 +18,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnDataConsumerSendMessage(
RTC::DataConsumer* dataConsumer,
......
......@@ -14,6 +14,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnDataProducerMessageReceived(
RTC::DataProducer* dataProducer, uint32_t ppid, const uint8_t* msg, size_t len) = 0;
......
......@@ -62,6 +62,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
// DTLS is in the process of negotiating a secure connection. Incoming
// media can flow through.
......
......@@ -11,6 +11,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnKeyFrameRequestTimeout(PendingKeyFrameInfo* keyFrameRequestInfo) = 0;
};
......@@ -52,6 +55,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnKeyFrameDelayTimeout(KeyFrameRequestDelayer* keyFrameRequestDelayer) = 0;
};
......@@ -90,6 +96,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnKeyFrameNeeded(KeyFrameRequestManager* keyFrameRequestManager, uint32_t ssrc) = 0;
};
......
......@@ -16,6 +16,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnNackGeneratorNackRequired(const std::vector<uint16_t>& seqNumbers) = 0;
virtual void OnNackGeneratorKeyFrameRequired() = 0;
......
......@@ -26,6 +26,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnProducerPaused(RTC::Producer* producer) = 0;
virtual void OnProducerResumed(RTC::Producer* producer) = 0;
......
......@@ -33,16 +33,10 @@ namespace RTC
{
return this->bytes;
}
void Reset()
{
uint64_t nowMs = DepLibUV::GetTimeMs();
Reset(nowMs);
}
private:
void RemoveOldData(uint64_t nowMs);
void Reset(uint64_t nowMs)
void Reset()
{
this->buffer.reset(new BufferItem[this->windowItems]);
this->newestItemStartTime = 0u;
......
......@@ -25,6 +25,9 @@ namespace RTC
protected:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnRtpStreamScore(RTC::RtpStream* rtpStream, uint8_t score, uint8_t previousScore) = 0;
};
......
......@@ -37,6 +37,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnSctpAssociationConnecting(RTC::SctpAssociation* sctpAssociation) = 0;
virtual void OnSctpAssociationConnected(RTC::SctpAssociation* sctpAssociation) = 0;
......
......@@ -15,6 +15,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnSenderBandwidthEstimatorAvailableBitrate(
RTC::SenderBandwidthEstimator* senderBwe,
......
......@@ -11,6 +11,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnTcpConnectionPacketReceived(
RTC::TcpConnection* connection, const uint8_t* data, size_t len) = 0;
......
......@@ -14,6 +14,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnRtcTcpConnectionClosed(
RTC::TcpServer* tcpServer, RTC::TcpConnection* connection) = 0;
......
......@@ -53,6 +53,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnTransportNewProducer(RTC::Transport* transport, RTC::Producer* producer) = 0;
virtual void OnTransportProducerClosed(RTC::Transport* transport, RTC::Producer* producer) = 0;
......
......@@ -35,6 +35,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnTransportCongestionControlClientBitrates(
RTC::TransportCongestionControlClient* tccClient,
......
......@@ -17,6 +17,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnTransportCongestionControlServerSendRtcpPacket(
RTC::TransportCongestionControlServer* tccServer, RTC::RTCP::Packet* packet) = 0;
......
......@@ -12,6 +12,9 @@ namespace RTC
public:
class Listener
{
public:
virtual ~Listener() = default;
public:
virtual void OnUdpSocketPacketReceived(
RTC::UdpSocket* socket, const uint8_t* data, size_t len, const struct sockaddr* remoteAddr) = 0;
......
......@@ -16,7 +16,7 @@ inline static void onClose(uv_handle_t* handle)
delete handle;
}
inline static void onWalk(uv_handle_t* handle, void* arg)
inline static void onWalk(uv_handle_t* handle, void* /*arg*/)
{
// Must use MS_ERROR_STD since at this point the Channel is already closed.
MS_ERROR_STD(
......
......@@ -107,7 +107,7 @@ namespace RTC
// A whole window size time has elapsed since last entry. Reset the buffer.
if (newoldestTime > this->newestItemStartTime)
{
Reset(nowMs);
Reset();
return;
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论