2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-01-24 17:16:59 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|
|
|
|
|
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|
2013-08-05 16:22:53 +00:00
|
|
|
|
2012-01-19 15:56:10 +00:00
|
|
|
#include <map>
|
2016-04-27 01:19:58 -07:00
|
|
|
#include <memory>
|
2015-12-10 05:05:27 -08:00
|
|
|
#include <utility>
|
|
|
|
|
#include <vector>
|
2012-01-19 15:56:10 +00:00
|
|
|
|
2016-11-28 07:02:13 -08:00
|
|
|
#include "webrtc/api/call/transport.h"
|
2016-04-26 08:14:39 -07:00
|
|
|
#include "webrtc/base/constructormagic.h"
|
2016-02-02 08:31:45 -08:00
|
|
|
#include "webrtc/base/criticalsection.h"
|
2016-09-19 05:37:56 -07:00
|
|
|
#include "webrtc/base/deprecation.h"
|
2016-11-14 05:14:50 -08:00
|
|
|
#include "webrtc/base/optional.h"
|
2015-12-15 00:30:07 -08:00
|
|
|
#include "webrtc/base/random.h"
|
2016-07-13 09:11:28 -07:00
|
|
|
#include "webrtc/base/rate_statistics.h"
|
2014-09-24 06:05:00 +00:00
|
|
|
#include "webrtc/base/thread_annotations.h"
|
2012-11-13 21:12:39 +00:00
|
|
|
#include "webrtc/common_types.h"
|
2016-11-10 05:04:48 -08:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
2016-06-08 00:24:21 -07:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h"
|
2012-11-13 21:12:39 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
|
2013-12-04 10:24:26 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h"
|
2012-11-13 21:12:39 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
2015-04-14 21:28:08 +02:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
2012-11-13 21:12:39 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/ssrc_database.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2013-01-25 10:53:38 +00:00
|
|
|
|
2016-11-17 01:38:43 -08:00
|
|
|
class OverheadObserver;
|
2016-07-13 09:11:28 -07:00
|
|
|
class RateLimiter;
|
2016-08-03 18:27:40 +02:00
|
|
|
class RtcEventLog;
|
|
|
|
|
class RtpPacketToSend;
|
2011-07-07 08:21:25 +00:00
|
|
|
class RTPSenderAudio;
|
|
|
|
|
class RTPSenderVideo;
|
|
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
class RTPSender {
|
2012-11-07 17:01:04 +00:00
|
|
|
public:
|
2015-09-17 23:03:57 +02:00
|
|
|
RTPSender(bool audio,
|
2014-12-19 13:49:55 +00:00
|
|
|
Clock* clock,
|
|
|
|
|
Transport* transport,
|
2015-09-21 15:11:14 -07:00
|
|
|
RtpPacketSender* paced_sender,
|
2016-11-10 05:04:48 -08:00
|
|
|
// TODO(brandtr): Remove |flexfec_sender| when that is hooked up
|
|
|
|
|
// to PacedSender instead.
|
|
|
|
|
FlexfecSender* flexfec_sender,
|
2015-09-21 15:11:14 -07:00
|
|
|
TransportSequenceNumberAllocator* sequence_number_allocator,
|
2015-09-14 06:42:43 -07:00
|
|
|
TransportFeedbackObserver* transport_feedback_callback,
|
2014-07-10 09:39:23 +00:00
|
|
|
BitrateStatisticsObserver* bitrate_callback,
|
2014-07-11 13:44:02 +00:00
|
|
|
FrameCountObserver* frame_count_observer,
|
2016-01-21 05:42:04 -08:00
|
|
|
SendSideDelayObserver* send_side_delay_observer,
|
2016-05-02 23:44:01 -07:00
|
|
|
RtcEventLog* event_log,
|
2016-07-13 09:11:28 -07:00
|
|
|
SendPacketObserver* send_packet_observer,
|
2016-11-17 01:38:43 -08:00
|
|
|
RateLimiter* nack_rate_limiter,
|
|
|
|
|
OverheadObserver* overhead_observer);
|
2016-05-02 23:44:01 -07:00
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
~RTPSender();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
void ProcessBitrate();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
uint16_t ActualSendBitrateKbit() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t VideoBitrateSent() const;
|
|
|
|
|
uint32_t FecOverheadRate() const;
|
|
|
|
|
uint32_t NackOverheadRate() const;
|
2011-10-14 14:24:54 +00:00
|
|
|
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
// Includes size of RTP and FEC headers.
|
2016-08-09 07:43:25 -07:00
|
|
|
size_t MaxDataPayloadLength() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-02-26 16:31:37 +01:00
|
|
|
int32_t RegisterPayload(const char* payload_name,
|
|
|
|
|
const int8_t payload_type,
|
|
|
|
|
const uint32_t frequency,
|
|
|
|
|
const size_t channels,
|
|
|
|
|
const uint32_t rate);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
int32_t DeRegisterSendPayload(const int8_t payload_type);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-08-27 09:39:43 +00:00
|
|
|
void SetSendPayloadType(int8_t payload_type);
|
|
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
int8_t SendPayloadType() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-09-09 16:02:19 +00:00
|
|
|
void SetSendingStatus(bool enabled);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
void SetSendingMediaStatus(bool enabled);
|
2012-11-07 17:01:04 +00:00
|
|
|
bool SendingMedia() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-07-15 15:25:39 +00:00
|
|
|
void GetDataCounters(StreamDataCounters* rtp_stats,
|
|
|
|
|
StreamDataCounters* rtx_stats) const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-08-18 02:01:49 -07:00
|
|
|
uint32_t TimestampOffset() const;
|
|
|
|
|
void SetTimestampOffset(uint32_t timestamp);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t GenerateNewSSRC();
|
2014-12-19 13:49:55 +00:00
|
|
|
void SetSSRC(uint32_t ssrc);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
uint16_t SequenceNumber() const;
|
2013-04-08 11:08:41 +00:00
|
|
|
void SetSequenceNumber(uint16_t seq);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-11-24 08:25:50 +00:00
|
|
|
void SetCsrcs(const std::vector<uint32_t>& csrcs);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-03-30 11:11:51 -07:00
|
|
|
void SetMaxPayloadLength(size_t max_payload_length);
|
2013-01-25 10:53:38 +00:00
|
|
|
|
2016-08-02 17:46:41 -07:00
|
|
|
bool SendOutgoingData(FrameType frame_type,
|
|
|
|
|
int8_t payload_type,
|
|
|
|
|
uint32_t timestamp,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
const uint8_t* payload_data,
|
|
|
|
|
size_t payload_size,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation,
|
|
|
|
|
const RTPVideoHeader* rtp_header,
|
|
|
|
|
uint32_t* transport_frame_id_out);
|
2012-01-10 14:09:18 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// RTP header extension
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
|
2016-08-09 07:43:25 -07:00
|
|
|
bool IsRtpHeaderExtensionRegistered(RTPExtensionType type);
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2016-11-14 05:14:50 -08:00
|
|
|
bool TimeToSendPacket(uint32_t ssrc,
|
|
|
|
|
uint16_t sequence_number,
|
2016-06-01 06:31:17 -07:00
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
bool retransmission,
|
|
|
|
|
int probe_cluster_id);
|
|
|
|
|
size_t TimeToSendPadding(size_t bytes, int probe_cluster_id);
|
2012-01-16 11:06:31 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// NACK.
|
2012-11-13 21:12:39 +00:00
|
|
|
int SelectiveRetransmissions() const;
|
|
|
|
|
int SetSelectiveRetransmissions(uint8_t settings);
|
2016-08-26 18:48:46 +02:00
|
|
|
void OnReceivedNack(const std::vector<uint16_t>& nack_sequence_numbers,
|
2015-01-12 21:51:21 +00:00
|
|
|
int64_t avg_rtt);
|
2012-01-16 11:06:31 +00:00
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
void SetStorePacketsStatus(bool enable, uint16_t number_to_store);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-13 21:12:39 +00:00
|
|
|
bool StorePackets() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-01-12 21:51:21 +00:00
|
|
|
int32_t ReSendPacket(uint16_t packet_id, int64_t min_resend_time = 0);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-06-08 00:24:21 -07:00
|
|
|
// Feedback to decide when to stop sending playout delay.
|
|
|
|
|
void OnReceivedRtcpReportBlocks(const ReportBlockList& report_blocks);
|
|
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// RTX.
|
2015-01-13 14:15:15 +00:00
|
|
|
void SetRtxStatus(int mode);
|
|
|
|
|
int RtxStatus() const;
|
2013-04-12 14:55:46 +00:00
|
|
|
|
2014-07-07 13:06:48 +00:00
|
|
|
uint32_t RtxSsrc() const;
|
2014-06-05 08:25:29 +00:00
|
|
|
void SetRtxSsrc(uint32_t ssrc);
|
|
|
|
|
|
2015-04-21 20:24:50 +08:00
|
|
|
void SetRtxPayloadType(int payload_type, int associated_payload_type);
|
2012-01-10 14:09:18 +00:00
|
|
|
|
2016-09-02 19:15:59 +02:00
|
|
|
// Create empty packet, fills ssrc, csrcs and reserve place for header
|
|
|
|
|
// extensions RtpSender updates before sending.
|
|
|
|
|
std::unique_ptr<RtpPacketToSend> AllocatePacket() const;
|
|
|
|
|
// Allocate sequence number for provided packet.
|
|
|
|
|
// Save packet's fields to generate padding that doesn't break media stream.
|
|
|
|
|
// Return false if sending was turned off.
|
|
|
|
|
bool AssignSequenceNumber(RtpPacketToSend* packet);
|
|
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
size_t RtpHeaderLength() const;
|
|
|
|
|
uint16_t AllocateSequenceNumber(uint16_t packets_to_send);
|
|
|
|
|
size_t MaxPayloadLength() const;
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2016-08-09 07:43:25 -07:00
|
|
|
uint32_t SSRC() const;
|
2015-03-04 12:58:35 +00:00
|
|
|
|
2016-11-14 05:14:50 -08:00
|
|
|
rtc::Optional<uint32_t> FlexfecSsrc() const;
|
|
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet,
|
|
|
|
|
StorageType storage,
|
|
|
|
|
RtpPacketSender::Priority priority);
|
2013-01-25 10:53:38 +00:00
|
|
|
|
|
|
|
|
// Audio.
|
|
|
|
|
|
|
|
|
|
// Send a DTMF tone using RFC 2833 (4733).
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t SendTelephoneEvent(uint8_t key, uint16_t time_ms, uint8_t level);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2016-12-02 02:40:02 -08:00
|
|
|
// This function is deprecated. It was previously used to determine when it
|
|
|
|
|
// was time to send a DTMF packet in silence (CNG).
|
|
|
|
|
RTC_DEPRECATED int32_t SetAudioPacketSize(uint16_t packet_size_samples);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// Store the audio level in d_bov for
|
2012-11-13 21:12:39 +00:00
|
|
|
// header-extension-for-audio-level-indication.
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t SetAudioLevel(uint8_t level_d_bov);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-13 21:12:39 +00:00
|
|
|
RtpVideoCodecTypes VideoCodecType() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t MaxConfiguredBitrateVideo() const;
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2016-11-07 03:05:06 -08:00
|
|
|
// ULPFEC.
|
|
|
|
|
void SetUlpfecConfig(int red_payload_type, int ulpfec_payload_type);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2016-11-07 03:36:05 -08:00
|
|
|
bool SetFecParameters(const FecProtectionParams& delta_params,
|
|
|
|
|
const FecProtectionParams& key_params);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2013-12-05 14:29:02 +00:00
|
|
|
// Called on update of RTP statistics.
|
|
|
|
|
void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback);
|
|
|
|
|
StreamDataCountersCallback* GetRtpStatisticsCallback() const;
|
|
|
|
|
|
2013-12-13 09:46:59 +00:00
|
|
|
uint32_t BitrateSent() const;
|
|
|
|
|
|
2014-07-07 13:06:48 +00:00
|
|
|
void SetRtpState(const RtpState& rtp_state);
|
|
|
|
|
RtpState GetRtpState() const;
|
|
|
|
|
void SetRtxRtpState(const RtpState& rtp_state);
|
|
|
|
|
RtpState GetRtxRtpState() const;
|
|
|
|
|
|
2016-11-17 01:38:43 -08:00
|
|
|
void SetTransportOverhead(int transport_overhead);
|
|
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
protected:
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
|
|
|
|
private:
|
2013-12-05 14:05:07 +00:00
|
|
|
// Maps capture time in milliseconds to send-side delay in milliseconds.
|
|
|
|
|
// Send-side delay is the difference between transmission time and capture
|
|
|
|
|
// time.
|
|
|
|
|
typedef std::map<int64_t, int> SendDelayMap;
|
|
|
|
|
|
2016-09-19 05:37:56 -07:00
|
|
|
size_t SendPadData(size_t bytes, int probe_cluster_id);
|
|
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
bool PrepareAndSendPacket(std::unique_ptr<RtpPacketToSend> packet,
|
2014-03-19 18:14:52 +00:00
|
|
|
bool send_over_rtx,
|
2016-06-01 06:31:17 -07:00
|
|
|
bool is_retransmit,
|
|
|
|
|
int probe_cluster_id);
|
2013-12-04 10:24:26 +00:00
|
|
|
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
// Return the number of bytes sent. Note that both of these functions may
|
|
|
|
|
// return a larger value that their argument.
|
2016-06-01 06:31:17 -07:00
|
|
|
size_t TrySendRedundantPayloads(size_t bytes, int probe_cluster_id);
|
2013-12-04 10:24:26 +00:00
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
std::unique_ptr<RtpPacketToSend> BuildRtxPacket(
|
|
|
|
|
const RtpPacketToSend& packet);
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
bool SendPacketToNetwork(const RtpPacketToSend& packet,
|
2015-10-02 03:39:33 -07:00
|
|
|
const PacketOptions& options);
|
2013-04-27 00:41:08 +00:00
|
|
|
|
2013-12-05 14:05:07 +00:00
|
|
|
void UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms);
|
2016-05-02 23:44:01 -07:00
|
|
|
void UpdateOnSendPacket(int packet_id,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
uint32_t ssrc);
|
2013-12-05 14:05:07 +00:00
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
bool UpdateTransportSequenceNumber(RtpPacketToSend* packet,
|
|
|
|
|
int* packet_id) const;
|
2016-05-02 23:44:01 -07:00
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
void UpdateRtpStats(const RtpPacketToSend& packet,
|
2013-12-05 14:29:02 +00:00
|
|
|
bool is_rtx,
|
|
|
|
|
bool is_retransmit);
|
2016-08-03 18:27:40 +02:00
|
|
|
bool IsFecPacket(const RtpPacketToSend& packet) const;
|
2013-12-05 14:29:02 +00:00
|
|
|
|
2016-11-17 01:38:43 -08:00
|
|
|
void AddPacketToTransportFeedback(uint16_t packet_id,
|
|
|
|
|
const RtpPacketToSend& packet,
|
|
|
|
|
int probe_cluster_id);
|
|
|
|
|
|
|
|
|
|
void UpdateRtpOverhead(const RtpPacketToSend& packet);
|
|
|
|
|
|
2016-02-02 08:31:45 -08:00
|
|
|
Clock* const clock_;
|
|
|
|
|
const int64_t clock_delta_ms_;
|
2015-12-15 00:30:07 -08:00
|
|
|
Random random_ GUARDED_BY(send_critsect_);
|
2014-11-05 14:05:29 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
const bool audio_configured_;
|
2016-04-27 01:19:58 -07:00
|
|
|
const std::unique_ptr<RTPSenderAudio> audio_;
|
|
|
|
|
const std::unique_ptr<RTPSenderVideo> video_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2015-09-21 15:11:14 -07:00
|
|
|
RtpPacketSender* const paced_sender_;
|
|
|
|
|
TransportSequenceNumberAllocator* const transport_sequence_number_allocator_;
|
2015-09-14 06:42:43 -07:00
|
|
|
TransportFeedbackObserver* const transport_feedback_observer_;
|
2014-11-04 16:27:16 +00:00
|
|
|
int64_t last_capture_time_ms_sent_;
|
2016-02-02 08:31:45 -08:00
|
|
|
rtc::CriticalSection send_critsect_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2016-11-07 02:08:51 -08:00
|
|
|
Transport* transport_;
|
2014-03-13 15:12:37 +00:00
|
|
|
bool sending_media_ GUARDED_BY(send_critsect_);
|
2012-11-13 21:12:39 +00:00
|
|
|
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t max_payload_length_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2014-03-25 16:51:35 +00:00
|
|
|
int8_t payload_type_ GUARDED_BY(send_critsect_);
|
2014-07-08 12:10:51 +00:00
|
|
|
std::map<int8_t, RtpUtility::Payload*> payload_type_map_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2016-07-28 07:56:38 -07:00
|
|
|
RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(send_critsect_);
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2016-06-08 00:24:21 -07:00
|
|
|
// Tracks the current request for playout delay limits from application
|
|
|
|
|
// and decides whether the current RTP frame should include the playout
|
|
|
|
|
// delay extension on header.
|
|
|
|
|
PlayoutDelayOracle playout_delay_oracle_;
|
|
|
|
|
|
2016-08-03 18:27:40 +02:00
|
|
|
RtpPacketHistory packet_history_;
|
2016-11-14 05:14:50 -08:00
|
|
|
// TODO(brandtr): Remove |flexfec_packet_history_| when the FlexfecSender
|
|
|
|
|
// is hooked up to the PacedSender.
|
|
|
|
|
RtpPacketHistory flexfec_packet_history_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
|
|
|
|
// Statistics
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CriticalSection statistics_crit_;
|
2014-07-07 13:06:48 +00:00
|
|
|
SendDelayMap send_delays_ GUARDED_BY(statistics_crit_);
|
2014-12-18 13:50:16 +00:00
|
|
|
FrameCounts frame_counts_ GUARDED_BY(statistics_crit_);
|
2014-07-07 13:06:48 +00:00
|
|
|
StreamDataCounters rtp_stats_ GUARDED_BY(statistics_crit_);
|
|
|
|
|
StreamDataCounters rtx_rtp_stats_ GUARDED_BY(statistics_crit_);
|
|
|
|
|
StreamDataCountersCallback* rtp_stats_callback_ GUARDED_BY(statistics_crit_);
|
2016-07-13 09:11:28 -07:00
|
|
|
RateStatistics total_bitrate_sent_ GUARDED_BY(statistics_crit_);
|
|
|
|
|
RateStatistics nack_bitrate_sent_ GUARDED_BY(statistics_crit_);
|
2014-07-10 09:39:23 +00:00
|
|
|
FrameCountObserver* const frame_count_observer_;
|
2014-07-11 13:44:02 +00:00
|
|
|
SendSideDelayObserver* const send_side_delay_observer_;
|
2016-01-21 05:42:04 -08:00
|
|
|
RtcEventLog* const event_log_;
|
2016-05-02 23:44:01 -07:00
|
|
|
SendPacketObserver* const send_packet_observer_;
|
2016-07-13 09:11:28 -07:00
|
|
|
BitrateStatisticsObserver* const bitrate_callback_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
|
|
|
|
// RTP variables
|
2016-08-18 02:01:49 -07:00
|
|
|
uint32_t timestamp_offset_ GUARDED_BY(send_critsect_);
|
2016-02-02 08:31:45 -08:00
|
|
|
SSRCDatabase* const ssrc_db_;
|
2014-07-07 13:06:48 +00:00
|
|
|
uint32_t remote_ssrc_ GUARDED_BY(send_critsect_);
|
|
|
|
|
bool sequence_number_forced_ GUARDED_BY(send_critsect_);
|
|
|
|
|
uint16_t sequence_number_ GUARDED_BY(send_critsect_);
|
|
|
|
|
uint16_t sequence_number_rtx_ GUARDED_BY(send_critsect_);
|
|
|
|
|
bool ssrc_forced_ GUARDED_BY(send_critsect_);
|
|
|
|
|
uint32_t ssrc_ GUARDED_BY(send_critsect_);
|
2016-08-22 03:39:23 -07:00
|
|
|
uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_);
|
2014-07-07 13:06:48 +00:00
|
|
|
int64_t capture_time_ms_ GUARDED_BY(send_critsect_);
|
|
|
|
|
int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_);
|
2014-07-17 16:10:14 +00:00
|
|
|
bool media_has_been_sent_ GUARDED_BY(send_critsect_);
|
2014-07-07 13:06:48 +00:00
|
|
|
bool last_packet_marker_bit_ GUARDED_BY(send_critsect_);
|
2014-11-24 08:25:50 +00:00
|
|
|
std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_);
|
2014-07-07 13:06:48 +00:00
|
|
|
int rtx_ GUARDED_BY(send_critsect_);
|
|
|
|
|
uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_);
|
2015-04-21 20:24:50 +08:00
|
|
|
// Mapping rtx_payload_type_map_[associated] = rtx.
|
|
|
|
|
std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_);
|
2016-11-17 01:38:43 -08:00
|
|
|
size_t transport_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_);
|
|
|
|
|
size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_);
|
2014-03-26 14:27:34 +00:00
|
|
|
|
2016-07-13 09:11:28 -07:00
|
|
|
RateLimiter* const retransmission_rate_limiter_;
|
2016-11-17 01:38:43 -08:00
|
|
|
OverheadObserver* overhead_observer_;
|
2016-01-21 05:42:04 -08:00
|
|
|
|
|
|
|
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|