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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|
|
|
|
|
#define 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>
|
2018-03-22 15:17:27 -07:00
|
|
|
#include <string>
|
2015-12-10 05:05:27 -08:00
|
|
|
#include <utility>
|
|
|
|
|
#include <vector>
|
2012-01-19 15:56:10 +00:00
|
|
|
|
2018-06-14 12:59:38 +02:00
|
|
|
#include "absl/types/optional.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/array_view.h"
|
|
|
|
|
#include "api/call/transport.h"
|
2018-08-23 17:07:29 +02:00
|
|
|
#include "api/video/video_content_type.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "common_types.h" // NOLINT(build/include)
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/include/flexfec_sender.h"
|
|
|
|
|
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
|
|
|
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/playout_delay_oracle.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/rtp_packet_history.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/rtp_utility.h"
|
|
|
|
|
#include "rtc_base/constructormagic.h"
|
|
|
|
|
#include "rtc_base/criticalsection.h"
|
|
|
|
|
#include "rtc_base/deprecation.h"
|
|
|
|
|
#include "rtc_base/random.h"
|
|
|
|
|
#include "rtc_base/rate_statistics.h"
|
|
|
|
|
#include "rtc_base/thread_annotations.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,
|
2018-02-07 14:37:37 +01:00
|
|
|
OverheadObserver* overhead_observer,
|
|
|
|
|
bool populate_network2_timestamp);
|
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
|
|
|
|
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-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
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
void SetSSRC(uint32_t ssrc);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-03-22 15:17:27 -07:00
|
|
|
void SetMid(const std::string& mid);
|
|
|
|
|
|
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
|
|
|
|
2017-01-10 08:58:32 -08:00
|
|
|
void SetMaxRtpPacketSize(size_t max_packet_size);
|
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,
|
2017-09-04 07:23:56 -07:00
|
|
|
uint32_t* transport_frame_id_out,
|
|
|
|
|
int64_t expected_retransmission_time_ms);
|
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);
|
2017-02-03 08:13:57 -08:00
|
|
|
bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) const;
|
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,
|
2017-02-23 02:56:13 -08:00
|
|
|
const PacedPacketInfo& pacing_info);
|
|
|
|
|
size_t TimeToSendPadding(size_t bytes, const PacedPacketInfo& pacing_info);
|
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
|
|
|
|
2018-03-14 12:39:24 +01:00
|
|
|
int32_t ReSendPacket(uint16_t packet_id);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-03-22 15:17:27 -07:00
|
|
|
// Feedback to decide when to stop sending the playout delay and MID header
|
|
|
|
|
// extensions.
|
2016-06-08 00:24:21 -07:00
|
|
|
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
|
|
|
|
2017-05-17 05:08:38 -07:00
|
|
|
// Size info for header extensions used by FEC packets.
|
|
|
|
|
static rtc::ArrayView<const RtpExtensionSize> FecExtensionSizes();
|
|
|
|
|
|
2018-03-15 15:46:17 +01:00
|
|
|
// Size info for header extensions used by video packets.
|
|
|
|
|
static rtc::ArrayView<const RtpExtensionSize> VideoExtensionSizes();
|
|
|
|
|
|
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);
|
|
|
|
|
|
2017-05-17 05:08:38 -07:00
|
|
|
// Used for padding and FEC packets only.
|
2016-08-09 07:43:25 -07:00
|
|
|
size_t RtpHeaderLength() const;
|
|
|
|
|
uint16_t AllocateSequenceNumber(uint16_t packets_to_send);
|
2017-01-10 08:58:32 -08:00
|
|
|
// Including RTP headers.
|
|
|
|
|
size_t MaxRtpPacketSize() 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
|
|
|
|
2018-06-14 12:59:38 +02:00
|
|
|
absl::optional<uint32_t> FlexfecSsrc() const;
|
2016-11-14 05:14:50 -08:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
|
|
2017-07-06 04:38:06 -07:00
|
|
|
int64_t LastTimestampTimeMs() const;
|
|
|
|
|
void SendKeepAlive(uint8_t payload_type);
|
|
|
|
|
|
2018-01-18 11:58:05 -08:00
|
|
|
void SetRtt(int64_t rtt_ms);
|
|
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
protected:
|
2018-06-04 11:14:38 +02:00
|
|
|
int32_t CheckPayloadType(int8_t payload_type, VideoCodecType* 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;
|
|
|
|
|
|
2017-02-23 02:56:13 -08:00
|
|
|
size_t SendPadData(size_t bytes, const PacedPacketInfo& pacing_info);
|
2016-09-19 05:37:56 -07:00
|
|
|
|
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,
|
2017-02-23 02:56:13 -08:00
|
|
|
const PacedPacketInfo& pacing_info);
|
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.
|
2017-02-23 02:56:13 -08:00
|
|
|
size_t TrySendRedundantPayloads(size_t bytes,
|
|
|
|
|
const PacedPacketInfo& pacing_info);
|
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,
|
2017-02-27 02:18:46 -08:00
|
|
|
const PacketOptions& options,
|
|
|
|
|
const PacedPacketInfo& pacing_info);
|
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,
|
2017-02-23 02:56:13 -08:00
|
|
|
const PacedPacketInfo& pacing_info);
|
2016-11-17 01:38:43 -08:00
|
|
|
|
|
|
|
|
void UpdateRtpOverhead(const RtpPacketToSend& packet);
|
|
|
|
|
|
2016-02-02 08:31:45 -08:00
|
|
|
Clock* const clock_;
|
|
|
|
|
const int64_t clock_delta_ms_;
|
2017-09-07 07:53:45 -07:00
|
|
|
Random random_ RTC_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_;
|
2017-09-07 07:53:45 -07:00
|
|
|
bool sending_media_ RTC_GUARDED_BY(send_critsect_);
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2017-01-10 08:58:32 -08:00
|
|
|
size_t max_packet_size_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2018-03-22 10:13:07 +01:00
|
|
|
int8_t last_payload_type_ RTC_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
|
|
|
|
2017-09-07 07:53:45 -07:00
|
|
|
RtpHeaderExtensionMap rtp_header_extension_map_
|
|
|
|
|
RTC_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_;
|
2017-09-07 07:53:45 -07:00
|
|
|
SendDelayMap send_delays_ RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
FrameCounts frame_counts_ RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
StreamDataCounters rtp_stats_ RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
StreamDataCounters rtx_rtp_stats_ RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
StreamDataCountersCallback* rtp_stats_callback_
|
|
|
|
|
RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
RateStatistics total_bitrate_sent_ RTC_GUARDED_BY(statistics_crit_);
|
|
|
|
|
RateStatistics nack_bitrate_sent_ RTC_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
|
2017-09-07 07:53:45 -07:00
|
|
|
uint32_t timestamp_offset_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
uint32_t remote_ssrc_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
bool sequence_number_forced_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
uint16_t sequence_number_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
uint16_t sequence_number_rtx_ RTC_GUARDED_BY(send_critsect_);
|
2018-06-14 12:59:38 +02:00
|
|
|
// Must be explicitly set by the application, use of absl::optional
|
Reland of Delete class SSRCDatabase, and its global ssrc registry. (patchset #1 id:1 of https://codereview.webrtc.org/2700413002/ )
Reason for revert:
Intend to fix perf problem and reland.
Original issue's description:
> Revert of Delete class SSRCDatabase, and its global ssrc registry. (patchset #20 id:370001 of https://codereview.webrtc.org/2644303002/ )
>
> Reason for revert:
> Breaks webrtc_perf_tests reliably:
> https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/1780
> https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus4%29/builds/178
>
> We're actively working on getting a quick version of webrtc_perf_tests up on the trybots again to prevent breakages like this: https://bugs.chromium.org/p/webrtc/issues/detail?id=7101
>
> Original issue's description:
> > Delete class SSRCDatabase, and its global ssrc registry,
> > and the method RTPSender::GenerateNewSSRC.
> >
> > It's now mandatory for higher layers to call SetSSRC, RTPSender
> > no longer allocates any ssrc by default.
> >
> > BUG=webrtc:4306,webrtc:6887
> >
> > Review-Url: https://codereview.webrtc.org/2644303002
> > Cr-Commit-Position: refs/heads/master@{#16670}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/b78d4d13835f628e722a57abae2bf06ba3655921
>
> TBR=solenberg@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,ivoc@webrtc.org,nisse@webrtc.org
> NOTRY=True
> BUG=webrtc:4306,webrtc:6887
>
> Review-Url: https://codereview.webrtc.org/2700413002
> Cr-Commit-Position: refs/heads/master@{#16693}
> Committed: https://chromium.googlesource.com/external/webrtc/+/b5848ecbf5f7b310108546ec6b858fe93452f58e
TBR=solenberg@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,ivoc@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:4306,webrtc:6887
Review-Url: https://codereview.webrtc.org/2702203002
Cr-Commit-Position: refs/heads/master@{#16737}
2017-02-21 03:40:24 -08:00
|
|
|
// only to keep track of correct use.
|
2018-06-14 12:59:38 +02:00
|
|
|
absl::optional<uint32_t> ssrc_ RTC_GUARDED_BY(send_critsect_);
|
2018-04-06 11:09:46 -07:00
|
|
|
// MID value to send in the MID header extension.
|
|
|
|
|
std::string mid_ RTC_GUARDED_BY(send_critsect_);
|
2017-09-07 07:53:45 -07:00
|
|
|
uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
int64_t capture_time_ms_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
int64_t last_timestamp_time_ms_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
bool media_has_been_sent_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
bool last_packet_marker_bit_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
std::vector<uint32_t> csrcs_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
int rtx_ RTC_GUARDED_BY(send_critsect_);
|
2018-06-14 12:59:38 +02:00
|
|
|
absl::optional<uint32_t> ssrc_rtx_ RTC_GUARDED_BY(send_critsect_);
|
2015-04-21 20:24:50 +08:00
|
|
|
// Mapping rtx_payload_type_map_[associated] = rtx.
|
2017-09-07 07:53:45 -07:00
|
|
|
std::map<int8_t, int8_t> rtx_payload_type_map_ RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
size_t rtp_overhead_bytes_per_packet_ RTC_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_;
|
2018-02-07 14:37:37 +01:00
|
|
|
const bool populate_network2_timestamp_;
|
2016-01-21 05:42:04 -08:00
|
|
|
|
2017-01-26 02:46:55 -08:00
|
|
|
const bool send_side_bwe_with_overhead_;
|
|
|
|
|
|
2018-08-23 17:07:29 +02:00
|
|
|
const bool unlimited_retransmission_experiment_;
|
|
|
|
|
|
|
|
|
|
absl::optional<VideoContentType> video_content_type_
|
|
|
|
|
RTC_GUARDED_BY(send_critsect_);
|
|
|
|
|
|
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
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|