summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/modules/rtp_rtcp/mocks
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/libwebrtc/modules/rtp_rtcp/mocks
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/modules/rtp_rtcp/mocks')
-rw-r--r--third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_network_link_rtcp_observer.h47
-rw-r--r--third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h30
-rw-r--r--third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h25
-rw-r--r--third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h179
4 files changed, 281 insertions, 0 deletions
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_network_link_rtcp_observer.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_network_link_rtcp_observer.h
new file mode 100644
index 0000000000..16b7db7892
--- /dev/null
+++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_network_link_rtcp_observer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2023 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_RTP_RTCP_MOCKS_MOCK_NETWORK_LINK_RTCP_OBSERVER_H_
+#define MODULES_RTP_RTCP_MOCKS_MOCK_NETWORK_LINK_RTCP_OBSERVER_H_
+
+#include "api/array_view.h"
+#include "api/units/data_rate.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
+#include "modules/rtp_rtcp/include/report_block_data.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
+#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
+#include "test/gmock.h"
+
+namespace webrtc {
+
+class MockNetworkLinkRtcpObserver : public NetworkLinkRtcpObserver {
+ public:
+ MOCK_METHOD(void,
+ OnRttUpdate,
+ (Timestamp receive_time, TimeDelta rtt),
+ (override));
+ MOCK_METHOD(void,
+ OnTransportFeedback,
+ (Timestamp receive_time, const rtcp::TransportFeedback& feedback),
+ (override));
+ MOCK_METHOD(void,
+ OnReceiverEstimatedMaxBitrate,
+ (Timestamp receive_time, DataRate bitrate),
+ (override));
+ MOCK_METHOD(void,
+ OnReport,
+ (Timestamp receive_time,
+ rtc::ArrayView<const ReportBlockData> report_blocks),
+ (override));
+};
+
+} // namespace webrtc
+#endif // MODULES_RTP_RTCP_MOCKS_MOCK_NETWORK_LINK_RTCP_OBSERVER_H_
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h
new file mode 100644
index 0000000000..d308b2cfa8
--- /dev/null
+++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_
+#define MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_
+
+#include "modules/rtp_rtcp/include/flexfec_receiver.h"
+#include "modules/rtp_rtcp/source/rtp_packet_received.h"
+#include "test/gmock.h"
+
+namespace webrtc {
+
+class MockRecoveredPacketReceiver : public RecoveredPacketReceiver {
+ public:
+ MOCK_METHOD(void,
+ OnRecoveredPacket,
+ (const RtpPacketReceived& packet),
+ (override));
+};
+
+} // namespace webrtc
+
+#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RECOVERED_PACKET_RECEIVER_H_
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h
new file mode 100644
index 0000000000..e9a7d52691
--- /dev/null
+++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_
+#define MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_
+
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
+#include "test/gmock.h"
+
+namespace webrtc {
+
+class MockRtcpRttStats : public RtcpRttStats {
+ public:
+ MOCK_METHOD(void, OnRttUpdate, (int64_t rtt), (override));
+ MOCK_METHOD(int64_t, LastProcessedRtt, (), (const, override));
+};
+} // namespace webrtc
+#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RTCP_RTT_STATS_H_
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h
new file mode 100644
index 0000000000..6872448f98
--- /dev/null
+++ b/third_party/libwebrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_
+#define MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_
+
+#include <memory>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "api/video/video_bitrate_allocation.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
+#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
+#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
+#include "test/gmock.h"
+
+namespace webrtc {
+
+class MockRtpRtcpInterface : public RtpRtcpInterface {
+ public:
+ MOCK_METHOD(void,
+ IncomingRtcpPacket,
+ (rtc::ArrayView<const uint8_t> packet),
+ (override));
+ MOCK_METHOD(void, SetRemoteSSRC, (uint32_t ssrc), (override));
+ MOCK_METHOD(void, SetLocalSsrc, (uint32_t ssrc), (override));
+ MOCK_METHOD(void, SetMaxRtpPacketSize, (size_t size), (override));
+ MOCK_METHOD(size_t, MaxRtpPacketSize, (), (const, override));
+ MOCK_METHOD(void,
+ RegisterSendPayloadFrequency,
+ (int payload_type, int frequency),
+ (override));
+ MOCK_METHOD(int32_t,
+ DeRegisterSendPayload,
+ (int8_t payload_type),
+ (override));
+ MOCK_METHOD(void, SetExtmapAllowMixed, (bool extmap_allow_mixed), (override));
+ MOCK_METHOD(void,
+ RegisterRtpHeaderExtension,
+ (absl::string_view uri, int id),
+ (override));
+ MOCK_METHOD(void,
+ DeregisterSendRtpHeaderExtension,
+ (absl::string_view uri),
+ (override));
+ MOCK_METHOD(bool, SupportsPadding, (), (const, override));
+ MOCK_METHOD(bool, SupportsRtxPayloadPadding, (), (const, override));
+ MOCK_METHOD(uint32_t, StartTimestamp, (), (const, override));
+ MOCK_METHOD(void, SetStartTimestamp, (uint32_t timestamp), (override));
+ MOCK_METHOD(uint16_t, SequenceNumber, (), (const, override));
+ MOCK_METHOD(void, SetSequenceNumber, (uint16_t seq), (override));
+ MOCK_METHOD(void, SetRtpState, (const RtpState& rtp_state), (override));
+ MOCK_METHOD(void, SetRtxState, (const RtpState& rtp_state), (override));
+ MOCK_METHOD(void, SetNonSenderRttMeasurement, (bool enabled), (override));
+ MOCK_METHOD(RtpState, GetRtpState, (), (const, override));
+ MOCK_METHOD(RtpState, GetRtxState, (), (const, override));
+ MOCK_METHOD(uint32_t, SSRC, (), (const, override));
+ MOCK_METHOD(void, SetMid, (absl::string_view mid), (override));
+ MOCK_METHOD(void, SetRtxSendStatus, (int modes), (override));
+ MOCK_METHOD(int, RtxSendStatus, (), (const, override));
+ MOCK_METHOD(absl::optional<uint32_t>, RtxSsrc, (), (const, override));
+ MOCK_METHOD(void, SetRtxSendPayloadType, (int, int), (override));
+ MOCK_METHOD(absl::optional<uint32_t>, FlexfecSsrc, (), (const, override));
+ MOCK_METHOD(int32_t, SetSendingStatus, (bool sending), (override));
+ MOCK_METHOD(bool, Sending, (), (const, override));
+ MOCK_METHOD(void, SetSendingMediaStatus, (bool sending), (override));
+ MOCK_METHOD(bool, SendingMedia, (), (const, override));
+ MOCK_METHOD(bool, IsAudioConfigured, (), (const, override));
+ MOCK_METHOD(void, SetAsPartOfAllocation, (bool), (override));
+ MOCK_METHOD(RtpSendRates, GetSendRates, (), (const, override));
+ MOCK_METHOD(bool,
+ OnSendingRtpFrame,
+ (uint32_t, int64_t, int, bool),
+ (override));
+ MOCK_METHOD(bool,
+ TrySendPacket,
+ (std::unique_ptr<RtpPacketToSend> packet,
+ const PacedPacketInfo& pacing_info),
+ (override));
+ MOCK_METHOD(void, OnBatchComplete, (), (override));
+ MOCK_METHOD(void,
+ SetFecProtectionParams,
+ (const FecProtectionParams& delta_params,
+ const FecProtectionParams& key_params),
+ (override));
+ MOCK_METHOD(std::vector<std::unique_ptr<RtpPacketToSend>>,
+ FetchFecPackets,
+ (),
+ (override));
+ MOCK_METHOD(void,
+ OnAbortedRetransmissions,
+ (rtc::ArrayView<const uint16_t>),
+ (override));
+ MOCK_METHOD(void,
+ OnPacketsAcknowledged,
+ (rtc::ArrayView<const uint16_t>),
+ (override));
+ MOCK_METHOD(std::vector<std::unique_ptr<RtpPacketToSend>>,
+ GeneratePadding,
+ (size_t target_size_bytes),
+ (override));
+ MOCK_METHOD(std::vector<RtpSequenceNumberMap::Info>,
+ GetSentRtpPacketInfos,
+ (rtc::ArrayView<const uint16_t> sequence_numbers),
+ (const, override));
+ MOCK_METHOD(size_t, ExpectedPerPacketOverhead, (), (const, override));
+ MOCK_METHOD(void, OnPacketSendingThreadSwitched, (), (override));
+ MOCK_METHOD(RtcpMode, RTCP, (), (const, override));
+ MOCK_METHOD(void, SetRTCPStatus, (RtcpMode method), (override));
+ MOCK_METHOD(int32_t, SetCNAME, (absl::string_view cname), (override));
+ MOCK_METHOD(absl::optional<TimeDelta>, LastRtt, (), (const, override));
+ MOCK_METHOD(TimeDelta, ExpectedRetransmissionTime, (), (const, override));
+ MOCK_METHOD(int32_t, SendRTCP, (RTCPPacketType packet_type), (override));
+ MOCK_METHOD(void,
+ GetSendStreamDataCounters,
+ (StreamDataCounters*, StreamDataCounters*),
+ (const, override));
+ MOCK_METHOD(std::vector<ReportBlockData>,
+ GetLatestReportBlockData,
+ (),
+ (const, override));
+ MOCK_METHOD(absl::optional<SenderReportStats>,
+ GetSenderReportStats,
+ (),
+ (const, override));
+ MOCK_METHOD(absl::optional<NonSenderRttStats>,
+ GetNonSenderRttStats,
+ (),
+ (const, override));
+ MOCK_METHOD(void,
+ SetRemb,
+ (int64_t bitrate, std::vector<uint32_t> ssrcs),
+ (override));
+ MOCK_METHOD(void, UnsetRemb, (), (override));
+ MOCK_METHOD(int32_t,
+ SendNACK,
+ (const uint16_t* nack_list, uint16_t size),
+ (override));
+ MOCK_METHOD(void,
+ SendNack,
+ (const std::vector<uint16_t>& sequence_numbers),
+ (override));
+ MOCK_METHOD(void,
+ SetStorePacketsStatus,
+ (bool enable, uint16_t number_to_store),
+ (override));
+ MOCK_METHOD(void,
+ SendCombinedRtcpPacket,
+ (std::vector<std::unique_ptr<rtcp::RtcpPacket>> rtcp_packets),
+ (override));
+ MOCK_METHOD(int32_t,
+ SendLossNotification,
+ (uint16_t last_decoded_seq_num,
+ uint16_t last_received_seq_num,
+ bool decodability_flag,
+ bool buffering_allowed),
+ (override));
+ MOCK_METHOD(void,
+ SetVideoBitrateAllocation,
+ (const VideoBitrateAllocation&),
+ (override));
+ MOCK_METHOD(RTPSender*, RtpSender, (), (override));
+ MOCK_METHOD(const RTPSender*, RtpSender, (), (const, override));
+};
+
+} // namespace webrtc
+
+#endif // MODULES_RTP_RTCP_MOCKS_MOCK_RTP_RTCP_H_