blob: dc8cf3ad1bb7cd1dae1c7e90faeabe286754e8b3 [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);
stefan@webrtc.orgbecf9c82013-02-01 15:09:57 +0000162 void OnReceivedNACK(const std::list<uint16_t>& nack_sequence_numbers,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000163 const WebRtc_UWord16 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,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000166 const WebRtc_UWord16 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
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000170 WebRtc_Word32 ReSendPacket(WebRtc_UWord16 packet_id,
171 WebRtc_UWord32 min_resend_time = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000172
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000173 WebRtc_Word32 ReSendToNetwork(const WebRtc_UWord8 *packet,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000174 const WebRtc_UWord32 size);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000175
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000176 bool ProcessNACKBitRate(const WebRtc_UWord32 now);
niklase@google.com470e71d2011-07-07 08:21:25 +0000177
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000178 // RTX.
179 void SetRTXStatus(const bool enable, const bool set_ssrc,
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000180 const WebRtc_UWord32 SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000181
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000182 void RTXStatus(bool *enable, WebRtc_UWord32 *SSRC) const;
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000183
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000184 // Functions wrapping RTPSenderInterface.
185 virtual WebRtc_Word32 BuildRTPheader(
186 WebRtc_UWord8 *data_buffer, const WebRtc_Word8 payload_type,
187 const bool marker_bit, const WebRtc_UWord32 capture_time_stamp,
188 const bool time_stamp_provided = true,
189 const bool inc_sequence_number = true);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000190
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000191 virtual WebRtc_UWord16 RTPHeaderLength() const;
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000192 virtual WebRtc_UWord16 IncrementSequenceNumber();
193 virtual WebRtc_UWord16 MaxPayloadLength() const;
194 virtual WebRtc_UWord16 PacketOverHead() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000195
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000196 // Current timestamp.
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000197 virtual WebRtc_UWord32 Timestamp() const;
198 virtual WebRtc_UWord32 SSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000199
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000200 virtual WebRtc_Word32 SendToNetwork(
201 uint8_t *data_buffer, int payload_length, int rtp_header_length,
202 int64_t capture_time_ms, StorageType storage);
203
204 // Audio.
205
206 // Send a DTMF tone using RFC 2833 (4733).
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000207 WebRtc_Word32 SendTelephoneEvent(const WebRtc_UWord8 key,
208 const WebRtc_UWord16 time_ms,
209 const WebRtc_UWord8 level);
niklase@google.com470e71d2011-07-07 08:21:25 +0000210
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000211 bool SendTelephoneEventActive(WebRtc_Word8 *telephone_event) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000212
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000213 // Set audio packet size, used to determine when it's time to send a DTMF
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000214 // packet in silence (CNG).
215 WebRtc_Word32 SetAudioPacketSize(const WebRtc_UWord16 packet_size_samples);
niklase@google.com470e71d2011-07-07 08:21:25 +0000216
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000217 // Set status and ID for header-extension-for-audio-level-indication.
218 WebRtc_Word32 SetAudioLevelIndicationStatus(const bool enable,
219 const WebRtc_UWord8 ID);
niklase@google.com470e71d2011-07-07 08:21:25 +0000220
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000221 // Get status and ID for header-extension-for-audio-level-indication.
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000222 WebRtc_Word32 AudioLevelIndicationStatus(bool *enable,
223 WebRtc_UWord8 *id) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000224
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000225 // Store the audio level in d_bov for
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000226 // header-extension-for-audio-level-indication.
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000227 WebRtc_Word32 SetAudioLevel(const WebRtc_UWord8 level_d_bov);
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000229 // Set payload type for Redundant Audio Data RFC 2198.
230 WebRtc_Word32 SetRED(const WebRtc_Word8 payload_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000231
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000232 // Get payload type for Redundant Audio Data RFC 2198.
233 WebRtc_Word32 RED(WebRtc_Word8 *payload_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000234
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000235 // Video.
236 VideoCodecInformation *CodecInformationVideo();
niklase@google.com470e71d2011-07-07 08:21:25 +0000237
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000238 RtpVideoCodecTypes VideoCodecType() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000239
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000240 WebRtc_UWord32 MaxConfiguredBitrateVideo() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000241
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000242 WebRtc_Word32 SendRTPIntraRequest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000243
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000244 // FEC.
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000245 WebRtc_Word32 SetGenericFECStatus(const bool enable,
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000246 const WebRtc_UWord8 payload_type_red,
247 const WebRtc_UWord8 payload_type_fec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000248
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000249 WebRtc_Word32 GenericFECStatus(bool *enable, WebRtc_UWord8 *payload_type_red,
250 WebRtc_UWord8 *payload_type_fec) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000251
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000252 WebRtc_Word32 SetFecParameters(const FecProtectionParams *delta_params,
253 const FecProtectionParams *key_params);
niklase@google.com470e71d2011-07-07 08:21:25 +0000254
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000255 protected:
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000256 WebRtc_Word32 CheckPayloadType(const WebRtc_Word8 payload_type,
257 RtpVideoCodecTypes *video_type);
niklase@google.com470e71d2011-07-07 08:21:25 +0000258
pwestin@webrtc.orgc66e8b32012-11-07 17:01:04 +0000259 private:
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000260 void UpdateNACKBitRate(const WebRtc_UWord32 bytes, const WebRtc_UWord32 now);
pwestin@webrtc.org8281e7d2012-01-10 14:09:18 +0000261
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000262 WebRtc_Word32 SendPaddingAccordingToBitrate(WebRtc_Word8 payload_type,
263 WebRtc_UWord32 capture_timestamp,
264 int64_t capture_time_ms);
phoglund@webrtc.orgbaaf2432012-05-31 10:47:35 +0000265
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000266 WebRtc_Word32 id_;
267 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
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000277 WebRtc_UWord16 max_payload_length_;
278 WebRtc_UWord16 target_send_bitrate_;
279 WebRtc_UWord16 packet_over_head_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000281 WebRtc_Word8 payload_type_;
282 std::map<WebRtc_Word8, 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_;
285 WebRtc_Word32 transmission_time_offset_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000286
pwestin@webrtc.org571a1c02012-11-13 21:12:39 +0000287 // NACK
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000288 WebRtc_UWord32 nack_byte_count_times_[NACK_BYTECOUNT_SIZE];
289 WebRtc_Word32 nack_byte_count_[NACK_BYTECOUNT_SIZE];
290 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
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000295 WebRtc_UWord32 packets_sent_;
296 WebRtc_UWord32 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_;
300 WebRtc_UWord32 start_time_stamp_;
301 SSRCDatabase &ssrc_db_;
302 WebRtc_UWord32 remote_ssrc_;
303 bool sequence_number_forced_;
304 WebRtc_UWord16 sequence_number_;
305 WebRtc_UWord16 sequence_number_rtx_;
306 bool ssrc_forced_;
307 WebRtc_UWord32 ssrc_;
308 WebRtc_UWord32 time_stamp_;
309 WebRtc_UWord8 csrcs_;
310 WebRtc_UWord32 csrc_[kRtpCsrcSize];
311 bool include_csrcs_;
312 bool rtx_;
313 WebRtc_UWord32 ssrc_rtx_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000314};
niklase@google.com470e71d2011-07-07 08:21:25 +0000315
phoglund@webrtc.org43da54a2013-01-25 10:53:38 +0000316} // namespace webrtc
317
318#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_