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
|
|
|
|
2015-12-10 05:05:27 -08:00
|
|
|
#include <list>
|
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-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"
|
2015-12-15 00:30:07 -08:00
|
|
|
#include "webrtc/base/random.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"
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
2013-01-07 10:18:30 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/bitrate.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"
|
2015-09-28 09:59:31 -07:00
|
|
|
#include "webrtc/transport.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2013-01-25 10:53:38 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class RTPSenderAudio;
|
|
|
|
|
class RTPSenderVideo;
|
2016-01-21 05:42:04 -08:00
|
|
|
class RtcEventLog;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
class RTPSenderInterface {
|
|
|
|
|
public:
|
|
|
|
|
RTPSenderInterface() {}
|
|
|
|
|
virtual ~RTPSenderInterface() {}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-01 15:33:06 -07:00
|
|
|
enum CVOMode {
|
|
|
|
|
kCVONone,
|
|
|
|
|
kCVOInactive, // CVO rtp header extension is registered but haven't
|
|
|
|
|
// received any frame with rotation pending.
|
|
|
|
|
kCVOActivated, // CVO rtp header extension will be present in the rtp
|
|
|
|
|
// packets.
|
|
|
|
|
};
|
|
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
virtual uint32_t SSRC() const = 0;
|
|
|
|
|
virtual uint32_t Timestamp() const = 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-07-07 13:06:48 +00:00
|
|
|
virtual int32_t BuildRTPheader(uint8_t* data_buffer,
|
2014-12-19 13:49:55 +00:00
|
|
|
int8_t payload_type,
|
|
|
|
|
bool marker_bit,
|
|
|
|
|
uint32_t capture_timestamp,
|
2014-07-07 13:06:48 +00:00
|
|
|
int64_t capture_time_ms,
|
2014-12-19 13:49:55 +00:00
|
|
|
bool timestamp_provided = true,
|
|
|
|
|
bool inc_sequence_number = true) = 0;
|
2011-07-07 08:21:25 +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
|
|
|
virtual size_t RTPHeaderLength() const = 0;
|
2015-04-14 21:28:08 +02:00
|
|
|
// Returns the next sequence number to use for a packet and allocates
|
|
|
|
|
// 'packets_to_send' number of sequence numbers. It's important all allocated
|
|
|
|
|
// sequence numbers are used in sequence to avoid perceived packet loss.
|
|
|
|
|
virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0;
|
2013-04-08 11:08:41 +00:00
|
|
|
virtual uint16_t SequenceNumber() const = 0;
|
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
|
|
|
virtual size_t MaxPayloadLength() const = 0;
|
|
|
|
|
virtual size_t MaxDataPayloadLength() const = 0;
|
2013-04-08 11:08:41 +00:00
|
|
|
virtual uint16_t ActualSendBitrateKbit() const = 0;
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2015-09-21 15:11:14 -07:00
|
|
|
virtual int32_t SendToNetwork(uint8_t* data_buffer,
|
|
|
|
|
size_t payload_length,
|
|
|
|
|
size_t rtp_header_length,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
StorageType storage,
|
|
|
|
|
RtpPacketSender::Priority priority) = 0;
|
2015-03-04 22:55:15 +00:00
|
|
|
|
|
|
|
|
virtual bool UpdateVideoRotation(uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
VideoRotation rotation) const = 0;
|
|
|
|
|
virtual bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) = 0;
|
2015-04-01 15:33:06 -07:00
|
|
|
virtual CVOMode ActivateCVORtpHeaderExtension() = 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2014-11-05 14:05:29 +00:00
|
|
|
class RTPSender : public RTPSenderInterface {
|
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,
|
|
|
|
|
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,
|
|
|
|
|
SendPacketObserver* send_packet_observer);
|
|
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
virtual ~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
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
uint16_t ActualSendBitrateKbit() const override;
|
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
|
|
|
|
2014-06-17 17:32:05 +00:00
|
|
|
void SetTargetBitrate(uint32_t bitrate);
|
|
|
|
|
uint32_t GetTargetBitrate();
|
2011-07-07 08:21:25 +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.
|
2015-03-04 12:58:35 +00:00
|
|
|
size_t MaxDataPayloadLength() const override;
|
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
|
|
|
|
2012-11-07 17:01:04 +00:00
|
|
|
int SendPayloadFrequency() 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
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t StartTimestamp() const;
|
|
|
|
|
void SetStartTimestamp(uint32_t timestamp, bool force);
|
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
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
uint16_t SequenceNumber() const override;
|
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
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t SendOutgoingData(FrameType frame_type,
|
|
|
|
|
int8_t payload_type,
|
|
|
|
|
uint32_t timestamp,
|
2014-07-07 13:06:48 +00:00
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
const uint8_t* payload_data,
|
2014-12-19 13:49:55 +00:00
|
|
|
size_t payload_size,
|
2014-07-07 13:06:48 +00:00
|
|
|
const RTPFragmentationHeader* fragmentation,
|
2015-03-04 22:55:15 +00:00
|
|
|
const RTPVideoHeader* rtp_hdr = NULL);
|
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 SetTransmissionTimeOffset(int32_t transmission_time_offset);
|
|
|
|
|
int32_t SetAbsoluteSendTime(uint32_t absolute_send_time);
|
2015-03-04 22:55:15 +00:00
|
|
|
void SetVideoRotation(VideoRotation rotation);
|
2015-03-17 14:33:12 +00:00
|
|
|
int32_t SetTransportSequenceNumber(uint16_t sequence_number);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
|
2015-12-10 02:39:40 -08:00
|
|
|
bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override;
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
|
2011-12-16 14:31:37 +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 RtpHeaderExtensionTotalLength() const;
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2015-03-04 22:55:15 +00:00
|
|
|
uint16_t BuildRTPHeaderExtension(uint8_t* data_buffer, bool marker_bit) const;
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2014-03-06 23:49:08 +00:00
|
|
|
uint8_t BuildTransmissionTimeOffsetExtension(uint8_t *data_buffer) const;
|
|
|
|
|
uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const;
|
|
|
|
|
uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const;
|
2015-03-04 22:55:15 +00:00
|
|
|
uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const;
|
2015-08-03 04:38:41 -07:00
|
|
|
uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer,
|
|
|
|
|
uint16_t sequence_number) const;
|
|
|
|
|
|
|
|
|
|
// Verifies that the specified extension is registered, and that it is
|
|
|
|
|
// present in rtp packet. If extension is not registered kNotRegistered is
|
|
|
|
|
// returned. If extension cannot be found in the rtp header, or if it is
|
|
|
|
|
// malformed, kError is returned. Otherwise *extension_offset is set to the
|
|
|
|
|
// offset of the extension from the beginning of the rtp packet and kOk is
|
|
|
|
|
// returned.
|
|
|
|
|
enum class ExtensionStatus {
|
|
|
|
|
kNotRegistered,
|
|
|
|
|
kOk,
|
|
|
|
|
kError,
|
|
|
|
|
};
|
|
|
|
|
ExtensionStatus VerifyExtension(RTPExtensionType extension_type,
|
|
|
|
|
uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
size_t extension_length_bytes,
|
|
|
|
|
size_t* extension_offset) const
|
2016-02-02 08:31:45 -08:00
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
bool UpdateAudioLevel(uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
bool is_voiced,
|
|
|
|
|
uint8_t dBov) const;
|
2012-01-16 11:06:31 +00:00
|
|
|
|
2015-12-10 02:39:40 -08:00
|
|
|
bool UpdateVideoRotation(uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
VideoRotation rotation) const override;
|
2015-03-04 22:55:15 +00:00
|
|
|
|
2013-11-13 15:29:21 +00:00
|
|
|
bool TimeToSendPacket(uint16_t sequence_number, int64_t capture_time_ms,
|
|
|
|
|
bool retransmission);
|
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 TimeToSendPadding(size_t bytes);
|
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);
|
2013-02-01 15:09:57 +00:00
|
|
|
void OnReceivedNACK(const std::list<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
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
bool ProcessNACKBitRate(uint32_t now);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
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
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// Functions wrapping RTPSenderInterface.
|
2015-03-04 12:58:35 +00:00
|
|
|
int32_t BuildRTPheader(uint8_t* data_buffer,
|
|
|
|
|
int8_t payload_type,
|
|
|
|
|
bool marker_bit,
|
|
|
|
|
uint32_t capture_timestamp,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
const bool timestamp_provided = true,
|
|
|
|
|
const bool inc_sequence_number = true) override;
|
|
|
|
|
|
|
|
|
|
size_t RTPHeaderLength() const override;
|
2015-04-14 21:28:08 +02:00
|
|
|
uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override;
|
2015-03-04 12:58:35 +00:00
|
|
|
size_t MaxPayloadLength() const override;
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// Current timestamp.
|
2015-03-04 12:58:35 +00:00
|
|
|
uint32_t Timestamp() const override;
|
|
|
|
|
uint32_t SSRC() const override;
|
|
|
|
|
|
|
|
|
|
int32_t SendToNetwork(uint8_t* data_buffer,
|
|
|
|
|
size_t payload_length,
|
|
|
|
|
size_t rtp_header_length,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
StorageType storage,
|
2015-09-21 15:11:14 -07:00
|
|
|
RtpPacketSender::Priority priority) override;
|
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
|
|
|
|
2012-11-13 21:12:39 +00:00
|
|
|
// Set audio packet size, used to determine when it's time to send a DTMF
|
2013-01-25 10:53:38 +00:00
|
|
|
// packet in silence (CNG).
|
2014-12-19 13:49:55 +00:00
|
|
|
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
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// Set payload type for Redundant Audio Data RFC 2198.
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t SetRED(int8_t payload_type);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// Get payload type for Redundant Audio Data RFC 2198.
|
2013-04-08 11:08:41 +00:00
|
|
|
int32_t RED(int8_t *payload_type) const;
|
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
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
// FEC.
|
2015-07-14 09:36:34 -07:00
|
|
|
void SetGenericFECStatus(bool enable,
|
|
|
|
|
uint8_t payload_type_red,
|
|
|
|
|
uint8_t payload_type_fec);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2015-07-14 09:36:34 -07:00
|
|
|
void GenericFECStatus(bool* enable,
|
|
|
|
|
uint8_t* payload_type_red,
|
|
|
|
|
uint8_t* payload_type_fec) const;
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
int32_t SetFecParameters(const FecProtectionParams *delta_params,
|
|
|
|
|
const FecProtectionParams *key_params);
|
2012-11-07 17:01:04 +00:00
|
|
|
|
2015-09-18 11:14:31 +02:00
|
|
|
size_t SendPadData(size_t bytes,
|
|
|
|
|
bool timestamp_provided,
|
|
|
|
|
uint32_t timestamp,
|
|
|
|
|
int64_t capture_time_ms);
|
2013-12-05 09:16:33 +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;
|
2015-04-01 15:33:06 -07:00
|
|
|
CVOMode ActivateCVORtpHeaderExtension() override;
|
2014-07-07 13:06:48 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2014-11-24 08:25:50 +00:00
|
|
|
size_t CreateRtpHeader(uint8_t* header,
|
|
|
|
|
int8_t payload_type,
|
|
|
|
|
uint32_t ssrc,
|
|
|
|
|
bool marker_bit,
|
|
|
|
|
uint32_t timestamp,
|
|
|
|
|
uint16_t sequence_number,
|
|
|
|
|
const std::vector<uint32_t>& csrcs) const;
|
2013-06-04 13:47:36 +00:00
|
|
|
|
2014-12-19 09:52:24 +00:00
|
|
|
void UpdateNACKBitRate(uint32_t bytes, int64_t now);
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2013-12-04 10:24:26 +00:00
|
|
|
bool PrepareAndSendPacket(uint8_t* buffer,
|
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 length,
|
2013-12-04 10:24:26 +00:00
|
|
|
int64_t capture_time_ms,
|
2014-03-19 18:14:52 +00:00
|
|
|
bool send_over_rtx,
|
|
|
|
|
bool is_retransmit);
|
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.
|
|
|
|
|
size_t TrySendRedundantPayloads(size_t bytes);
|
2013-12-04 10:24:26 +00:00
|
|
|
|
2015-09-18 11:14:31 +02:00
|
|
|
void BuildPaddingPacket(uint8_t* packet,
|
|
|
|
|
size_t header_length,
|
|
|
|
|
size_t padding_length);
|
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
|
|
|
void BuildRtxPacket(uint8_t* buffer, size_t* length,
|
2013-04-08 11:08:41 +00:00
|
|
|
uint8_t* buffer_rtx);
|
2013-03-15 23:21:52 +00:00
|
|
|
|
2015-10-02 03:39:33 -07:00
|
|
|
bool SendPacketToNetwork(const uint8_t* packet,
|
|
|
|
|
size_t size,
|
|
|
|
|
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
|
|
|
|
2015-03-04 22:55:15 +00:00
|
|
|
// Find the byte position of the RTP extension as indicated by |type| in
|
|
|
|
|
// |rtp_packet|. Return false if such extension doesn't exist.
|
|
|
|
|
bool FindHeaderExtensionPosition(RTPExtensionType type,
|
|
|
|
|
const uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
size_t* position) const;
|
|
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
void UpdateTransmissionTimeOffset(uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
int64_t time_diff_ms) const;
|
|
|
|
|
void UpdateAbsoluteSendTime(uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
int64_t now_ms) const;
|
2016-05-02 23:44:01 -07:00
|
|
|
|
|
|
|
|
bool UpdateTransportSequenceNumber(uint16_t sequence_number,
|
|
|
|
|
uint8_t* rtp_packet,
|
|
|
|
|
size_t rtp_packet_length,
|
|
|
|
|
const RTPHeader& rtp_header) const;
|
|
|
|
|
|
|
|
|
|
bool AllocateTransportSequenceNumber(int* packet_id) const;
|
2014-05-30 12:17:15 +00:00
|
|
|
|
2013-12-05 14:29:02 +00:00
|
|
|
void UpdateRtpStats(const uint8_t* buffer,
|
2014-12-09 09:47:53 +00:00
|
|
|
size_t packet_length,
|
2013-12-05 14:29:02 +00:00
|
|
|
const RTPHeader& header,
|
|
|
|
|
bool is_rtx,
|
|
|
|
|
bool is_retransmit);
|
|
|
|
|
bool IsFecPacket(const uint8_t* buffer, const RTPHeader& header) const;
|
|
|
|
|
|
2016-02-02 08:31:45 -08:00
|
|
|
class BitrateAggregator {
|
|
|
|
|
public:
|
|
|
|
|
explicit BitrateAggregator(BitrateStatisticsObserver* bitrate_callback);
|
|
|
|
|
|
|
|
|
|
void OnStatsUpdated() const;
|
|
|
|
|
|
|
|
|
|
Bitrate::Observer* total_bitrate_observer();
|
|
|
|
|
Bitrate::Observer* retransmit_bitrate_observer();
|
|
|
|
|
void set_ssrc(uint32_t ssrc);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// We assume that these observers are called on the same thread, which is
|
|
|
|
|
// true for RtpSender as they are called on the Process thread.
|
|
|
|
|
class BitrateObserver : public Bitrate::Observer {
|
|
|
|
|
public:
|
|
|
|
|
explicit BitrateObserver(const BitrateAggregator& aggregator);
|
|
|
|
|
|
|
|
|
|
// Implements Bitrate::Observer.
|
|
|
|
|
void BitrateUpdated(const BitrateStatistics& stats) override;
|
|
|
|
|
const BitrateStatistics& statistics() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
BitrateStatistics statistics_;
|
|
|
|
|
const BitrateAggregator& aggregator_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
BitrateStatisticsObserver* const callback_;
|
|
|
|
|
BitrateObserver total_bitrate_observer_;
|
|
|
|
|
BitrateObserver retransmit_bitrate_observer_;
|
|
|
|
|
uint32_t ssrc_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2016-02-02 08:31:45 -08:00
|
|
|
BitrateAggregator bitrates_;
|
2014-11-05 14:05:29 +00:00
|
|
|
Bitrate total_bitrate_sent_;
|
2013-12-13 09:46:59 +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
|
|
|
|
2013-01-25 10:53:38 +00: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
|
|
|
|
2013-01-25 10:53:38 +00:00
|
|
|
RtpHeaderExtensionMap rtp_header_extension_map_;
|
2013-04-08 11:08:41 +00:00
|
|
|
int32_t transmission_time_offset_;
|
2013-05-16 11:10:31 +00:00
|
|
|
uint32_t absolute_send_time_;
|
2015-03-04 22:55:15 +00:00
|
|
|
VideoRotation rotation_;
|
2015-04-01 15:33:06 -07:00
|
|
|
CVOMode cvo_mode_;
|
2015-03-17 14:33:12 +00:00
|
|
|
uint16_t transport_sequence_number_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
|
|
|
|
// NACK
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t nack_byte_count_times_[NACK_BYTECOUNT_SIZE];
|
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 nack_byte_count_[NACK_BYTECOUNT_SIZE];
|
2013-01-25 10:53:38 +00:00
|
|
|
Bitrate nack_bitrate_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
2013-12-04 10:24:26 +00:00
|
|
|
RTPPacketHistory 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_);
|
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_;
|
2012-11-13 21:12:39 +00:00
|
|
|
|
|
|
|
|
// RTP variables
|
2014-07-07 13:06:48 +00:00
|
|
|
bool start_timestamp_forced_ GUARDED_BY(send_critsect_);
|
|
|
|
|
uint32_t start_timestamp_ 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_);
|
|
|
|
|
uint32_t timestamp_ GUARDED_BY(send_critsect_);
|
|
|
|
|
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_);
|
2014-03-26 14:27:34 +00:00
|
|
|
|
|
|
|
|
// Note: Don't access this variable directly, always go through
|
|
|
|
|
// SetTargetBitrateKbps or GetTargetBitrateKbps. Also remember
|
|
|
|
|
// that by the time the function returns there is no guarantee
|
|
|
|
|
// that the target bitrate is still valid.
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CriticalSection target_bitrate_critsect_;
|
2014-06-26 11:44:49 +00:00
|
|
|
uint32_t target_bitrate_ GUARDED_BY(target_bitrate_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
|
|
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
|