niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
| 11 | #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| 12 | #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| 13 | |
pwestin@webrtc.org | 0074187 | 2012-01-19 15:56:10 +0000 | [diff] [blame] | 14 | #include <cassert> |
| 15 | #include <cmath> |
| 16 | #include <map> |
| 17 | |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 18 | #include "rtp_rtcp_config.h" // misc. defines (e.g. MAX_PACKET_LENGTH) |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 19 | #include "rtp_rtcp_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | #include "common_types.h" // Encryption |
| 21 | #include "ssrc_database.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | #include "Bitrate.h" |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 23 | #include "rtp_header_extension.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | #include "video_codec_information.h" |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 25 | #include "transmission_bucket.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | #define MAX_INIT_RTP_SEQ_NUMBER 32767 // 2^15 -1 |
| 28 | |
| 29 | namespace webrtc { |
| 30 | class CriticalSectionWrapper; |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 31 | class RTPPacketHistory; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 32 | class RTPSenderAudio; |
| 33 | class RTPSenderVideo; |
| 34 | |
| 35 | class RTPSenderInterface |
| 36 | { |
| 37 | public: |
| 38 | RTPSenderInterface() {} |
| 39 | virtual ~RTPSenderInterface() {} |
| 40 | |
| 41 | virtual WebRtc_UWord32 SSRC() const = 0; |
| 42 | virtual WebRtc_UWord32 Timestamp() const = 0; |
| 43 | |
| 44 | virtual WebRtc_Word32 BuildRTPheader(WebRtc_UWord8* dataBuffer, |
| 45 | const WebRtc_Word8 payloadType, |
| 46 | const bool markerBit, |
| 47 | const WebRtc_UWord32 captureTimeStamp, |
| 48 | const bool timeStampProvided = true, |
| 49 | const bool incSequenceNumber = true) = 0; |
| 50 | |
| 51 | virtual WebRtc_UWord16 RTPHeaderLength() const = 0; |
| 52 | virtual WebRtc_UWord16 IncrementSequenceNumber() = 0; |
| 53 | virtual WebRtc_UWord16 SequenceNumber() const = 0; |
| 54 | virtual WebRtc_UWord16 MaxPayloadLength() const = 0; |
henrik.lundin@webrtc.org | f15fbc3 | 2011-11-08 08:23:47 +0000 | [diff] [blame] | 55 | virtual WebRtc_UWord16 MaxDataPayloadLength() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | virtual WebRtc_UWord16 PacketOverHead() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 57 | virtual WebRtc_UWord16 ActualSendBitrateKbit() const = 0; |
| 58 | |
asapersson@webrtc.org | e5b49a0 | 2012-11-06 13:09:39 +0000 | [diff] [blame^] | 59 | virtual WebRtc_Word32 SendToNetwork(WebRtc_UWord8* data_buffer, |
| 60 | const WebRtc_UWord16 payload_length, |
| 61 | const WebRtc_UWord16 rtp_header_length, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 62 | int64_t capture_time_ms, |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 63 | const StorageType storage) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | class RTPSender : public Bitrate, public RTPSenderInterface |
| 67 | { |
| 68 | public: |
pwestin@webrtc.org | 0644b1d | 2011-12-01 15:42:31 +0000 | [diff] [blame] | 69 | RTPSender(const WebRtc_Word32 id, const bool audio, RtpRtcpClock* clock); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 70 | virtual ~RTPSender(); |
| 71 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | void ProcessBitrate(); |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 73 | void ProcessSendToNetwork(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 75 | WebRtc_UWord16 ActualSendBitrateKbit() const; |
| 76 | |
stefan@webrtc.org | fbea4e5 | 2011-10-27 16:08:29 +0000 | [diff] [blame] | 77 | WebRtc_UWord32 VideoBitrateSent() const; |
stefan@webrtc.org | d0bdab0 | 2011-10-14 14:24:54 +0000 | [diff] [blame] | 78 | WebRtc_UWord32 FecOverheadRate() const; |
| 79 | WebRtc_UWord32 NackOverheadRate() const; |
| 80 | |
pwestin@webrtc.org | 49888ce | 2012-04-27 05:25:53 +0000 | [diff] [blame] | 81 | void SetTargetSendBitrate(const WebRtc_UWord32 bits); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 82 | |
| 83 | WebRtc_UWord16 MaxDataPayloadLength() const; // with RTP and FEC headers |
| 84 | |
| 85 | // callback |
| 86 | WebRtc_Word32 RegisterSendTransport(Transport* outgoingTransport); |
| 87 | |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 88 | WebRtc_Word32 RegisterPayload( |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 89 | const char payloadName[RTP_PAYLOAD_NAME_SIZE], |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 90 | const WebRtc_Word8 payloadType, |
| 91 | const WebRtc_UWord32 frequency, |
| 92 | const WebRtc_UWord8 channels, |
| 93 | const WebRtc_UWord32 rate); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 94 | |
| 95 | WebRtc_Word32 DeRegisterSendPayload(const WebRtc_Word8 payloadType); |
| 96 | |
| 97 | WebRtc_Word8 SendPayloadType() const; |
| 98 | |
| 99 | int SendPayloadFrequency() const; |
| 100 | |
| 101 | void SetSendingStatus(const bool enabled); |
| 102 | |
| 103 | void SetSendingMediaStatus(const bool enabled); |
| 104 | bool SendingMedia() const; |
| 105 | |
| 106 | // number of sent RTP packets |
| 107 | WebRtc_UWord32 Packets() const; |
| 108 | |
| 109 | // number of sent RTP bytes |
| 110 | WebRtc_UWord32 Bytes() const; |
| 111 | |
| 112 | WebRtc_Word32 ResetDataCounters(); |
| 113 | |
| 114 | WebRtc_UWord32 StartTimestamp() const; |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 115 | WebRtc_Word32 SetStartTimestamp(const WebRtc_UWord32 timestamp, |
| 116 | const bool force = false); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 117 | |
| 118 | WebRtc_UWord32 GenerateNewSSRC(); |
| 119 | WebRtc_Word32 SetSSRC( const WebRtc_UWord32 ssrc); |
| 120 | |
| 121 | WebRtc_UWord16 SequenceNumber() const; |
| 122 | WebRtc_Word32 SetSequenceNumber( WebRtc_UWord16 seq); |
| 123 | |
| 124 | WebRtc_Word32 CSRCs(WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize]) const; |
| 125 | |
| 126 | WebRtc_Word32 SetCSRCStatus(const bool include); |
| 127 | |
| 128 | WebRtc_Word32 SetCSRCs(const WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize], |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 129 | const WebRtc_UWord8 arrLength); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 130 | |
| 131 | WebRtc_Word32 SetMaxPayloadLength(const WebRtc_UWord16 length, |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 132 | const WebRtc_UWord16 packetOverHead); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 133 | |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 134 | WebRtc_Word32 SendOutgoingData(const FrameType frameType, |
| 135 | const WebRtc_Word8 payloadType, |
| 136 | const WebRtc_UWord32 timeStamp, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 137 | int64_t capture_time_ms, |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 138 | const WebRtc_UWord8* payloadData, |
| 139 | const WebRtc_UWord32 payloadSize, |
| 140 | const RTPFragmentationHeader* fragmentation, |
| 141 | VideoCodecInformation* codecInfo = NULL, |
| 142 | const RTPVideoTypeHeader* rtpTypeHdr = NULL); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 143 | |
pwestin@webrtc.org | 12d97f6 | 2012-01-05 10:54:44 +0000 | [diff] [blame] | 144 | WebRtc_Word32 SendPadData(WebRtc_Word8 payload_type, |
| 145 | WebRtc_UWord32 capture_timestamp, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 146 | int64_t capture_time_ms, |
pwestin@webrtc.org | 12d97f6 | 2012-01-05 10:54:44 +0000 | [diff] [blame] | 147 | WebRtc_Word32 bytes); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 148 | /* |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 149 | * RTP header extension |
| 150 | */ |
| 151 | WebRtc_Word32 SetTransmissionTimeOffset( |
| 152 | const WebRtc_Word32 transmissionTimeOffset); |
| 153 | |
| 154 | WebRtc_Word32 RegisterRtpHeaderExtension(const RTPExtensionType type, |
| 155 | const WebRtc_UWord8 id); |
| 156 | |
| 157 | WebRtc_Word32 DeregisterRtpHeaderExtension(const RTPExtensionType type); |
| 158 | |
| 159 | WebRtc_UWord16 RtpHeaderExtensionTotalLength() const; |
| 160 | |
| 161 | WebRtc_UWord16 BuildRTPHeaderExtension(WebRtc_UWord8* dataBuffer) const; |
| 162 | |
| 163 | WebRtc_UWord8 BuildTransmissionTimeOffsetExtension( |
| 164 | WebRtc_UWord8* dataBuffer) const; |
| 165 | |
asapersson@webrtc.org | e5b49a0 | 2012-11-06 13:09:39 +0000 | [diff] [blame^] | 166 | bool UpdateTransmissionTimeOffset(WebRtc_UWord8* rtp_packet, |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 167 | const WebRtc_UWord16 rtp_packet_length, |
| 168 | const WebRtcRTPHeader& rtp_header, |
mflodman@webrtc.org | ba853c9 | 2012-08-10 14:30:53 +0000 | [diff] [blame] | 169 | const WebRtc_Word64 time_diff_ms) const; |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 170 | |
| 171 | void SetTransmissionSmoothingStatus(const bool enable); |
| 172 | |
| 173 | bool TransmissionSmoothingStatus() const; |
| 174 | |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 175 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 176 | * NACK |
| 177 | */ |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 178 | int SelectiveRetransmissions() const; |
| 179 | int SetSelectiveRetransmissions(uint8_t settings); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 180 | void OnReceivedNACK(const WebRtc_UWord16 nackSequenceNumbersLength, |
| 181 | const WebRtc_UWord16* nackSequenceNumbers, |
| 182 | const WebRtc_UWord16 avgRTT); |
| 183 | |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 184 | WebRtc_Word32 SetStorePacketsStatus(const bool enable, |
| 185 | const WebRtc_UWord16 numberToStore); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 186 | |
| 187 | bool StorePackets() const; |
| 188 | |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 189 | WebRtc_Word32 ReSendPacket(WebRtc_UWord16 packet_id, |
| 190 | WebRtc_UWord32 min_resend_time = 0); |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 191 | |
| 192 | WebRtc_Word32 ReSendToNetwork(const WebRtc_UWord8* packet, |
| 193 | const WebRtc_UWord32 size); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 194 | |
| 195 | bool ProcessNACKBitRate(const WebRtc_UWord32 now); |
| 196 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 197 | /* |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 198 | * RTX |
| 199 | */ |
| 200 | void SetRTXStatus(const bool enable, |
| 201 | const bool setSSRC, |
| 202 | const WebRtc_UWord32 SSRC); |
| 203 | |
| 204 | void RTXStatus(bool* enable, WebRtc_UWord32* SSRC) const; |
| 205 | |
| 206 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 207 | * Functions wrapping RTPSenderInterface |
| 208 | */ |
| 209 | virtual WebRtc_Word32 BuildRTPheader(WebRtc_UWord8* dataBuffer, |
| 210 | const WebRtc_Word8 payloadType, |
| 211 | const bool markerBit, |
| 212 | const WebRtc_UWord32 captureTimeStamp, |
| 213 | const bool timeStampProvided = true, |
| 214 | const bool incSequenceNumber = true); |
| 215 | |
| 216 | virtual WebRtc_UWord16 RTPHeaderLength() const ; |
| 217 | virtual WebRtc_UWord16 IncrementSequenceNumber(); |
| 218 | virtual WebRtc_UWord16 MaxPayloadLength() const; |
| 219 | virtual WebRtc_UWord16 PacketOverHead() const; |
| 220 | |
| 221 | // current timestamp |
| 222 | virtual WebRtc_UWord32 Timestamp() const; |
| 223 | virtual WebRtc_UWord32 SSRC() const; |
| 224 | |
asapersson@webrtc.org | e5b49a0 | 2012-11-06 13:09:39 +0000 | [diff] [blame^] | 225 | virtual WebRtc_Word32 SendToNetwork(WebRtc_UWord8* data_buffer, |
| 226 | const WebRtc_UWord16 payload_length, |
| 227 | const WebRtc_UWord16 rtp_header_length, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 228 | int64_t capture_time_ms, |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 229 | const StorageType storage); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 230 | |
| 231 | /* |
| 232 | * Audio |
| 233 | */ |
| 234 | WebRtc_Word32 RegisterAudioCallback(RtpAudioFeedback* messagesCallback); |
| 235 | |
| 236 | // Send a DTMF tone using RFC 2833 (4733) |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 237 | WebRtc_Word32 SendTelephoneEvent(const WebRtc_UWord8 key, |
| 238 | const WebRtc_UWord16 time_ms, |
| 239 | const WebRtc_UWord8 level); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 240 | |
| 241 | bool SendTelephoneEventActive(WebRtc_Word8& telephoneEvent) const; |
| 242 | |
| 243 | // set audio packet size, used to determine when it's time to send a DTMF packet in silence (CNG) |
| 244 | WebRtc_Word32 SetAudioPacketSize(const WebRtc_UWord16 packetSizeSamples); |
| 245 | |
| 246 | // Set status and ID for header-extension-for-audio-level-indication. |
| 247 | WebRtc_Word32 SetAudioLevelIndicationStatus(const bool enable, |
| 248 | const WebRtc_UWord8 ID); |
| 249 | |
| 250 | // Get status and ID for header-extension-for-audio-level-indication. |
| 251 | WebRtc_Word32 AudioLevelIndicationStatus(bool& enable, |
| 252 | WebRtc_UWord8& ID) const; |
| 253 | |
| 254 | // Store the audio level in dBov for header-extension-for-audio-level-indication. |
| 255 | WebRtc_Word32 SetAudioLevel(const WebRtc_UWord8 level_dBov); |
| 256 | |
| 257 | // Set payload type for Redundant Audio Data RFC 2198 |
| 258 | WebRtc_Word32 SetRED(const WebRtc_Word8 payloadType); |
| 259 | |
| 260 | // Get payload type for Redundant Audio Data RFC 2198 |
| 261 | WebRtc_Word32 RED(WebRtc_Word8& payloadType) const; |
| 262 | |
| 263 | /* |
| 264 | * Video |
| 265 | */ |
| 266 | VideoCodecInformation* CodecInformationVideo(); |
| 267 | |
| 268 | RtpVideoCodecTypes VideoCodecType() const; |
| 269 | |
| 270 | WebRtc_UWord32 MaxConfiguredBitrateVideo() const; |
| 271 | |
| 272 | WebRtc_Word32 SendRTPIntraRequest(); |
| 273 | |
| 274 | // FEC |
| 275 | WebRtc_Word32 SetGenericFECStatus(const bool enable, |
| 276 | const WebRtc_UWord8 payloadTypeRED, |
| 277 | const WebRtc_UWord8 payloadTypeFEC); |
| 278 | |
| 279 | WebRtc_Word32 GenericFECStatus(bool& enable, |
| 280 | WebRtc_UWord8& payloadTypeRED, |
| 281 | WebRtc_UWord8& payloadTypeFEC) const; |
| 282 | |
stefan@webrtc.org | e0d6fa4 | 2012-03-20 22:10:56 +0000 | [diff] [blame] | 283 | WebRtc_Word32 SetFecParameters( |
| 284 | const FecProtectionParams* delta_params, |
| 285 | const FecProtectionParams* key_params); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 286 | |
| 287 | protected: |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 288 | WebRtc_Word32 CheckPayloadType(const WebRtc_Word8 payloadType, |
| 289 | RtpVideoCodecTypes& videoType); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 290 | |
| 291 | private: |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 292 | void UpdateNACKBitRate(const WebRtc_UWord32 bytes, |
| 293 | const WebRtc_UWord32 now); |
| 294 | |
phoglund@webrtc.org | baaf243 | 2012-05-31 10:47:35 +0000 | [diff] [blame] | 295 | WebRtc_Word32 SendPaddingAccordingToBitrate( |
| 296 | WebRtc_Word8 payload_type, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 297 | WebRtc_UWord32 capture_timestamp, |
| 298 | int64_t capture_time_ms); |
phoglund@webrtc.org | baaf243 | 2012-05-31 10:47:35 +0000 | [diff] [blame] | 299 | |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 300 | WebRtc_Word32 _id; |
| 301 | const bool _audioConfigured; |
| 302 | RTPSenderAudio* _audio; |
| 303 | RTPSenderVideo* _video; |
phoglund@webrtc.org | baaf243 | 2012-05-31 10:47:35 +0000 | [diff] [blame] | 304 | |
henrike@webrtc.org | 65573f2 | 2011-12-13 19:17:27 +0000 | [diff] [blame] | 305 | CriticalSectionWrapper* _sendCritsect; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 306 | |
henrike@webrtc.org | 65573f2 | 2011-12-13 19:17:27 +0000 | [diff] [blame] | 307 | CriticalSectionWrapper* _transportCritsect; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 308 | Transport* _transport; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 309 | |
| 310 | bool _sendingMedia; |
| 311 | |
| 312 | WebRtc_UWord16 _maxPayloadLength; |
| 313 | WebRtc_UWord16 _targetSendBitrate; |
| 314 | WebRtc_UWord16 _packetOverHead; |
| 315 | |
| 316 | WebRtc_Word8 _payloadType; |
pwestin@webrtc.org | 0074187 | 2012-01-19 15:56:10 +0000 | [diff] [blame] | 317 | std::map<WebRtc_Word8, ModuleRTPUtility::Payload*> _payloadTypeMap; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 318 | |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 319 | RtpHeaderExtensionMap _rtpHeaderExtensionMap; |
| 320 | WebRtc_Word32 _transmissionTimeOffset; |
| 321 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 322 | // NACK |
| 323 | WebRtc_UWord32 _nackByteCountTimes[NACK_BYTECOUNT_SIZE]; |
| 324 | WebRtc_Word32 _nackByteCount[NACK_BYTECOUNT_SIZE]; |
stefan@webrtc.org | d0bdab0 | 2011-10-14 14:24:54 +0000 | [diff] [blame] | 325 | Bitrate _nackBitrate; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 326 | |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 327 | RTPPacketHistory* _packetHistory; |
| 328 | TransmissionBucket _sendBucket; |
pwestin@webrtc.org | 1853005 | 2012-07-03 10:41:54 +0000 | [diff] [blame] | 329 | WebRtc_Word64 _timeLastSendToNetworkUpdate; |
asapersson@webrtc.org | 0b3c35a | 2012-01-16 11:06:31 +0000 | [diff] [blame] | 330 | bool _transmissionSmoothing; |
| 331 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 332 | // statistics |
| 333 | WebRtc_UWord32 _packetsSent; |
| 334 | WebRtc_UWord32 _payloadBytesSent; |
| 335 | |
| 336 | // RTP variables |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 337 | bool _startTimeStampForced; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 338 | WebRtc_UWord32 _startTimeStamp; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 339 | SSRCDatabase& _ssrcDB; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 340 | WebRtc_UWord32 _remoteSSRC; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 341 | bool _sequenceNumberForced; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 342 | WebRtc_UWord16 _sequenceNumber; |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 343 | WebRtc_UWord16 _sequenceNumberRTX; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 344 | bool _ssrcForced; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 345 | WebRtc_UWord32 _ssrc; |
| 346 | WebRtc_UWord32 _timeStamp; |
| 347 | WebRtc_UWord8 _CSRCs; |
| 348 | WebRtc_UWord32 _CSRC[kRtpCsrcSize]; |
| 349 | bool _includeCSRCs; |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 350 | bool _RTX; |
| 351 | WebRtc_UWord32 _ssrcRTX; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 352 | }; |
| 353 | } // namespace webrtc |
| 354 | |
| 355 | #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |