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_RTCP_SENDER_H_
|
|
|
|
|
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_
|
|
|
|
|
|
2012-01-19 15:53:09 +00:00
|
|
|
#include <map>
|
2015-05-11 10:17:43 +02:00
|
|
|
#include <set>
|
2013-04-04 19:43:34 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
#include <string>
|
2012-01-19 15:53:09 +00:00
|
|
|
|
2015-02-26 14:34:55 +00:00
|
|
|
#include "webrtc/base/scoped_ptr.h"
|
2014-09-24 06:05:00 +00:00
|
|
|
#include "webrtc/base/thread_annotations.h"
|
2013-05-29 14:27:38 +00:00
|
|
|
#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h"
|
|
|
|
|
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
2013-08-15 23:38:54 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/interface/receive_statistics.h"
|
2013-05-29 14:27:38 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
|
2015-06-22 15:21:24 +02:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
|
2013-05-29 14:27:38 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
|
|
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
|
|
|
|
#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
|
|
|
|
|
#include "webrtc/typedefs.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2011-09-20 13:52:04 +00:00
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
class ModuleRtpRtcpImpl;
|
2013-09-09 16:02:19 +00:00
|
|
|
class RTCPReceiver;
|
2011-09-20 13:52:04 +00:00
|
|
|
|
2015-01-21 08:22:50 +00:00
|
|
|
class NACKStringBuilder {
|
|
|
|
|
public:
|
|
|
|
|
NACKStringBuilder();
|
|
|
|
|
~NACKStringBuilder();
|
|
|
|
|
|
|
|
|
|
void PushNACK(uint16_t nack);
|
|
|
|
|
std::string GetResult();
|
|
|
|
|
|
|
|
|
|
private:
|
2015-05-11 10:17:43 +02:00
|
|
|
std::ostringstream stream_;
|
|
|
|
|
int count_;
|
|
|
|
|
uint16_t prevNack_;
|
|
|
|
|
bool consecutive_;
|
2013-04-04 19:43:34 +00:00
|
|
|
};
|
|
|
|
|
|
2015-01-21 08:22:50 +00:00
|
|
|
class RTCPSender {
|
2011-07-07 08:21:25 +00:00
|
|
|
public:
|
2013-09-09 16:02:19 +00:00
|
|
|
struct FeedbackState {
|
|
|
|
|
FeedbackState();
|
|
|
|
|
|
|
|
|
|
uint8_t send_payload_type;
|
|
|
|
|
uint32_t frequency_hz;
|
2014-07-15 15:25:39 +00:00
|
|
|
uint32_t packets_sent;
|
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 media_bytes_sent;
|
2013-09-09 16:02:19 +00:00
|
|
|
uint32_t send_bitrate;
|
|
|
|
|
|
|
|
|
|
uint32_t last_rr_ntp_secs;
|
|
|
|
|
uint32_t last_rr_ntp_frac;
|
|
|
|
|
uint32_t remote_sr;
|
|
|
|
|
|
2013-10-02 13:15:34 +00:00
|
|
|
bool has_last_xr_rr;
|
|
|
|
|
RtcpReceiveTimeInfo last_xr_rr;
|
|
|
|
|
|
2013-09-09 16:02:19 +00:00
|
|
|
// Used when generating TMMBR.
|
|
|
|
|
ModuleRtpRtcpImpl* module;
|
|
|
|
|
};
|
2015-04-27 13:32:52 +02:00
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
RTCPSender(int32_t id,
|
|
|
|
|
bool audio,
|
|
|
|
|
Clock* clock,
|
2015-02-19 12:47:00 +00:00
|
|
|
ReceiveStatistics* receive_statistics,
|
|
|
|
|
RtcpPacketTypeCounterObserver* packet_type_counter_observer);
|
2015-04-27 13:32:52 +02:00
|
|
|
virtual ~RTCPSender();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t RegisterSendTransport(Transport* outgoingTransport);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
RTCPMethod Status() const;
|
|
|
|
|
void SetRTCPStatus(RTCPMethod method);
|
2012-09-11 07:00:42 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool Sending() const;
|
|
|
|
|
int32_t SetSendingStatus(const FeedbackState& feedback_state,
|
|
|
|
|
bool enabled); // combine the functions
|
2012-09-11 07:00:42 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t SetNackStatus(bool enable);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetStartTimestamp(uint32_t start_timestamp);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetLastRtpTime(uint32_t rtp_timestamp, int64_t capture_time_ms);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetSSRC(uint32_t ssrc);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetRemoteSSRC(uint32_t ssrc);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-06-01 14:12:28 +02:00
|
|
|
int32_t SetCNAME(const char* cName);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-06-25 14:46:16 +02:00
|
|
|
int32_t AddMixedCNAME(uint32_t SSRC, const char* c_name);
|
2013-10-02 13:15:34 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t RemoveMixedCNAME(uint32_t SSRC);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int64_t SendTimeOfSendReport(uint32_t sendReport);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t SendRTCP(const FeedbackState& feedback_state,
|
2015-05-11 10:17:43 +02:00
|
|
|
RTCPPacketType packetType,
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t nackSize = 0,
|
|
|
|
|
const uint16_t* nackList = 0,
|
|
|
|
|
bool repeat = false,
|
|
|
|
|
uint64_t pictureID = 0);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-11 10:17:43 +02:00
|
|
|
int32_t SendCompoundRTCP(const FeedbackState& feedback_state,
|
|
|
|
|
const std::set<RTCPPacketType>& packetTypes,
|
|
|
|
|
int32_t nackSize = 0,
|
|
|
|
|
const uint16_t* nackList = 0,
|
|
|
|
|
bool repeat = false,
|
|
|
|
|
uint64_t pictureID = 0);
|
|
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool REMB() const;
|
2011-12-22 10:26:13 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetREMBStatus(bool enable);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool TMMBR() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetTMMBRStatus(bool enable);
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit);
|
2011-12-16 14:31:37 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t SetApplicationSpecificData(uint8_t subType,
|
|
|
|
|
uint32_t name,
|
|
|
|
|
const uint8_t* data,
|
|
|
|
|
uint16_t length);
|
|
|
|
|
int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SendRtcpXrReceiverReferenceTime(bool enable);
|
2013-10-02 13:15:34 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool RtcpXrReceiverReferenceTime() const;
|
2013-11-21 08:57:04 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetCsrcs(const std::vector<uint32_t>& csrcs);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
void SetTargetBitrate(unsigned int target_bitrate);
|
2012-01-13 08:52:58 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
private:
|
2015-05-11 10:17:43 +02:00
|
|
|
struct RtcpContext;
|
|
|
|
|
|
|
|
|
|
// The BuildResult indicates the outcome of a call to a builder method,
|
|
|
|
|
// constructing a part of an RTCP packet:
|
|
|
|
|
//
|
|
|
|
|
// kError
|
|
|
|
|
// Building RTCP packet failed, propagate error out to caller.
|
|
|
|
|
// kAbort
|
|
|
|
|
// The (partial) block being build should not be included. Reset current
|
|
|
|
|
// buffer position to the state before the method call and proceed to the
|
|
|
|
|
// next packet type.
|
|
|
|
|
// kTruncated
|
|
|
|
|
// There is not enough room in the buffer to fit the data being constructed.
|
|
|
|
|
// (IP packet is full). Proceed to the next packet type, and call this
|
|
|
|
|
// method again when a new buffer has been allocated.
|
|
|
|
|
// TODO(sprang): Actually allocate multiple packets if needed.
|
|
|
|
|
// kSuccess
|
|
|
|
|
// Data has been successfully placed in the buffer.
|
|
|
|
|
|
|
|
|
|
enum class BuildResult { kError, kAborted, kTruncated, kSuccess };
|
|
|
|
|
|
2014-12-19 13:49:55 +00:00
|
|
|
int32_t SendToNetwork(const uint8_t* dataBuffer, size_t length);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-06-22 15:21:24 +02:00
|
|
|
int32_t AddReportBlock(const RTCPReportBlock& report_block)
|
2015-05-11 10:17:43 +02:00
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
2013-04-08 11:08:41 +00:00
|
|
|
|
2015-04-27 13:32:52 +02:00
|
|
|
bool PrepareReport(const FeedbackState& feedback_state,
|
2015-06-22 15:21:24 +02:00
|
|
|
uint32_t ssrc,
|
2015-04-27 13:32:52 +02:00
|
|
|
StreamStatistician* statistician,
|
2015-06-22 15:21:24 +02:00
|
|
|
RTCPReportBlock* report_block);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
int PrepareRTCP(const FeedbackState& feedback_state,
|
2015-05-11 10:17:43 +02:00
|
|
|
const std::set<RTCPPacketType>& packetTypes,
|
2015-04-27 13:32:52 +02:00
|
|
|
int32_t nackSize,
|
|
|
|
|
const uint16_t* nackList,
|
|
|
|
|
bool repeat,
|
|
|
|
|
uint64_t pictureID,
|
|
|
|
|
uint8_t* rtcp_buffer,
|
|
|
|
|
int buffer_size);
|
|
|
|
|
|
2015-05-11 10:17:43 +02:00
|
|
|
BuildResult BuildSR(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildRR(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
2015-06-25 14:46:16 +02:00
|
|
|
BuildResult BuildSDES(RtcpContext* context)
|
2015-05-11 10:17:43 +02:00
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildPLI(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildREMB(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildTMMBR(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildTMMBN(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildAPP(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildVoIPMetric(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildBYE(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildFIR(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildSLI(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildRPSI(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildNACK(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildReceiverReferenceTime(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
BuildResult BuildDlrr(RtcpContext* context)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
2013-10-02 13:15:34 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
private:
|
2015-05-11 10:17:43 +02:00
|
|
|
const int32_t id_;
|
|
|
|
|
const bool audio_;
|
|
|
|
|
Clock* const clock_;
|
|
|
|
|
RTCPMethod method_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
|
|
|
|
|
rtc::scoped_ptr<CriticalSectionWrapper> critical_section_transport_;
|
|
|
|
|
Transport* cbTransport_ GUARDED_BY(critical_section_transport_);
|
|
|
|
|
|
|
|
|
|
rtc::scoped_ptr<CriticalSectionWrapper> critical_section_rtcp_sender_;
|
|
|
|
|
bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
bool sending_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
|
|
|
|
|
int64_t next_time_to_send_rtcp_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
|
|
|
|
|
uint32_t start_timestamp_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
// SSRC that we receive on our RTP channel
|
2015-05-11 10:17:43 +02:00
|
|
|
uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-06-25 14:46:16 +02:00
|
|
|
std::string cname_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
2015-05-11 10:17:43 +02:00
|
|
|
ReceiveStatistics* receive_statistics_
|
|
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
2015-06-22 15:21:24 +02:00
|
|
|
std::map<uint32_t, rtcp::ReportBlock> report_blocks_
|
2015-05-11 10:17:43 +02:00
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
2015-06-25 14:46:16 +02:00
|
|
|
std::map<uint32_t, std::string> csrc_cnames_
|
2015-05-11 10:17:43 +02:00
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// Sent
|
2015-05-11 10:17:43 +02:00
|
|
|
uint32_t last_send_report_[RTCP_NUMBER_OF_SR] GUARDED_BY(
|
|
|
|
|
critical_section_rtcp_sender_); // allow packet loss and RTT above 1 sec
|
|
|
|
|
int64_t last_rtcp_time_[RTCP_NUMBER_OF_SR] GUARDED_BY(
|
|
|
|
|
critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// Sent XR receiver reference time report.
|
|
|
|
|
// <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
|
2015-05-11 10:17:43 +02:00
|
|
|
std::map<uint32_t, int64_t> last_xr_rr_
|
|
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// send CSRCs
|
2015-05-11 10:17:43 +02:00
|
|
|
std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// Full intra request
|
2015-05-11 10:17:43 +02:00
|
|
|
uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// REMB
|
2015-05-11 10:17:43 +02:00
|
|
|
uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
2015-05-11 10:17:43 +02:00
|
|
|
TMMBRHelp tmmbr_help_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint32_t tmmbr_send_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// APP
|
2015-05-11 10:17:43 +02:00
|
|
|
uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
rtc::scoped_ptr<uint8_t[]> app_data_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// True if sending of XR Receiver reference time report is enabled.
|
2015-05-11 10:17:43 +02:00
|
|
|
bool xr_send_receiver_reference_time_enabled_
|
|
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
// XR VoIP metric
|
2015-05-11 10:17:43 +02:00
|
|
|
RTCPVoIPMetric xr_voip_metric_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
|
|
|
|
RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
|
|
|
|
|
RtcpPacketTypeCounter packet_type_counter_
|
2015-05-11 10:17:43 +02:00
|
|
|
GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
|
|
|
|
|
RTCPUtility::NackStats nack_stats_ GUARDED_BY(critical_section_rtcp_sender_);
|
|
|
|
|
|
|
|
|
|
void SetFlag(RTCPPacketType type, bool is_volatile)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
void SetFlags(const std::set<RTCPPacketType>& types, bool is_volatile)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
bool IsFlagPresent(RTCPPacketType type) const
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
bool ConsumeFlag(RTCPPacketType type, bool forced = false)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
bool AllVolatileFlagsConsumed() const
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
|
|
|
|
|
struct ReportFlag {
|
|
|
|
|
ReportFlag(RTCPPacketType type, bool is_volatile)
|
|
|
|
|
: type(type), is_volatile(is_volatile) {}
|
|
|
|
|
bool operator<(const ReportFlag& flag) const { return type < flag.type; }
|
|
|
|
|
bool operator==(const ReportFlag& flag) const { return type == flag.type; }
|
|
|
|
|
const RTCPPacketType type;
|
|
|
|
|
const bool is_volatile;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::set<ReportFlag> report_flags_ GUARDED_BY(critical_section_rtcp_sender_);
|
2015-04-27 13:32:52 +02:00
|
|
|
|
2015-05-11 10:17:43 +02:00
|
|
|
typedef BuildResult (RTCPSender::*Builder)(RtcpContext*);
|
|
|
|
|
std::map<RTCPPacketType, Builder> builders_;
|
2015-06-22 15:21:24 +02:00
|
|
|
|
|
|
|
|
class PacketBuiltCallback;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_
|