In ReceiveStatistic require callbacks during construction
Remove RegisterRtcpStatisticsCallback callback functions saving taking an extra lock when calling callbacks. Bug: None Change-Id: Ib4537deffa0ab0abf597228e7c0fab7067614f6a Reviewed-on: https://webrtc-review.googlesource.com/c/111821 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25779}
This commit is contained in:
committed by
Commit Bot
parent
4c0cc5bc5f
commit
8ce0d2b956
@ -12,6 +12,7 @@
|
||||
#define MODULES_RTP_RTCP_INCLUDE_RECEIVE_STATISTICS_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
@ -54,7 +55,14 @@ class ReceiveStatistics : public ReceiveStatisticsProvider,
|
||||
public:
|
||||
~ReceiveStatistics() override = default;
|
||||
|
||||
static ReceiveStatistics* Create(Clock* clock);
|
||||
static ReceiveStatistics* Create(Clock* clock) {
|
||||
return Create(clock, nullptr, nullptr).release();
|
||||
}
|
||||
|
||||
static std::unique_ptr<ReceiveStatistics> Create(
|
||||
Clock* clock,
|
||||
RtcpStatisticsCallback* rtcp_callback,
|
||||
StreamDataCountersCallback* rtp_callback);
|
||||
|
||||
// Increment counter for number of FEC packets received.
|
||||
virtual void FecPacketReceived(const RtpPacketReceived& packet) = 0;
|
||||
@ -67,14 +75,6 @@ class ReceiveStatistics : public ReceiveStatisticsProvider,
|
||||
// Detect retransmissions, enabling updates of the retransmitted counters. The
|
||||
// default is false.
|
||||
virtual void EnableRetransmitDetection(uint32_t ssrc, bool enable) = 0;
|
||||
|
||||
// Called on new RTCP stats creation.
|
||||
virtual void RegisterRtcpStatisticsCallback(
|
||||
RtcpStatisticsCallback* callback) = 0;
|
||||
|
||||
// Called on new RTP stats creation.
|
||||
virtual void RegisterRtpStatisticsCallback(
|
||||
StreamDataCountersCallback* callback) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user