blob: 0f41632798149e3facbc461d04d99f025b811faa [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.org571a1c02012-11-13 21:12:39 +000018#include "webrtc/common_types.h"
19#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
phoglund@webrtc.orgc38eef82013-01-07 10:18:30 +000020#include "webrtc/modules/rtp_rtcp/source/bitrate.h"
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +000021#include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
22#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
23#include "webrtc/modules/rtp_rtcp/source/ssrc_database.h"
24#include "webrtc/modules/rtp_rtcp/source/video_codec_information.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000025
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000026#define MAX_INIT_RTP_SEQ_NUMBER 32767 // 2^15 -1.
niklase@google.com470e71d2011-07-07 08:21:25 +000027
28namespace webrtc {
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000029
niklase@google.com470e71d2011-07-07 08:21:25 +000030class CriticalSectionWrapper;
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +000031class PacedSender;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +000032class RTPPacketHistory;
niklase@google.com470e71d2011-07-07 08:21:25 +000033class RTPSenderAudio;
34class RTPSenderVideo;
35
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000036class RTPSenderInterface {
37 public:
38 RTPSenderInterface() {}
39 virtual ~RTPSenderInterface() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000040
pbos@webrtc.org2f446732013-04-08 11:08:41 +000041 virtual uint32_t SSRC() const = 0;
42 virtual uint32_t Timestamp() const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000043
pbos@webrtc.org2f446732013-04-08 11:08:41 +000044 virtual int32_t BuildRTPheader(
45 uint8_t *data_buffer, const int8_t payload_type,
46 const bool marker_bit, const uint32_t capture_time_stamp,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000047 const bool time_stamp_provided = true,
48 const bool inc_sequence_number = true) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000049
pbos@webrtc.org2f446732013-04-08 11:08:41 +000050 virtual uint16_t RTPHeaderLength() const = 0;
51 virtual uint16_t IncrementSequenceNumber() = 0;
52 virtual uint16_t SequenceNumber() const = 0;
53 virtual uint16_t MaxPayloadLength() const = 0;
54 virtual uint16_t MaxDataPayloadLength() const = 0;
55 virtual uint16_t PacketOverHead() const = 0;
56 virtual uint16_t ActualSendBitrateKbit() const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000057
pbos@webrtc.org2f446732013-04-08 11:08:41 +000058 virtual int32_t SendToNetwork(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000059 uint8_t *data_buffer, int payload_length, int rtp_header_length,
60 int64_t capture_time_ms, StorageType storage) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000061};
62
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000063class RTPSender : public Bitrate, public RTPSenderInterface {
64 public:
pbos@webrtc.org2f446732013-04-08 11:08:41 +000065 RTPSender(const int32_t id, const bool audio, Clock *clock,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000066 Transport *transport, RtpAudioFeedback *audio_feedback,
67 PacedSender *paced_sender);
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000068 virtual ~RTPSender();
niklase@google.com470e71d2011-07-07 08:21:25 +000069
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000070 void ProcessBitrate();
niklase@google.com470e71d2011-07-07 08:21:25 +000071
pbos@webrtc.org2f446732013-04-08 11:08:41 +000072 uint16_t ActualSendBitrateKbit() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000073
pbos@webrtc.org2f446732013-04-08 11:08:41 +000074 uint32_t VideoBitrateSent() const;
75 uint32_t FecOverheadRate() const;
76 uint32_t NackOverheadRate() const;
stefan@webrtc.orgd0bdab02011-10-14 14:24:54 +000077
pbos@webrtc.org2f446732013-04-08 11:08:41 +000078 void SetTargetSendBitrate(const uint32_t bits);
niklase@google.com470e71d2011-07-07 08:21:25 +000079
pbos@webrtc.org2f446732013-04-08 11:08:41 +000080 uint16_t MaxDataPayloadLength() const; // with RTP and FEC headers.
niklase@google.com470e71d2011-07-07 08:21:25 +000081
pbos@webrtc.org2f446732013-04-08 11:08:41 +000082 int32_t RegisterPayload(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000083 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
pbos@webrtc.org2f446732013-04-08 11:08:41 +000084 const int8_t payload_type, const uint32_t frequency,
85 const uint8_t channels, const uint32_t rate);
niklase@google.com470e71d2011-07-07 08:21:25 +000086
pbos@webrtc.org2f446732013-04-08 11:08:41 +000087 int32_t DeRegisterSendPayload(const int8_t payload_type);
niklase@google.com470e71d2011-07-07 08:21:25 +000088
pbos@webrtc.org2f446732013-04-08 11:08:41 +000089 int8_t SendPayloadType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000090
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000091 int SendPayloadFrequency() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000092
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000093 void SetSendingStatus(const bool enabled);
niklase@google.com470e71d2011-07-07 08:21:25 +000094
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000095 void SetSendingMediaStatus(const bool enabled);
96 bool SendingMedia() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000097
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000098 // Number of sent RTP packets.
pbos@webrtc.org2f446732013-04-08 11:08:41 +000099 uint32_t Packets() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000100
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000101 // Number of sent RTP bytes.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000102 uint32_t Bytes() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000104 void ResetDataCounters();
niklase@google.com470e71d2011-07-07 08:21:25 +0000105
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000106 uint32_t StartTimestamp() const;
107 void SetStartTimestamp(uint32_t timestamp, bool force);
niklase@google.com470e71d2011-07-07 08:21:25 +0000108
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000109 uint32_t GenerateNewSSRC();
110 void SetSSRC(const uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000111
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000112 uint16_t SequenceNumber() const;
113 void SetSequenceNumber(uint16_t seq);
niklase@google.com470e71d2011-07-07 08:21:25 +0000114
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000115 int32_t CSRCs(uint32_t arr_of_csrc[kRtpCsrcSize]) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000116
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000117 void SetCSRCStatus(const bool include);
niklase@google.com470e71d2011-07-07 08:21:25 +0000118
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000119 void SetCSRCs(const uint32_t arr_of_csrc[kRtpCsrcSize],
120 const uint8_t arr_length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000121
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000122 int32_t SetMaxPayloadLength(const uint16_t length,
123 const uint16_t packet_over_head);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000125 int32_t SendOutgoingData(
126 const FrameType frame_type, const int8_t payload_type,
127 const uint32_t time_stamp, int64_t capture_time_ms,
128 const uint8_t *payload_data, const uint32_t payload_size,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000129 const RTPFragmentationHeader *fragmentation,
130 VideoCodecInformation *codec_info = NULL,
131 const RTPVideoTypeHeader * rtp_type_hdr = NULL);
niklase@google.com470e71d2011-07-07 08:21:25 +0000132
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000133 int32_t SendPadData(int8_t payload_type,
134 uint32_t capture_timestamp,
135 int64_t capture_time_ms, int32_t bytes);
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000136 // RTP header extension
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000137 int32_t SetTransmissionTimeOffset(
138 const int32_t transmission_time_offset);
niklase@google.com470e71d2011-07-07 08:21:25 +0000139
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000140 int32_t RegisterRtpHeaderExtension(const RTPExtensionType type,
141 const uint8_t id);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000142
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000143 int32_t DeregisterRtpHeaderExtension(const RTPExtensionType type);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000144
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000145 uint16_t RtpHeaderExtensionTotalLength() const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000146
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000147 uint16_t BuildRTPHeaderExtension(uint8_t *data_buffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000148
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000149 uint8_t BuildTransmissionTimeOffsetExtension(
150 uint8_t *data_buffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000151
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000152 bool UpdateTransmissionTimeOffset(uint8_t *rtp_packet,
153 const uint16_t rtp_packet_length,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000154 const WebRtcRTPHeader &rtp_header,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000155 const int64_t time_diff_ms) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000156
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000157 void TimeToSendPacket(uint16_t sequence_number, int64_t capture_time_ms);
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000158
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000159 // NACK.
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000160 int SelectiveRetransmissions() const;
161 int SetSelectiveRetransmissions(uint8_t settings);
stefan@webrtc.orgbecf9c82013-02-01 15:09:57 +0000162 void OnReceivedNACK(const std::list<uint16_t>& nack_sequence_numbers,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000163 const uint16_t avg_rtt);
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000164
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000165 void SetStorePacketsStatus(const bool enable,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000166 const uint16_t number_to_store);
niklase@google.com470e71d2011-07-07 08:21:25 +0000167
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000168 bool StorePackets() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000169
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000170 int32_t ReSendPacket(uint16_t packet_id, uint32_t min_resend_time = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000171
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000172 int32_t ReSendToNetwork(const uint8_t *packet, const uint32_t size);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000173
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000174 bool ProcessNACKBitRate(const uint32_t now);
niklase@google.com470e71d2011-07-07 08:21:25 +0000175
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000176 // RTX.
mflodman@webrtc.org9f5ebb52013-04-12 14:55:46 +0000177 void SetRTXStatus(RtxMode mode, bool set_ssrc, uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
mflodman@webrtc.org9f5ebb52013-04-12 14:55:46 +0000179 void RTXStatus(RtxMode* mode, uint32_t* ssrc, int* payload_type) const;
180
181 void SetRtxPayloadType(int payloadType);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000182
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000183 // Functions wrapping RTPSenderInterface.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000184 virtual int32_t BuildRTPheader(
185 uint8_t *data_buffer, const int8_t payload_type,
186 const bool marker_bit, const uint32_t capture_time_stamp,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000187 const bool time_stamp_provided = true,
188 const bool inc_sequence_number = true);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000189
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000190 virtual uint16_t RTPHeaderLength() const;
191 virtual uint16_t IncrementSequenceNumber();
192 virtual uint16_t MaxPayloadLength() const;
193 virtual uint16_t PacketOverHead() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000194
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000195 // Current timestamp.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000196 virtual uint32_t Timestamp() const;
197 virtual uint32_t SSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000198
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000199 virtual int32_t SendToNetwork(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000200 uint8_t *data_buffer, int payload_length, int rtp_header_length,
201 int64_t capture_time_ms, StorageType storage);
202
203 // Audio.
204
205 // Send a DTMF tone using RFC 2833 (4733).
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000206 int32_t SendTelephoneEvent(const uint8_t key,
207 const uint16_t time_ms,
208 const uint8_t level);
niklase@google.com470e71d2011-07-07 08:21:25 +0000209
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000210 bool SendTelephoneEventActive(int8_t *telephone_event) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000211
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000212 // Set audio packet size, used to determine when it's time to send a DTMF
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000213 // packet in silence (CNG).
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000214 int32_t SetAudioPacketSize(const uint16_t packet_size_samples);
niklase@google.com470e71d2011-07-07 08:21:25 +0000215
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000216 // Set status and ID for header-extension-for-audio-level-indication.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000217 int32_t SetAudioLevelIndicationStatus(const bool enable, const uint8_t ID);
niklase@google.com470e71d2011-07-07 08:21:25 +0000218
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000219 // Get status and ID for header-extension-for-audio-level-indication.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000220 int32_t AudioLevelIndicationStatus(bool *enable, uint8_t *id) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000221
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000222 // Store the audio level in d_bov for
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000223 // header-extension-for-audio-level-indication.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000224 int32_t SetAudioLevel(const uint8_t level_d_bov);
niklase@google.com470e71d2011-07-07 08:21:25 +0000225
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000226 // Set payload type for Redundant Audio Data RFC 2198.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000227 int32_t SetRED(const int8_t payload_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000229 // Get payload type for Redundant Audio Data RFC 2198.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000230 int32_t RED(int8_t *payload_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000231
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000232 // Video.
233 VideoCodecInformation *CodecInformationVideo();
niklase@google.com470e71d2011-07-07 08:21:25 +0000234
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000235 RtpVideoCodecTypes VideoCodecType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000236
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000237 uint32_t MaxConfiguredBitrateVideo() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000238
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000239 int32_t SendRTPIntraRequest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000240
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000241 // FEC.
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000242 int32_t SetGenericFECStatus(const bool enable,
243 const uint8_t payload_type_red,
244 const uint8_t payload_type_fec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000245
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000246 int32_t GenericFECStatus(bool *enable, uint8_t *payload_type_red,
247 uint8_t *payload_type_fec) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000248
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000249 int32_t SetFecParameters(const FecProtectionParams *delta_params,
250 const FecProtectionParams *key_params);
niklase@google.com470e71d2011-07-07 08:21:25 +0000251
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000252 protected:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000253 int32_t CheckPayloadType(const int8_t payload_type,
254 RtpVideoCodecTypes *video_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000255
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000256 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000257 void UpdateNACKBitRate(const uint32_t bytes, const uint32_t now);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000258
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000259 int32_t SendPaddingAccordingToBitrate(int8_t payload_type,
260 uint32_t capture_timestamp,
261 int64_t capture_time_ms);
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000262
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000263 void BuildRtxPacket(uint8_t* buffer, uint16_t* length,
264 uint8_t* buffer_rtx);
mikhal@webrtc.orgbda7f302013-03-15 23:21:52 +0000265
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000266 int32_t id_;
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000267 const bool audio_configured_;
268 RTPSenderAudio *audio_;
269 RTPSenderVideo *video_;
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000270
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000271 PacedSender *paced_sender_;
272 CriticalSectionWrapper *send_critsect_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000273
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000274 Transport *transport_;
275 bool sending_media_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000276
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000277 uint16_t max_payload_length_;
278 uint16_t target_send_bitrate_;
279 uint16_t packet_over_head_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000281 int8_t payload_type_;
282 std::map<int8_t, ModuleRTPUtility::Payload *> payload_type_map_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000283
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000284 RtpHeaderExtensionMap rtp_header_extension_map_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000285 int32_t transmission_time_offset_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000286
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000287 // NACK
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000288 uint32_t nack_byte_count_times_[NACK_BYTECOUNT_SIZE];
289 int32_t nack_byte_count_[NACK_BYTECOUNT_SIZE];
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000290 Bitrate nack_bitrate_;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000291
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000292 RTPPacketHistory *packet_history_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000293
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000294 // Statistics
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000295 uint32_t packets_sent_;
296 uint32_t payload_bytes_sent_;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000297
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000298 // RTP variables
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000299 bool start_time_stamp_forced_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000300 uint32_t start_time_stamp_;
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000301 SSRCDatabase &ssrc_db_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000302 uint32_t remote_ssrc_;
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000303 bool sequence_number_forced_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000304 uint16_t sequence_number_;
305 uint16_t sequence_number_rtx_;
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000306 bool ssrc_forced_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000307 uint32_t ssrc_;
308 uint32_t time_stamp_;
309 uint8_t csrcs_;
310 uint32_t csrc_[kRtpCsrcSize];
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000311 bool include_csrcs_;
mikhal@webrtc.orgbda7f302013-03-15 23:21:52 +0000312 RtxMode rtx_;
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000313 uint32_t ssrc_rtx_;
mflodman@webrtc.org9f5ebb52013-04-12 14:55:46 +0000314 int payload_type_rtx_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000315};
niklase@google.com470e71d2011-07-07 08:21:25 +0000316
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000317} // namespace webrtc
318
319#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_