blob: 6d19cea885f2595b35cafaf86f87f9b7286426d6 [file] [log] [blame]
Henrik Kjellanderff761fb2015-11-04 08:31:52 +01001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_
12#define MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010013
14#include <stddef.h>
15#include <list>
Stefan Holmer60e43462016-09-07 09:58:20 +020016#include <vector>
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010017
Mirko Bonadei71207422017-09-15 13:58:09 +020018#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "modules/include/module_common_types.h"
20#include "rtc_base/deprecation.h"
21#include "system_wrappers/include/clock.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020022#include "typedefs.h" // NOLINT(build/include)
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010023
24#define RTCP_CNAME_SIZE 256 // RFC 3550 page 44, including null termination
25#define IP_PACKET_SIZE 1500 // we assume ethernet
26#define MAX_NUMBER_OF_PARALLEL_TELEPHONE_EVENTS 10
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010027
28namespace webrtc {
29namespace rtcp {
30class TransportFeedback;
31}
32
33const int kVideoPayloadTypeFrequency = 90000;
solenbergb19d2882016-10-03 06:22:25 -070034// TODO(solenberg): RTP time stamp rate for RTCP is fixed at 8k, this is legacy
35// and should be fixed.
36// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=6458
37const int kBogusRtpRateForAudioRtcp = 8000;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010038
39// Minimum RTP header size in bytes.
40const uint8_t kRtpHeaderSize = 12;
41
danilchap5c1def82015-12-10 09:51:54 -080042struct AudioPayload {
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010043 uint32_t frequency;
Peter Kasting69558702016-01-12 16:26:35 -080044 size_t channels;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010045 uint32_t rate;
46};
47
danilchap5c1def82015-12-10 09:51:54 -080048struct VideoPayload {
magjede69a1a92016-11-25 10:06:31 -080049 RtpVideoCodecTypes videoCodecType;
50 // The H264 profile only matters if videoCodecType == kRtpVideoH264.
51 H264::Profile h264_profile;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010052};
53
danilchap5c1def82015-12-10 09:51:54 -080054union PayloadUnion {
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010055 AudioPayload Audio;
56 VideoPayload Video;
57};
58
danilchap5c1def82015-12-10 09:51:54 -080059enum RTPAliveType { kRtpDead = 0, kRtpNoRtp = 1, kRtpAlive = 2 };
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010060
61enum ProtectionType {
62 kUnprotectedPacket,
63 kProtectedPacket
64};
65
66enum StorageType {
67 kDontRetransmit,
68 kAllowRetransmission
69};
70
71enum RTPExtensionType {
72 kRtpExtensionNone,
73 kRtpExtensionTransmissionTimeOffset,
74 kRtpExtensionAudioLevel,
75 kRtpExtensionAbsoluteSendTime,
76 kRtpExtensionVideoRotation,
77 kRtpExtensionTransportSequenceNumber,
isheriff6b4b5f32016-06-08 00:24:21 -070078 kRtpExtensionPlayoutDelay,
ilnik00d802b2017-04-11 10:34:31 -070079 kRtpExtensionVideoContentType,
ilnik04f4d122017-06-19 07:18:55 -070080 kRtpExtensionVideoTiming,
danilchapef8d7732017-04-19 02:59:48 -070081 kRtpExtensionRtpStreamId,
82 kRtpExtensionRepairedRtpStreamId,
Steve Antona3251dd2017-07-21 09:58:31 -070083 kRtpExtensionMid,
ilnik00d802b2017-04-11 10:34:31 -070084 kRtpExtensionNumberOfExtensions // Must be the last entity in the enum.
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010085};
86
danilchap5c1def82015-12-10 09:51:54 -080087enum RTCPAppSubTypes { kAppSubtypeBwe = 0x00 };
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010088
89// TODO(sprang): Make this an enum class once rtcp_receiver has been cleaned up.
90enum RTCPPacketType : uint32_t {
91 kRtcpReport = 0x0001,
92 kRtcpSr = 0x0002,
93 kRtcpRr = 0x0004,
94 kRtcpSdes = 0x0008,
95 kRtcpBye = 0x0010,
96 kRtcpPli = 0x0020,
97 kRtcpNack = 0x0040,
98 kRtcpFir = 0x0080,
99 kRtcpTmmbr = 0x0100,
100 kRtcpTmmbn = 0x0200,
101 kRtcpSrReq = 0x0400,
102 kRtcpXrVoipMetric = 0x0800,
103 kRtcpApp = 0x1000,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100104 kRtcpRemb = 0x10000,
105 kRtcpTransmissionTimeOffset = 0x20000,
106 kRtcpXrReceiverReferenceTime = 0x40000,
107 kRtcpXrDlrrReportBlock = 0x80000,
108 kRtcpTransportFeedback = 0x100000,
sprang5e38c962016-12-01 05:18:09 -0800109 kRtcpXrTargetBitrate = 0x200000
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100110};
111
112enum KeyFrameRequestMethod { kKeyFrameReqPliRtcp, kKeyFrameReqFirRtcp };
113
danilchap5c1def82015-12-10 09:51:54 -0800114enum RtpRtcpPacketType { kPacketRtp = 0, kPacketKeepAlive = 1 };
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100115
spranga8ae6f22017-09-04 07:23:56 -0700116// kConditionallyRetransmitHigherLayers allows retransmission of video frames
117// in higher layers if either the last frame in that layer was too far back in
118// time, or if we estimate that a new frame will be available in a lower layer
119// in a shorter time than it would take to request and receive a retransmission.
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100120enum RetransmissionMode : uint8_t {
121 kRetransmitOff = 0x0,
122 kRetransmitFECPackets = 0x1,
123 kRetransmitBaseLayer = 0x2,
124 kRetransmitHigherLayers = 0x4,
spranga8ae6f22017-09-04 07:23:56 -0700125 kConditionallyRetransmitHigherLayers = 0x8,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100126 kRetransmitAllPackets = 0xFF
127};
128
129enum RtxMode {
130 kRtxOff = 0x0,
131 kRtxRetransmitted = 0x1, // Only send retransmissions over RTX.
132 kRtxRedundantPayloads = 0x2 // Preventively send redundant payloads
133 // instead of padding.
134};
135
136const size_t kRtxHeaderSize = 2;
137
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100138struct RTCPReportBlock {
139 RTCPReportBlock()
srte3e69e5c2017-08-09 06:13:45 -0700140 : sender_ssrc(0),
141 source_ssrc(0),
142 fraction_lost(0),
143 packets_lost(0),
144 extended_highest_sequence_number(0),
145 jitter(0),
146 last_sender_report_timestamp(0),
147 delay_since_last_sender_report(0) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100148
srte3e69e5c2017-08-09 06:13:45 -0700149 RTCPReportBlock(uint32_t sender_ssrc,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100150 uint32_t source_ssrc,
151 uint8_t fraction_lost,
srte3e69e5c2017-08-09 06:13:45 -0700152 uint32_t packets_lost,
153 uint32_t extended_highest_sequence_number,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100154 uint32_t jitter,
srte3e69e5c2017-08-09 06:13:45 -0700155 uint32_t last_sender_report_timestamp,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100156 uint32_t delay_since_last_sender_report)
srte3e69e5c2017-08-09 06:13:45 -0700157 : sender_ssrc(sender_ssrc),
158 source_ssrc(source_ssrc),
159 fraction_lost(fraction_lost),
160 packets_lost(packets_lost),
161 extended_highest_sequence_number(extended_highest_sequence_number),
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100162 jitter(jitter),
srte3e69e5c2017-08-09 06:13:45 -0700163 last_sender_report_timestamp(last_sender_report_timestamp),
164 delay_since_last_sender_report(delay_since_last_sender_report) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100165
166 // Fields as described by RFC 3550 6.4.2.
srte3e69e5c2017-08-09 06:13:45 -0700167 union {
168 uint32_t sender_ssrc; // SSRC of sender of this report.
169 RTC_DEPRECATED uint32_t remoteSSRC;
170 };
171 union {
172 uint32_t source_ssrc; // SSRC of the RTP packet sender.
173 RTC_DEPRECATED uint32_t sourceSSRC;
174 };
175 union {
176 RTC_DEPRECATED uint8_t fractionLost;
177 uint8_t fraction_lost;
178 };
179 union {
180 uint32_t packets_lost; // 24 bits valid.
181 RTC_DEPRECATED uint32_t cumulativeLost;
182 };
183 union {
184 uint32_t extended_highest_sequence_number;
185 RTC_DEPRECATED uint32_t extendedHighSeqNum;
186 };
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100187 uint32_t jitter;
srte3e69e5c2017-08-09 06:13:45 -0700188 union {
189 uint32_t last_sender_report_timestamp;
190 RTC_DEPRECATED uint32_t lastSR;
191 };
192 union {
193 uint32_t delay_since_last_sender_report;
194 RTC_DEPRECATED uint32_t delaySinceLastSR;
195 };
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100196};
197
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100198typedef std::list<RTCPReportBlock> ReportBlockList;
199
200struct RtpState {
201 RtpState()
202 : sequence_number(0),
203 start_timestamp(0),
204 timestamp(0),
205 capture_time_ms(-1),
206 last_timestamp_time_ms(-1),
207 media_has_been_sent(false) {}
208 uint16_t sequence_number;
209 uint32_t start_timestamp;
210 uint32_t timestamp;
211 int64_t capture_time_ms;
212 int64_t last_timestamp_time_ms;
213 bool media_has_been_sent;
214};
215
danilchap5c1def82015-12-10 09:51:54 -0800216class RtpData {
217 public:
218 virtual ~RtpData() {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100219
Sergey Ulanovec4f0682016-07-28 15:19:10 -0700220 virtual int32_t OnReceivedPayloadData(const uint8_t* payload_data,
221 size_t payload_size,
222 const WebRtcRTPHeader* rtp_header) = 0;
nisse30e89312017-05-29 08:16:37 -0700223};
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100224
nisse30e89312017-05-29 08:16:37 -0700225// Callback interface for packets recovered by FlexFEC or ULPFEC. In
226// the FlexFEC case, the implementation should be able to demultiplex
227// the recovered RTP packets based on SSRC.
228class RecoveredPacketReceiver {
229 public:
230 virtual void OnRecoveredPacket(const uint8_t* packet, size_t length) = 0;
231
232 protected:
233 virtual ~RecoveredPacketReceiver() = default;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100234};
235
danilchap5c1def82015-12-10 09:51:54 -0800236class RtpFeedback {
237 public:
238 virtual ~RtpFeedback() {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100239
danilchap5c1def82015-12-10 09:51:54 -0800240 // Receiving payload change or SSRC change. (return success!)
241 /*
242 * channels - number of channels in codec (1 = mono, 2 = stereo)
243 */
244 virtual int32_t OnInitializeDecoder(
Sergey Ulanovec4f0682016-07-28 15:19:10 -0700245 int8_t payload_type,
246 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
247 int frequency,
248 size_t channels,
249 uint32_t rate) = 0;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100250
Sergey Ulanovec4f0682016-07-28 15:19:10 -0700251 virtual void OnIncomingSSRCChanged(uint32_t ssrc) = 0;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100252
Sergey Ulanovec4f0682016-07-28 15:19:10 -0700253 virtual void OnIncomingCSRCChanged(uint32_t csrc, bool added) = 0;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100254};
255
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100256class RtcpIntraFrameObserver {
257 public:
258 virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) = 0;
259
nisse25d0bdc2017-03-22 07:15:09 -0700260 RTC_DEPRECATED virtual void OnReceivedSLI(uint32_t ssrc,
261 uint8_t picture_id) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100262
nisse25d0bdc2017-03-22 07:15:09 -0700263 RTC_DEPRECATED virtual void OnReceivedRPSI(uint32_t ssrc,
264 uint64_t picture_id) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100265
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100266 virtual ~RtcpIntraFrameObserver() {}
267};
268
269class RtcpBandwidthObserver {
270 public:
271 // REMB or TMMBR
272 virtual void OnReceivedEstimatedBitrate(uint32_t bitrate) = 0;
273
274 virtual void OnReceivedRtcpReceiverReport(
275 const ReportBlockList& report_blocks,
276 int64_t rtt,
277 int64_t now_ms) = 0;
278
279 virtual ~RtcpBandwidthObserver() {}
280};
281
elad.alonf9490002017-03-06 05:32:21 -0800282struct PacketFeedback {
283 PacketFeedback(int64_t arrival_time_ms, uint16_t sequence_number)
284 : PacketFeedback(-1,
285 arrival_time_ms,
286 -1,
287 sequence_number,
288 0,
Stefan Holmer9ea46b52017-03-15 12:40:25 +0100289 0,
290 0,
elad.alonf9490002017-03-06 05:32:21 -0800291 PacedPacketInfo()) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100292
elad.alonf9490002017-03-06 05:32:21 -0800293 PacketFeedback(int64_t arrival_time_ms,
294 int64_t send_time_ms,
295 uint16_t sequence_number,
296 size_t payload_size,
297 const PacedPacketInfo& pacing_info)
298 : PacketFeedback(-1,
299 arrival_time_ms,
300 send_time_ms,
301 sequence_number,
302 payload_size,
Stefan Holmer9ea46b52017-03-15 12:40:25 +0100303 0,
304 0,
305 pacing_info) {}
306
307 PacketFeedback(int64_t creation_time_ms,
308 uint16_t sequence_number,
309 size_t payload_size,
310 uint16_t local_net_id,
311 uint16_t remote_net_id,
312 const PacedPacketInfo& pacing_info)
313 : PacketFeedback(creation_time_ms,
314 -1,
315 -1,
316 sequence_number,
317 payload_size,
318 local_net_id,
319 remote_net_id,
elad.alonf9490002017-03-06 05:32:21 -0800320 pacing_info) {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100321
elad.alonf9490002017-03-06 05:32:21 -0800322 PacketFeedback(int64_t creation_time_ms,
323 int64_t arrival_time_ms,
324 int64_t send_time_ms,
325 uint16_t sequence_number,
326 size_t payload_size,
Stefan Holmer9ea46b52017-03-15 12:40:25 +0100327 uint16_t local_net_id,
328 uint16_t remote_net_id,
elad.alonf9490002017-03-06 05:32:21 -0800329 const PacedPacketInfo& pacing_info)
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100330 : creation_time_ms(creation_time_ms),
331 arrival_time_ms(arrival_time_ms),
332 send_time_ms(send_time_ms),
333 sequence_number(sequence_number),
334 payload_size(payload_size),
Stefan Holmer9ea46b52017-03-15 12:40:25 +0100335 local_net_id(local_net_id),
336 remote_net_id(remote_net_id),
philipel8aadd502017-02-23 02:56:13 -0800337 pacing_info(pacing_info) {}
338
339 static constexpr int kNotAProbe = -1;
elad.alonec304f92017-03-08 05:03:53 -0800340 static constexpr int64_t kNotReceived = -1;
philipel8aadd502017-02-23 02:56:13 -0800341
342 // NOTE! The variable |creation_time_ms| is not used when testing equality.
343 // This is due to |creation_time_ms| only being used by SendTimeHistory
344 // for book-keeping, and is of no interest outside that class.
elad.alonf9490002017-03-06 05:32:21 -0800345 // TODO(philipel): Remove |creation_time_ms| from PacketFeedback when cleaning
346 // up SendTimeHistory.
347 bool operator==(const PacketFeedback& rhs) const {
philipel8aadd502017-02-23 02:56:13 -0800348 return arrival_time_ms == rhs.arrival_time_ms &&
349 send_time_ms == rhs.send_time_ms &&
350 sequence_number == rhs.sequence_number &&
351 payload_size == rhs.payload_size && pacing_info == rhs.pacing_info;
352 }
philipela1ed0b32016-06-01 06:31:17 -0700353
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100354 // Time corresponding to when this object was created.
355 int64_t creation_time_ms;
356 // Time corresponding to when the packet was received. Timestamped with the
elad.alonec304f92017-03-08 05:03:53 -0800357 // receiver's clock. For unreceived packet, the sentinel value kNotReceived
358 // is used.
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100359 int64_t arrival_time_ms;
360 // Time corresponding to when the packet was sent, timestamped with the
361 // sender's clock.
362 int64_t send_time_ms;
363 // Packet identifier, incremented with 1 for every packet generated by the
364 // sender.
365 uint16_t sequence_number;
366 // Size of the packet excluding RTP headers.
367 size_t payload_size;
Stefan Holmer9ea46b52017-03-15 12:40:25 +0100368 // The network route ids that this packet is associated with.
369 uint16_t local_net_id;
370 uint16_t remote_net_id;
philipel8aadd502017-02-23 02:56:13 -0800371 // Pacing information about this packet.
372 PacedPacketInfo pacing_info;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100373};
374
tschumim3fae6282017-06-11 23:57:17 -0700375class PacketFeedbackComparator {
376 public:
377 inline bool operator()(const PacketFeedback& lhs, const PacketFeedback& rhs) {
378 if (lhs.arrival_time_ms != rhs.arrival_time_ms)
379 return lhs.arrival_time_ms < rhs.arrival_time_ms;
380 if (lhs.send_time_ms != rhs.send_time_ms)
381 return lhs.send_time_ms < rhs.send_time_ms;
382 return lhs.sequence_number < rhs.sequence_number;
383 }
384};
385
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100386class TransportFeedbackObserver {
387 public:
388 TransportFeedbackObserver() {}
389 virtual ~TransportFeedbackObserver() {}
390
philipel8aadd502017-02-23 02:56:13 -0800391 // Note: Transport-wide sequence number as sequence number.
elad.alond12a8e12017-03-23 11:04:48 -0700392 virtual void AddPacket(uint32_t ssrc,
393 uint16_t sequence_number,
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100394 size_t length,
philipel8aadd502017-02-23 02:56:13 -0800395 const PacedPacketInfo& pacing_info) = 0;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100396
397 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0;
Stefan Holmer60e43462016-09-07 09:58:20 +0200398
elad.alonf9490002017-03-06 05:32:21 -0800399 virtual std::vector<PacketFeedback> GetTransportFeedbackVector() const = 0;
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100400};
401
elad.alond12a8e12017-03-23 11:04:48 -0700402class PacketFeedbackObserver {
403 public:
404 virtual ~PacketFeedbackObserver() = default;
405
406 virtual void OnPacketAdded(uint32_t ssrc, uint16_t seq_num) = 0;
407 virtual void OnPacketFeedbackVector(
408 const std::vector<PacketFeedback>& packet_feedback_vector) = 0;
409};
410
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100411class RtcpRttStats {
412 public:
413 virtual void OnRttUpdate(int64_t rtt) = 0;
414
415 virtual int64_t LastProcessedRtt() const = 0;
416
danilchap5c1def82015-12-10 09:51:54 -0800417 virtual ~RtcpRttStats() {}
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100418};
419
terelius838cdb32016-10-24 09:38:22 -0700420// Null object version of RtpFeedback.
421class NullRtpFeedback : public RtpFeedback {
422 public:
nisse76e62b02017-05-31 02:24:52 -0700423 ~NullRtpFeedback() override {}
terelius838cdb32016-10-24 09:38:22 -0700424
425 int32_t OnInitializeDecoder(int8_t payload_type,
426 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
427 int frequency,
428 size_t channels,
nisse76e62b02017-05-31 02:24:52 -0700429 uint32_t rate) override;
terelius838cdb32016-10-24 09:38:22 -0700430
431 void OnIncomingSSRCChanged(uint32_t ssrc) override {}
432 void OnIncomingCSRCChanged(uint32_t csrc, bool added) override {}
433};
434
nisse76e62b02017-05-31 02:24:52 -0700435inline int32_t NullRtpFeedback::OnInitializeDecoder(
436 int8_t payload_type,
437 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
438 int frequency,
439 size_t channels,
440 uint32_t rate) {
441 return 0;
442}
443
Henrik Kjellanderff761fb2015-11-04 08:31:52 +0100444// Statistics about packet loss for a single directional connection. All values
445// are totals since the connection initiated.
446struct RtpPacketLossStats {
447 // The number of packets lost in events where no adjacent packets were also
448 // lost.
449 uint64_t single_packet_loss_count;
450 // The number of events in which more than one adjacent packet was lost.
451 uint64_t multiple_packet_loss_event_count;
452 // The number of packets lost in events where more than one adjacent packet
453 // was lost.
454 uint64_t multiple_packet_loss_packet_count;
455};
456
457class RtpPacketSender {
458 public:
459 RtpPacketSender() {}
460 virtual ~RtpPacketSender() {}
461
462 enum Priority {
463 kHighPriority = 0, // Pass through; will be sent immediately.
464 kNormalPriority = 2, // Put in back of the line.
465 kLowPriority = 3, // Put in back of the low priority line.
466 };
467 // Low priority packets are mixed with the normal priority packets
468 // while we are paused.
469
470 // Returns true if we send the packet now, else it will add the packet
471 // information to the queue and call TimeToSendPacket when it's time to send.
472 virtual void InsertPacket(Priority priority,
473 uint32_t ssrc,
474 uint16_t sequence_number,
475 int64_t capture_time_ms,
476 size_t bytes,
477 bool retransmission) = 0;
478};
479
480class TransportSequenceNumberAllocator {
481 public:
482 TransportSequenceNumberAllocator() {}
483 virtual ~TransportSequenceNumberAllocator() {}
484
485 virtual uint16_t AllocateSequenceNumber() = 0;
486};
487
488} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200489#endif // MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_