blob: 2de8a6afef7f4ef5359de77e608fef415dd91cd0 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
pwestin@webrtc.orgf6bb77a2012-01-24 17:16:59 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org00741872012-01-19 15:56:10 +000014#include <cassert>
15#include <cmath>
16#include <map>
17
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000018#include "rtp_rtcp_config.h" // misc. defines (e.g. MAX_PACKET_LENGTH)
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +000019#include "rtp_rtcp_defines.h"
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000020#include "common_types.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000021#include "ssrc_database.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000022#include "Bitrate.h"
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +000023#include "rtp_header_extension.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000024#include "video_codec_information.h"
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +000025#include "transmission_bucket.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000026
niklase@google.com470e71d2011-07-07 08:21:25 +000027#define MAX_INIT_RTP_SEQ_NUMBER 32767 // 2^15 -1
28
29namespace webrtc {
30class CriticalSectionWrapper;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +000031class RTPPacketHistory;
niklase@google.com470e71d2011-07-07 08:21:25 +000032class RTPSenderAudio;
33class RTPSenderVideo;
34
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000035class RTPSenderInterface {
36 public:
37 RTPSenderInterface() {}
38 virtual ~RTPSenderInterface() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000039
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000040 virtual WebRtc_UWord32 SSRC() const = 0;
41 virtual WebRtc_UWord32 Timestamp() const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000042
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000043 virtual WebRtc_Word32 BuildRTPheader(WebRtc_UWord8* dataBuffer,
niklase@google.com470e71d2011-07-07 08:21:25 +000044 const WebRtc_Word8 payloadType,
45 const bool markerBit,
46 const WebRtc_UWord32 captureTimeStamp,
47 const bool timeStampProvided = true,
48 const bool incSequenceNumber = true) = 0;
49
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000050 virtual WebRtc_UWord16 RTPHeaderLength() const = 0;
51 virtual WebRtc_UWord16 IncrementSequenceNumber() = 0;
52 virtual WebRtc_UWord16 SequenceNumber() const = 0;
53 virtual WebRtc_UWord16 MaxPayloadLength() const = 0;
54 virtual WebRtc_UWord16 MaxDataPayloadLength() const = 0;
55 virtual WebRtc_UWord16 PacketOverHead() const = 0;
56 virtual WebRtc_UWord16 ActualSendBitrateKbit() const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000057
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000058 virtual WebRtc_Word32 SendToNetwork(WebRtc_UWord8* data_buffer,
59 WebRtc_UWord16 payload_length,
60 WebRtc_UWord16 rtp_header_length,
61 int64_t capture_time_ms,
62 StorageType storage) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000063};
64
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000065class RTPSender : public Bitrate, public RTPSenderInterface {
66 public:
67 RTPSender(const WebRtc_Word32 id, const bool audio, RtpRtcpClock* clock,
68 Transport* transport, RtpAudioFeedback* audio_feedback);
69 virtual ~RTPSender();
niklase@google.com470e71d2011-07-07 08:21:25 +000070
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000071 void ProcessBitrate();
72 void ProcessSendToNetwork();
niklase@google.com470e71d2011-07-07 08:21:25 +000073
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000074 WebRtc_UWord16 ActualSendBitrateKbit() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000075
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000076 WebRtc_UWord32 VideoBitrateSent() const;
77 WebRtc_UWord32 FecOverheadRate() const;
78 WebRtc_UWord32 NackOverheadRate() const;
stefan@webrtc.orgd0bdab02011-10-14 14:24:54 +000079
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000080 void SetTargetSendBitrate(const WebRtc_UWord32 bits);
niklase@google.com470e71d2011-07-07 08:21:25 +000081
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000082 WebRtc_UWord16 MaxDataPayloadLength() const; // with RTP and FEC headers
niklase@google.com470e71d2011-07-07 08:21:25 +000083
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000084 WebRtc_Word32 RegisterPayload(
85 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
86 const WebRtc_Word8 payloadType,
87 const WebRtc_UWord32 frequency,
88 const WebRtc_UWord8 channels,
89 const WebRtc_UWord32 rate);
niklase@google.com470e71d2011-07-07 08:21:25 +000090
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000091 WebRtc_Word32 DeRegisterSendPayload(const WebRtc_Word8 payloadType);
niklase@google.com470e71d2011-07-07 08:21:25 +000092
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000093 WebRtc_Word8 SendPayloadType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000094
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000095 int SendPayloadFrequency() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000096
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000097 void SetSendingStatus(const bool enabled);
niklase@google.com470e71d2011-07-07 08:21:25 +000098
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000099 void SetSendingMediaStatus(const bool enabled);
100 bool SendingMedia() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000102 // number of sent RTP packets
103 WebRtc_UWord32 Packets() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000105 // number of sent RTP bytes
106 WebRtc_UWord32 Bytes() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000108 void ResetDataCounters();
niklase@google.com470e71d2011-07-07 08:21:25 +0000109
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000110 WebRtc_UWord32 StartTimestamp() const;
111 void SetStartTimestamp(WebRtc_UWord32 timestamp, bool force);
niklase@google.com470e71d2011-07-07 08:21:25 +0000112
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000113 WebRtc_UWord32 GenerateNewSSRC();
114 void SetSSRC(const WebRtc_UWord32 ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000115
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000116 WebRtc_UWord16 SequenceNumber() const;
117 void SetSequenceNumber(WebRtc_UWord16 seq);
niklase@google.com470e71d2011-07-07 08:21:25 +0000118
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000119 WebRtc_Word32 CSRCs(WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize]) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000120
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000121 void SetCSRCStatus(const bool include);
niklase@google.com470e71d2011-07-07 08:21:25 +0000122
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000123 void SetCSRCs(const WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize],
124 const WebRtc_UWord8 arrLength);
niklase@google.com470e71d2011-07-07 08:21:25 +0000125
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000126 WebRtc_Word32 SetMaxPayloadLength(const WebRtc_UWord16 length,
127 const WebRtc_UWord16 packetOverHead);
niklase@google.com470e71d2011-07-07 08:21:25 +0000128
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000129 WebRtc_Word32 SendOutgoingData(const FrameType frameType,
130 const WebRtc_Word8 payloadType,
131 const WebRtc_UWord32 timeStamp,
132 int64_t capture_time_ms,
133 const WebRtc_UWord8* payloadData,
134 const WebRtc_UWord32 payloadSize,
135 const RTPFragmentationHeader* fragmentation,
136 VideoCodecInformation* codecInfo = NULL,
137 const RTPVideoTypeHeader* rtpTypeHdr = NULL);
niklase@google.com470e71d2011-07-07 08:21:25 +0000138
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000139 WebRtc_Word32 SendPadData(WebRtc_Word8 payload_type,
140 WebRtc_UWord32 capture_timestamp,
141 int64_t capture_time_ms,
142 WebRtc_Word32 bytes);
143 /*
144 * RTP header extension
145 */
146 WebRtc_Word32 SetTransmissionTimeOffset(
147 const WebRtc_Word32 transmissionTimeOffset);
niklase@google.com470e71d2011-07-07 08:21:25 +0000148
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000149 WebRtc_Word32 RegisterRtpHeaderExtension(const RTPExtensionType type,
150 const WebRtc_UWord8 id);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000151
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000152 WebRtc_Word32 DeregisterRtpHeaderExtension(const RTPExtensionType type);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000153
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000154 WebRtc_UWord16 RtpHeaderExtensionTotalLength() const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000155
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000156 WebRtc_UWord16 BuildRTPHeaderExtension(WebRtc_UWord8* dataBuffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000157
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000158 WebRtc_UWord8 BuildTransmissionTimeOffsetExtension(
159 WebRtc_UWord8* dataBuffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000160
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000161 bool UpdateTransmissionTimeOffset(WebRtc_UWord8* rtp_packet,
162 const WebRtc_UWord16 rtp_packet_length,
163 const WebRtcRTPHeader& rtp_header,
164 const WebRtc_Word64 time_diff_ms) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000165
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000166 void SetTransmissionSmoothingStatus(const bool enable);
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000167
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000168 bool TransmissionSmoothingStatus() const;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000169
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000170 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000171 * NACK
172 */
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000173 int SelectiveRetransmissions() const;
174 int SetSelectiveRetransmissions(uint8_t settings);
175 void OnReceivedNACK(const WebRtc_UWord16 nackSequenceNumbersLength,
176 const WebRtc_UWord16* nackSequenceNumbers,
177 const WebRtc_UWord16 avgRTT);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000179 void SetStorePacketsStatus(const bool enable,
180 const WebRtc_UWord16 numberToStore);
niklase@google.com470e71d2011-07-07 08:21:25 +0000181
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000182 bool StorePackets() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000183
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000184 WebRtc_Word32 ReSendPacket(WebRtc_UWord16 packet_id,
185 WebRtc_UWord32 min_resend_time = 0);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000186
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000187 WebRtc_Word32 ReSendToNetwork(const WebRtc_UWord8* packet,
188 const WebRtc_UWord32 size);
niklase@google.com470e71d2011-07-07 08:21:25 +0000189
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000190 bool ProcessNACKBitRate(const WebRtc_UWord32 now);
niklase@google.com470e71d2011-07-07 08:21:25 +0000191
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000192 /*
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000193 * RTX
194 */
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000195 void SetRTXStatus(const bool enable,
196 const bool setSSRC,
197 const WebRtc_UWord32 SSRC);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000198
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000199 void RTXStatus(bool* enable, WebRtc_UWord32* SSRC) const;
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000200
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000201 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000202 * Functions wrapping RTPSenderInterface
203 */
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000204 virtual WebRtc_Word32 BuildRTPheader(WebRtc_UWord8* dataBuffer,
205 const WebRtc_Word8 payloadType,
206 const bool markerBit,
207 const WebRtc_UWord32 captureTimeStamp,
208 const bool timeStampProvided = true,
209 const bool incSequenceNumber = true);
niklase@google.com470e71d2011-07-07 08:21:25 +0000210
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000211 virtual WebRtc_UWord16 RTPHeaderLength() const ;
212 virtual WebRtc_UWord16 IncrementSequenceNumber();
213 virtual WebRtc_UWord16 MaxPayloadLength() const;
214 virtual WebRtc_UWord16 PacketOverHead() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000215
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000216 // current timestamp
217 virtual WebRtc_UWord32 Timestamp() const;
218 virtual WebRtc_UWord32 SSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000219
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000220 virtual WebRtc_Word32 SendToNetwork(WebRtc_UWord8* data_buffer,
221 WebRtc_UWord16 payload_length,
222 WebRtc_UWord16 rtp_header_length,
223 int64_t capture_time_ms,
224 StorageType storage);
225 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000226 * Audio
227 */
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000228 // Send a DTMF tone using RFC 2833 (4733)
229 WebRtc_Word32 SendTelephoneEvent(const WebRtc_UWord8 key,
230 const WebRtc_UWord16 time_ms,
231 const WebRtc_UWord8 level);
niklase@google.com470e71d2011-07-07 08:21:25 +0000232
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000233 bool SendTelephoneEventActive(WebRtc_Word8& telephoneEvent) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000234
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000235 // Set audio packet size, used to determine when it's time to send a DTMF
236 // packet in silence (CNG)
237 WebRtc_Word32 SetAudioPacketSize(const WebRtc_UWord16 packetSizeSamples);
niklase@google.com470e71d2011-07-07 08:21:25 +0000238
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000239 // Set status and ID for header-extension-for-audio-level-indication.
240 WebRtc_Word32 SetAudioLevelIndicationStatus(const bool enable,
241 const WebRtc_UWord8 ID);
niklase@google.com470e71d2011-07-07 08:21:25 +0000242
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000243 // Get status and ID for header-extension-for-audio-level-indication.
244 WebRtc_Word32 AudioLevelIndicationStatus(bool& enable,
245 WebRtc_UWord8& ID) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000246
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000247 // Store the audio level in dBov for
248 // header-extension-for-audio-level-indication.
249 WebRtc_Word32 SetAudioLevel(const WebRtc_UWord8 level_dBov);
niklase@google.com470e71d2011-07-07 08:21:25 +0000250
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000251 // Set payload type for Redundant Audio Data RFC 2198
252 WebRtc_Word32 SetRED(const WebRtc_Word8 payloadType);
niklase@google.com470e71d2011-07-07 08:21:25 +0000253
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000254 // Get payload type for Redundant Audio Data RFC 2198
255 WebRtc_Word32 RED(WebRtc_Word8& payloadType) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000256
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000257 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000258 * Video
259 */
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000260 VideoCodecInformation* CodecInformationVideo();
niklase@google.com470e71d2011-07-07 08:21:25 +0000261
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000262 RtpVideoCodecTypes VideoCodecType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000263
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000264 WebRtc_UWord32 MaxConfiguredBitrateVideo() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000265
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000266 WebRtc_Word32 SendRTPIntraRequest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000267
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000268 // FEC
269 WebRtc_Word32 SetGenericFECStatus(const bool enable,
270 const WebRtc_UWord8 payloadTypeRED,
271 const WebRtc_UWord8 payloadTypeFEC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000272
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000273 WebRtc_Word32 GenericFECStatus(bool& enable,
274 WebRtc_UWord8& payloadTypeRED,
275 WebRtc_UWord8& payloadTypeFEC) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000276
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000277 WebRtc_Word32 SetFecParameters(
278 const FecProtectionParams* delta_params,
279 const FecProtectionParams* key_params);
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000281 protected:
282 WebRtc_Word32 CheckPayloadType(const WebRtc_Word8 payloadType,
283 RtpVideoCodecTypes& videoType);
niklase@google.com470e71d2011-07-07 08:21:25 +0000284
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000285 private:
286 void UpdateNACKBitRate(const WebRtc_UWord32 bytes,
287 const WebRtc_UWord32 now);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000288
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000289 WebRtc_Word32 SendPaddingAccordingToBitrate(
290 WebRtc_Word8 payload_type,
291 WebRtc_UWord32 capture_timestamp,
292 int64_t capture_time_ms);
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000293
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000294 WebRtc_Word32 _id;
295 const bool _audioConfigured;
296 RTPSenderAudio* _audio;
297 RTPSenderVideo* _video;
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000298
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000299 CriticalSectionWrapper* _sendCritsect;
niklase@google.com470e71d2011-07-07 08:21:25 +0000300
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000301 Transport* _transport;
302 bool _sendingMedia;
niklase@google.com470e71d2011-07-07 08:21:25 +0000303
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000304 WebRtc_UWord16 _maxPayloadLength;
305 WebRtc_UWord16 _targetSendBitrate;
306 WebRtc_UWord16 _packetOverHead;
niklase@google.com470e71d2011-07-07 08:21:25 +0000307
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000308 WebRtc_Word8 _payloadType;
309 std::map<WebRtc_Word8, ModuleRTPUtility::Payload*> _payloadTypeMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000310
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000311 RtpHeaderExtensionMap _rtpHeaderExtensionMap;
312 WebRtc_Word32 _transmissionTimeOffset;
niklase@google.com470e71d2011-07-07 08:21:25 +0000313
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000314 // NACK
315 WebRtc_UWord32 _nackByteCountTimes[NACK_BYTECOUNT_SIZE];
316 WebRtc_Word32 _nackByteCount[NACK_BYTECOUNT_SIZE];
317 Bitrate _nackBitrate;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000318
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000319 RTPPacketHistory* _packetHistory;
320 TransmissionBucket _sendBucket;
321 WebRtc_Word64 _timeLastSendToNetworkUpdate;
322 bool _transmissionSmoothing;
niklase@google.com470e71d2011-07-07 08:21:25 +0000323
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000324 // Statistics
325 WebRtc_UWord32 _packetsSent;
326 WebRtc_UWord32 _payloadBytesSent;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000327
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000328 // RTP variables
329 bool _startTimeStampForced;
330 WebRtc_UWord32 _startTimeStamp;
331 SSRCDatabase& _ssrcDB;
332 WebRtc_UWord32 _remoteSSRC;
333 bool _sequenceNumberForced;
334 WebRtc_UWord16 _sequenceNumber;
335 WebRtc_UWord16 _sequenceNumberRTX;
336 bool _ssrcForced;
337 WebRtc_UWord32 _ssrc;
338 WebRtc_UWord32 _timeStamp;
339 WebRtc_UWord8 _CSRCs;
340 WebRtc_UWord32 _CSRC[kRtpCsrcSize];
341 bool _includeCSRCs;
342 bool _RTX;
343 WebRtc_UWord32 _ssrcRTX;
niklase@google.com470e71d2011-07-07 08:21:25 +0000344};
345} // namespace webrtc
346
347#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_