blob: 33d91c7940715785754a734dd5aab7cb375a0008 [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
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000041 virtual WebRtc_UWord32 SSRC() const = 0;
42 virtual WebRtc_UWord32 Timestamp() const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000043
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000044 virtual WebRtc_Word32 BuildRTPheader(
45 WebRtc_UWord8 *data_buffer, const WebRtc_Word8 payload_type,
46 const bool marker_bit, const WebRtc_UWord32 capture_time_stamp,
47 const bool time_stamp_provided = true,
48 const bool inc_sequence_number = true) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000049
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000050 virtual WebRtc_UWord16 RTPHeaderLength() const = 0;
51 virtual WebRtc_UWord16 IncrementSequenceNumber() = 0;
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000052 virtual WebRtc_UWord16 SequenceNumber() const = 0;
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000053 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
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000058 virtual WebRtc_Word32 SendToNetwork(
59 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:
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000065 RTPSender(const WebRtc_Word32 id, const bool audio, Clock *clock,
66 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
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000072 WebRtc_UWord16 ActualSendBitrateKbit() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000073
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000074 WebRtc_UWord32 VideoBitrateSent() const;
75 WebRtc_UWord32 FecOverheadRate() const;
76 WebRtc_UWord32 NackOverheadRate() const;
stefan@webrtc.orgd0bdab02011-10-14 14:24:54 +000077
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000078 void SetTargetSendBitrate(const WebRtc_UWord32 bits);
niklase@google.com470e71d2011-07-07 08:21:25 +000079
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000080 WebRtc_UWord16 MaxDataPayloadLength() const; // with RTP and FEC headers.
niklase@google.com470e71d2011-07-07 08:21:25 +000081
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000082 WebRtc_Word32 RegisterPayload(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000083 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
84 const WebRtc_Word8 payload_type, const WebRtc_UWord32 frequency,
85 const WebRtc_UWord8 channels, const WebRtc_UWord32 rate);
niklase@google.com470e71d2011-07-07 08:21:25 +000086
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +000087 WebRtc_Word32 DeRegisterSendPayload(const WebRtc_Word8 payload_type);
niklase@google.com470e71d2011-07-07 08:21:25 +000088
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000089 WebRtc_Word8 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.
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +000099 WebRtc_UWord32 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.
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000102 WebRtc_UWord32 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
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000106 WebRtc_UWord32 StartTimestamp() const;
107 void SetStartTimestamp(WebRtc_UWord32 timestamp, bool force);
niklase@google.com470e71d2011-07-07 08:21:25 +0000108
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000109 WebRtc_UWord32 GenerateNewSSRC();
110 void SetSSRC(const WebRtc_UWord32 ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000111
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000112 WebRtc_UWord16 SequenceNumber() const;
113 void SetSequenceNumber(WebRtc_UWord16 seq);
niklase@google.com470e71d2011-07-07 08:21:25 +0000114
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000115 WebRtc_Word32 CSRCs(WebRtc_UWord32 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
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000119 void SetCSRCs(const WebRtc_UWord32 arr_of_csrc[kRtpCsrcSize],
120 const WebRtc_UWord8 arr_length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000121
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000122 WebRtc_Word32 SetMaxPayloadLength(const WebRtc_UWord16 length,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000123 const WebRtc_UWord16 packet_over_head);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000125 WebRtc_Word32 SendOutgoingData(
126 const FrameType frame_type, const WebRtc_Word8 payload_type,
127 const WebRtc_UWord32 time_stamp, int64_t capture_time_ms,
128 const WebRtc_UWord8 *payload_data, const WebRtc_UWord32 payload_size,
129 const RTPFragmentationHeader *fragmentation,
130 VideoCodecInformation *codec_info = NULL,
131 const RTPVideoTypeHeader * rtp_type_hdr = NULL);
niklase@google.com470e71d2011-07-07 08:21:25 +0000132
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000133 WebRtc_Word32 SendPadData(WebRtc_Word8 payload_type,
134 WebRtc_UWord32 capture_timestamp,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000135 int64_t capture_time_ms, WebRtc_Word32 bytes);
136 // RTP header extension
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000137 WebRtc_Word32 SetTransmissionTimeOffset(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000138 const WebRtc_Word32 transmission_time_offset);
niklase@google.com470e71d2011-07-07 08:21:25 +0000139
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000140 WebRtc_Word32 RegisterRtpHeaderExtension(const RTPExtensionType type,
141 const WebRtc_UWord8 id);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000142
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000143 WebRtc_Word32 DeregisterRtpHeaderExtension(const RTPExtensionType type);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000144
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000145 WebRtc_UWord16 RtpHeaderExtensionTotalLength() const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000146
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000147 WebRtc_UWord16 BuildRTPHeaderExtension(WebRtc_UWord8 *data_buffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000148
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000149 WebRtc_UWord8 BuildTransmissionTimeOffsetExtension(
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000150 WebRtc_UWord8 *data_buffer) const;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000151
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000152 bool UpdateTransmissionTimeOffset(WebRtc_UWord8 *rtp_packet,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000153 const WebRtc_UWord16 rtp_packet_length,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000154 const WebRtcRTPHeader &rtp_header,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000155 const WebRtc_Word64 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);
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000162 void OnReceivedNACK(const WebRtc_UWord16 nack_sequence_numbers_length,
163 const WebRtc_UWord16 *nack_sequence_numbers,
164 const WebRtc_UWord16 avg_rtt);
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000165
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000166 void SetStorePacketsStatus(const bool enable,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000167 const WebRtc_UWord16 number_to_store);
niklase@google.com470e71d2011-07-07 08:21:25 +0000168
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000169 bool StorePackets() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000170
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000171 WebRtc_Word32 ReSendPacket(WebRtc_UWord16 packet_id,
172 WebRtc_UWord32 min_resend_time = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000173
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000174 WebRtc_Word32 ReSendToNetwork(const WebRtc_UWord8 *packet,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000175 const WebRtc_UWord32 size);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000176
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000177 bool ProcessNACKBitRate(const WebRtc_UWord32 now);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000179 // RTX.
180 void SetRTXStatus(const bool enable, const bool set_ssrc,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000181 const WebRtc_UWord32 SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000182
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000183 void RTXStatus(bool *enable, WebRtc_UWord32 *SSRC) const;
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000184
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000185 // Functions wrapping RTPSenderInterface.
186 virtual WebRtc_Word32 BuildRTPheader(
187 WebRtc_UWord8 *data_buffer, const WebRtc_Word8 payload_type,
188 const bool marker_bit, const WebRtc_UWord32 capture_time_stamp,
189 const bool time_stamp_provided = true,
190 const bool inc_sequence_number = true);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000191
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000192 virtual WebRtc_UWord16 RTPHeaderLength() const;
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000193 virtual WebRtc_UWord16 IncrementSequenceNumber();
194 virtual WebRtc_UWord16 MaxPayloadLength() const;
195 virtual WebRtc_UWord16 PacketOverHead() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000196
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000197 // Current timestamp.
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000198 virtual WebRtc_UWord32 Timestamp() const;
199 virtual WebRtc_UWord32 SSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000200
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000201 virtual WebRtc_Word32 SendToNetwork(
202 uint8_t *data_buffer, int payload_length, int rtp_header_length,
203 int64_t capture_time_ms, StorageType storage);
204
205 // Audio.
206
207 // Send a DTMF tone using RFC 2833 (4733).
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000208 WebRtc_Word32 SendTelephoneEvent(const WebRtc_UWord8 key,
209 const WebRtc_UWord16 time_ms,
210 const WebRtc_UWord8 level);
niklase@google.com470e71d2011-07-07 08:21:25 +0000211
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000212 bool SendTelephoneEventActive(WebRtc_Word8 *telephone_event) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000213
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000214 // Set audio packet size, used to determine when it's time to send a DTMF
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000215 // packet in silence (CNG).
216 WebRtc_Word32 SetAudioPacketSize(const WebRtc_UWord16 packet_size_samples);
niklase@google.com470e71d2011-07-07 08:21:25 +0000217
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000218 // Set status and ID for header-extension-for-audio-level-indication.
219 WebRtc_Word32 SetAudioLevelIndicationStatus(const bool enable,
220 const WebRtc_UWord8 ID);
niklase@google.com470e71d2011-07-07 08:21:25 +0000221
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000222 // Get status and ID for header-extension-for-audio-level-indication.
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000223 WebRtc_Word32 AudioLevelIndicationStatus(bool *enable,
224 WebRtc_UWord8 *id) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000225
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000226 // Store the audio level in d_bov for
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000227 // header-extension-for-audio-level-indication.
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000228 WebRtc_Word32 SetAudioLevel(const WebRtc_UWord8 level_d_bov);
niklase@google.com470e71d2011-07-07 08:21:25 +0000229
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000230 // Set payload type for Redundant Audio Data RFC 2198.
231 WebRtc_Word32 SetRED(const WebRtc_Word8 payload_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000232
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000233 // Get payload type for Redundant Audio Data RFC 2198.
234 WebRtc_Word32 RED(WebRtc_Word8 *payload_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000235
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000236 // Video.
237 VideoCodecInformation *CodecInformationVideo();
niklase@google.com470e71d2011-07-07 08:21:25 +0000238
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000239 RtpVideoCodecTypes VideoCodecType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000240
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000241 WebRtc_UWord32 MaxConfiguredBitrateVideo() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000242
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000243 WebRtc_Word32 SendRTPIntraRequest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000244
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000245 // FEC.
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000246 WebRtc_Word32 SetGenericFECStatus(const bool enable,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000247 const WebRtc_UWord8 payload_type_red,
248 const WebRtc_UWord8 payload_type_fec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000249
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000250 WebRtc_Word32 GenericFECStatus(bool *enable, WebRtc_UWord8 *payload_type_red,
251 WebRtc_UWord8 *payload_type_fec) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000252
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000253 WebRtc_Word32 SetFecParameters(const FecProtectionParams *delta_params,
254 const FecProtectionParams *key_params);
niklase@google.com470e71d2011-07-07 08:21:25 +0000255
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000256 protected:
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000257 WebRtc_Word32 CheckPayloadType(const WebRtc_Word8 payload_type,
258 RtpVideoCodecTypes *video_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000259
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000260 private:
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000261 void UpdateNACKBitRate(const WebRtc_UWord32 bytes, const WebRtc_UWord32 now);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000262
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000263 WebRtc_Word32 SendPaddingAccordingToBitrate(WebRtc_Word8 payload_type,
264 WebRtc_UWord32 capture_timestamp,
265 int64_t capture_time_ms);
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000266
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000267 WebRtc_Word32 id_;
268 const bool audio_configured_;
269 RTPSenderAudio *audio_;
270 RTPSenderVideo *video_;
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000271
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000272 PacedSender *paced_sender_;
273 CriticalSectionWrapper *send_critsect_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000274
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000275 Transport *transport_;
276 bool sending_media_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000277
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000278 WebRtc_UWord16 max_payload_length_;
279 WebRtc_UWord16 target_send_bitrate_;
280 WebRtc_UWord16 packet_over_head_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000281
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000282 WebRtc_Word8 payload_type_;
283 std::map<WebRtc_Word8, ModuleRTPUtility::Payload *> payload_type_map_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000284
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000285 RtpHeaderExtensionMap rtp_header_extension_map_;
286 WebRtc_Word32 transmission_time_offset_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000287
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000288 // NACK
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000289 WebRtc_UWord32 nack_byte_count_times_[NACK_BYTECOUNT_SIZE];
290 WebRtc_Word32 nack_byte_count_[NACK_BYTECOUNT_SIZE];
291 Bitrate nack_bitrate_;
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000292
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000293 RTPPacketHistory *packet_history_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000294
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000295 // Statistics
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000296 WebRtc_UWord32 packets_sent_;
297 WebRtc_UWord32 payload_bytes_sent_;
asapersson@webrtc.org0b3c35a2012-01-16 11:06:31 +0000298
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000299 // RTP variables
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000300 bool start_time_stamp_forced_;
301 WebRtc_UWord32 start_time_stamp_;
302 SSRCDatabase &ssrc_db_;
303 WebRtc_UWord32 remote_ssrc_;
304 bool sequence_number_forced_;
305 WebRtc_UWord16 sequence_number_;
306 WebRtc_UWord16 sequence_number_rtx_;
307 bool ssrc_forced_;
308 WebRtc_UWord32 ssrc_;
309 WebRtc_UWord32 time_stamp_;
310 WebRtc_UWord8 csrcs_;
311 WebRtc_UWord32 csrc_[kRtpCsrcSize];
312 bool include_csrcs_;
313 bool rtx_;
314 WebRtc_UWord32 ssrc_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_