Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h

Issue 1493403003: modules/rtp_rtcp/include folder cleared of lint warnings (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 15 matching lines...) Expand all
26 namespace webrtc { 26 namespace webrtc {
27 namespace rtcp { 27 namespace rtcp {
28 class TransportFeedback; 28 class TransportFeedback;
29 } 29 }
30 30
31 const int kVideoPayloadTypeFrequency = 90000; 31 const int kVideoPayloadTypeFrequency = 90000;
32 32
33 // Minimum RTP header size in bytes. 33 // Minimum RTP header size in bytes.
34 const uint8_t kRtpHeaderSize = 12; 34 const uint8_t kRtpHeaderSize = 12;
35 35
36 struct AudioPayload 36 struct AudioPayload {
37 {
38 uint32_t frequency; 37 uint32_t frequency;
39 uint8_t channels; 38 uint8_t channels;
40 uint32_t rate; 39 uint32_t rate;
41 }; 40 };
42 41
43 struct VideoPayload 42 struct VideoPayload {
44 {
45 RtpVideoCodecTypes videoCodecType; 43 RtpVideoCodecTypes videoCodecType;
46 uint32_t maxRate; 44 uint32_t maxRate;
47 }; 45 };
48 46
49 union PayloadUnion 47 union PayloadUnion {
50 {
51 AudioPayload Audio; 48 AudioPayload Audio;
52 VideoPayload Video; 49 VideoPayload Video;
53 }; 50 };
54 51
55 enum RTPAliveType 52 enum RTPAliveType { kRtpDead = 0, kRtpNoRtp = 1, kRtpAlive = 2 };
56 {
57 kRtpDead = 0,
58 kRtpNoRtp = 1,
59 kRtpAlive = 2
60 };
61 53
62 enum ProtectionType { 54 enum ProtectionType {
63 kUnprotectedPacket, 55 kUnprotectedPacket,
64 kProtectedPacket 56 kProtectedPacket
65 }; 57 };
66 58
67 enum StorageType { 59 enum StorageType {
68 kDontRetransmit, 60 kDontRetransmit,
69 kAllowRetransmission 61 kAllowRetransmission
70 }; 62 };
71 63
72 enum RTPExtensionType { 64 enum RTPExtensionType {
73 kRtpExtensionNone, 65 kRtpExtensionNone,
74 kRtpExtensionTransmissionTimeOffset, 66 kRtpExtensionTransmissionTimeOffset,
75 kRtpExtensionAudioLevel, 67 kRtpExtensionAudioLevel,
76 kRtpExtensionAbsoluteSendTime, 68 kRtpExtensionAbsoluteSendTime,
77 kRtpExtensionVideoRotation, 69 kRtpExtensionVideoRotation,
78 kRtpExtensionTransportSequenceNumber, 70 kRtpExtensionTransportSequenceNumber,
79 }; 71 };
80 72
81 enum RTCPAppSubTypes 73 enum RTCPAppSubTypes { kAppSubtypeBwe = 0x00 };
82 {
83 kAppSubtypeBwe = 0x00
84 };
85 74
86 // TODO(sprang): Make this an enum class once rtcp_receiver has been cleaned up. 75 // TODO(sprang): Make this an enum class once rtcp_receiver has been cleaned up.
87 enum RTCPPacketType : uint32_t { 76 enum RTCPPacketType : uint32_t {
88 kRtcpReport = 0x0001, 77 kRtcpReport = 0x0001,
89 kRtcpSr = 0x0002, 78 kRtcpSr = 0x0002,
90 kRtcpRr = 0x0004, 79 kRtcpRr = 0x0004,
91 kRtcpSdes = 0x0008, 80 kRtcpSdes = 0x0008,
92 kRtcpBye = 0x0010, 81 kRtcpBye = 0x0010,
93 kRtcpPli = 0x0020, 82 kRtcpPli = 0x0020,
94 kRtcpNack = 0x0040, 83 kRtcpNack = 0x0040,
95 kRtcpFir = 0x0080, 84 kRtcpFir = 0x0080,
96 kRtcpTmmbr = 0x0100, 85 kRtcpTmmbr = 0x0100,
97 kRtcpTmmbn = 0x0200, 86 kRtcpTmmbn = 0x0200,
98 kRtcpSrReq = 0x0400, 87 kRtcpSrReq = 0x0400,
99 kRtcpXrVoipMetric = 0x0800, 88 kRtcpXrVoipMetric = 0x0800,
100 kRtcpApp = 0x1000, 89 kRtcpApp = 0x1000,
101 kRtcpSli = 0x4000, 90 kRtcpSli = 0x4000,
102 kRtcpRpsi = 0x8000, 91 kRtcpRpsi = 0x8000,
103 kRtcpRemb = 0x10000, 92 kRtcpRemb = 0x10000,
104 kRtcpTransmissionTimeOffset = 0x20000, 93 kRtcpTransmissionTimeOffset = 0x20000,
105 kRtcpXrReceiverReferenceTime = 0x40000, 94 kRtcpXrReceiverReferenceTime = 0x40000,
106 kRtcpXrDlrrReportBlock = 0x80000, 95 kRtcpXrDlrrReportBlock = 0x80000,
107 kRtcpTransportFeedback = 0x100000, 96 kRtcpTransportFeedback = 0x100000,
108 }; 97 };
109 98
110 enum KeyFrameRequestMethod { kKeyFrameReqPliRtcp, kKeyFrameReqFirRtcp }; 99 enum KeyFrameRequestMethod { kKeyFrameReqPliRtcp, kKeyFrameReqFirRtcp };
111 100
112 enum RtpRtcpPacketType 101 enum RtpRtcpPacketType { kPacketRtp = 0, kPacketKeepAlive = 1 };
113 {
114 kPacketRtp = 0,
115 kPacketKeepAlive = 1
116 };
117 102
118 enum NACKMethod 103 enum NACKMethod { kNackOff = 0, kNackRtcp = 2 };
119 {
120 kNackOff = 0,
121 kNackRtcp = 2
122 };
123 104
124 enum RetransmissionMode : uint8_t { 105 enum RetransmissionMode : uint8_t {
125 kRetransmitOff = 0x0, 106 kRetransmitOff = 0x0,
126 kRetransmitFECPackets = 0x1, 107 kRetransmitFECPackets = 0x1,
127 kRetransmitBaseLayer = 0x2, 108 kRetransmitBaseLayer = 0x2,
128 kRetransmitHigherLayers = 0x4, 109 kRetransmitHigherLayers = 0x4,
129 kRetransmitAllPackets = 0xFF 110 kRetransmitAllPackets = 0xFF
130 }; 111 };
131 112
132 enum RtxMode { 113 enum RtxMode {
133 kRtxOff = 0x0, 114 kRtxOff = 0x0,
134 kRtxRetransmitted = 0x1, // Only send retransmissions over RTX. 115 kRtxRetransmitted = 0x1, // Only send retransmissions over RTX.
135 kRtxRedundantPayloads = 0x2 // Preventively send redundant payloads 116 kRtxRedundantPayloads = 0x2 // Preventively send redundant payloads
136 // instead of padding. 117 // instead of padding.
137 }; 118 };
138 119
139 const size_t kRtxHeaderSize = 2; 120 const size_t kRtxHeaderSize = 2;
140 121
141 struct RTCPSenderInfo 122 struct RTCPSenderInfo {
142 {
143 uint32_t NTPseconds; 123 uint32_t NTPseconds;
144 uint32_t NTPfraction; 124 uint32_t NTPfraction;
145 uint32_t RTPtimeStamp; 125 uint32_t RTPtimeStamp;
146 uint32_t sendPacketCount; 126 uint32_t sendPacketCount;
147 uint32_t sendOctetCount; 127 uint32_t sendOctetCount;
148 }; 128 };
149 129
150 struct RTCPReportBlock { 130 struct RTCPReportBlock {
151 RTCPReportBlock() 131 RTCPReportBlock()
152 : remoteSSRC(0), sourceSSRC(0), fractionLost(0), cumulativeLost(0), 132 : remoteSSRC(0), sourceSSRC(0), fractionLost(0), cumulativeLost(0),
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 last_timestamp_time_ms(-1), 179 last_timestamp_time_ms(-1),
200 media_has_been_sent(false) {} 180 media_has_been_sent(false) {}
201 uint16_t sequence_number; 181 uint16_t sequence_number;
202 uint32_t start_timestamp; 182 uint32_t start_timestamp;
203 uint32_t timestamp; 183 uint32_t timestamp;
204 int64_t capture_time_ms; 184 int64_t capture_time_ms;
205 int64_t last_timestamp_time_ms; 185 int64_t last_timestamp_time_ms;
206 bool media_has_been_sent; 186 bool media_has_been_sent;
207 }; 187 };
208 188
209 class RtpData 189 class RtpData {
210 { 190 public:
211 public: 191 virtual ~RtpData() {}
212 virtual ~RtpData() {}
213 192
214 virtual int32_t OnReceivedPayloadData( 193 virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData,
215 const uint8_t* payloadData, 194 const size_t payloadSize,
216 const size_t payloadSize, 195 const WebRtcRTPHeader* rtpHeader) = 0;
217 const WebRtcRTPHeader* rtpHeader) = 0;
218 196
219 virtual bool OnRecoveredPacket(const uint8_t* packet, 197 virtual bool OnRecoveredPacket(const uint8_t* packet,
220 size_t packet_length) = 0; 198 size_t packet_length) = 0;
221 }; 199 };
222 200
223 class RtpFeedback 201 class RtpFeedback {
224 { 202 public:
225 public: 203 virtual ~RtpFeedback() {}
226 virtual ~RtpFeedback() {}
227 204
228 // Receiving payload change or SSRC change. (return success!) 205 // Receiving payload change or SSRC change. (return success!)
229 /* 206 /*
230 * channels - number of channels in codec (1 = mono, 2 = stereo) 207 * channels - number of channels in codec (1 = mono, 2 = stereo)
231 */ 208 */
232 virtual int32_t OnInitializeDecoder( 209 virtual int32_t OnInitializeDecoder(
233 const int8_t payloadType, 210 const int8_t payloadType,
234 const char payloadName[RTP_PAYLOAD_NAME_SIZE], 211 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
235 const int frequency, 212 const int frequency,
236 const uint8_t channels, 213 const uint8_t channels,
237 const uint32_t rate) = 0; 214 const uint32_t rate) = 0;
238 215
239 virtual void OnIncomingSSRCChanged(const uint32_t ssrc) = 0; 216 virtual void OnIncomingSSRCChanged(const uint32_t ssrc) = 0;
240 217
241 virtual void OnIncomingCSRCChanged(const uint32_t CSRC, 218 virtual void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) = 0;
242 const bool added) = 0;
243 }; 219 };
244 220
245 class RtpAudioFeedback { 221 class RtpAudioFeedback {
246 public: 222 public:
247 virtual void OnPlayTelephoneEvent(const uint8_t event, 223 virtual void OnPlayTelephoneEvent(const uint8_t event,
248 const uint16_t lengthMs, 224 const uint16_t lengthMs,
249 const uint8_t volume) = 0; 225 const uint8_t volume) = 0;
250 226
251 protected: 227 protected:
252 virtual ~RtpAudioFeedback() {} 228 virtual ~RtpAudioFeedback() {}
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 315
340 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0; 316 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0;
341 }; 317 };
342 318
343 class RtcpRttStats { 319 class RtcpRttStats {
344 public: 320 public:
345 virtual void OnRttUpdate(int64_t rtt) = 0; 321 virtual void OnRttUpdate(int64_t rtt) = 0;
346 322
347 virtual int64_t LastProcessedRtt() const = 0; 323 virtual int64_t LastProcessedRtt() const = 0;
348 324
349 virtual ~RtcpRttStats() {}; 325 virtual ~RtcpRttStats() {}
350 }; 326 };
351 327
352 // Null object version of RtpFeedback. 328 // Null object version of RtpFeedback.
353 class NullRtpFeedback : public RtpFeedback { 329 class NullRtpFeedback : public RtpFeedback {
354 public: 330 public:
355 virtual ~NullRtpFeedback() {} 331 virtual ~NullRtpFeedback() {}
356 332
357 int32_t OnInitializeDecoder(const int8_t payloadType, 333 int32_t OnInitializeDecoder(const int8_t payloadType,
358 const char payloadName[RTP_PAYLOAD_NAME_SIZE], 334 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
359 const int frequency, 335 const int frequency,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 406
431 class TransportSequenceNumberAllocator { 407 class TransportSequenceNumberAllocator {
432 public: 408 public:
433 TransportSequenceNumberAllocator() {} 409 TransportSequenceNumberAllocator() {}
434 virtual ~TransportSequenceNumberAllocator() {} 410 virtual ~TransportSequenceNumberAllocator() {}
435 411
436 virtual uint16_t AllocateSequenceNumber() = 0; 412 virtual uint16_t AllocateSequenceNumber() = 0;
437 }; 413 };
438 414
439 } // namespace webrtc 415 } // namespace webrtc
440 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_ 416 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_rtcp.h ('k') | webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698