Commit 9f24ecb2 authored by pwestin@google.com's avatar pwestin@google.com

Cast: Add capabity to send Receiver and Sender log messages over RTCP.

This cl contains the generation of the RTCP packets containing the log
messages, no code (more than this unittest) trigger the send.
Additionally the receiver is not wired up either. If a receiver receives
a log message today it would be ignored.

Review URL: https://codereview.chromium.org/74613004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238533 0039d316-1c4b-4281-b951-d872f2087c98
parent a9575487
...@@ -179,7 +179,7 @@ void Rtcp::IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length) { ...@@ -179,7 +179,7 @@ void Rtcp::IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length) {
} }
void Rtcp::SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message, void Rtcp::SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message,
const RtcpReceiverLogMessage* receiver_log) { RtcpReceiverLogMessage* receiver_log) {
uint32 packet_type_flags = 0; uint32 packet_type_flags = 0;
base::TimeTicks now = cast_environment_->Clock()->NowTicks(); base::TimeTicks now = cast_environment_->Clock()->NowTicks();
...@@ -239,15 +239,15 @@ void Rtcp::SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message, ...@@ -239,15 +239,15 @@ void Rtcp::SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message,
} }
void Rtcp::SendRtcpFromRtpSender( void Rtcp::SendRtcpFromRtpSender(
const RtcpSenderLogMessage* sender_log_message) { RtcpSenderLogMessage* sender_log_message) {
uint32 packet_type_flags = RtcpSender::kRtcpSr; uint32 packet_type_flags = RtcpSender::kRtcpSr;
base::TimeTicks now = cast_environment_->Clock()->NowTicks(); base::TimeTicks now = cast_environment_->Clock()->NowTicks();
RtcpSenderInfo sender_info; if (sender_log_message) {
RtcpDlrrReportBlock dlrr; packet_type_flags |= RtcpSender::kRtcpSenderLog;
}
if (sender_log_message) packet_type_flags |= RtcpSender::kRtcpSenderLog;
RtcpSenderInfo sender_info;
if (rtp_sender_statistics_) { if (rtp_sender_statistics_) {
rtp_sender_statistics_->GetStatistics(now, &sender_info); rtp_sender_statistics_->GetStatistics(now, &sender_info);
} else { } else {
...@@ -255,6 +255,7 @@ void Rtcp::SendRtcpFromRtpSender( ...@@ -255,6 +255,7 @@ void Rtcp::SendRtcpFromRtpSender(
} }
SaveLastSentNtpTime(now, sender_info.ntp_seconds, sender_info.ntp_fraction); SaveLastSentNtpTime(now, sender_info.ntp_seconds, sender_info.ntp_fraction);
RtcpDlrrReportBlock dlrr;
if (!time_last_report_received_.is_null()) { if (!time_last_report_received_.is_null()) {
packet_type_flags |= RtcpSender::kRtcpDlrr; packet_type_flags |= RtcpSender::kRtcpDlrr;
dlrr.last_rr = last_report_received_; dlrr.last_rr = last_report_received_;
......
...@@ -92,15 +92,20 @@ class Rtcp { ...@@ -92,15 +92,20 @@ class Rtcp {
// |sender_log_message| is optional; without it no log messages will be // |sender_log_message| is optional; without it no log messages will be
// attached to the RTCP report; instead a normal RTCP send report will be // attached to the RTCP report; instead a normal RTCP send report will be
// sent. // sent.
void SendRtcpFromRtpSender(const RtcpSenderLogMessage* sender_log_message); // Additionally if all messages in |sender_log_message| does
// not fit in the packet the |sender_log_message| will contain the remaining
// unsent messages.
void SendRtcpFromRtpSender(RtcpSenderLogMessage* sender_log_message);
// |cast_message| and |receiver_log| is optional; if |cast_message| is // |cast_message| and |receiver_log| is optional; if |cast_message| is
// provided the RTCP receiver report will append a Cast message containing // provided the RTCP receiver report will append a Cast message containing
// Acks and Nacks; if |receiver_log| is provided the RTCP receiver report will // Acks and Nacks; if |receiver_log| is provided the RTCP receiver report will
// append the log messages. If no argument is set a normal RTCP receiver // append the log messages. If no argument is set a normal RTCP receiver
// report will be sent. // report will be sent. Additionally if all messages in |receiver_log| does
// not fit in the packet the |receiver_log| will contain the remaining unsent
// messages.
void SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message, void SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message,
const RtcpReceiverLogMessage* receiver_log); RtcpReceiverLogMessage* receiver_log);
void IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length); void IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length);
bool Rtt(base::TimeDelta* rtt, base::TimeDelta* avg_rtt, bool Rtt(base::TimeDelta* rtt, base::TimeDelta* avg_rtt,
......
This diff is collapsed.
...@@ -28,13 +28,13 @@ class RtcpSender { ...@@ -28,13 +28,13 @@ class RtcpSender {
void SendRtcpFromRtpSender(uint32 packet_type_flags, void SendRtcpFromRtpSender(uint32 packet_type_flags,
const RtcpSenderInfo* sender_info, const RtcpSenderInfo* sender_info,
const RtcpDlrrReportBlock* dlrr, const RtcpDlrrReportBlock* dlrr,
const RtcpSenderLogMessage* sender_log); RtcpSenderLogMessage* sender_log);
void SendRtcpFromRtpReceiver(uint32 packet_type_flags, void SendRtcpFromRtpReceiver(uint32 packet_type_flags,
const RtcpReportBlock* report_block, const RtcpReportBlock* report_block,
const RtcpReceiverReferenceTimeReport* rrtr, const RtcpReceiverReferenceTimeReport* rrtr,
const RtcpCastMessage* cast_message, const RtcpCastMessage* cast_message,
const RtcpReceiverLogMessage* receiver_log); RtcpReceiverLogMessage* receiver_log);
enum RtcpPacketType { enum RtcpPacketType {
kRtcpSr = 0x0002, kRtcpSr = 0x0002,
...@@ -89,10 +89,10 @@ class RtcpSender { ...@@ -89,10 +89,10 @@ class RtcpSender {
void BuildCast(const RtcpCastMessage* cast_message, void BuildCast(const RtcpCastMessage* cast_message,
std::vector<uint8>* packet) const; std::vector<uint8>* packet) const;
void BuildSenderLog(const RtcpSenderLogMessage* sender_log_message, void BuildSenderLog(RtcpSenderLogMessage* sender_log_message,
std::vector<uint8>* packet) const; std::vector<uint8>* packet) const;
void BuildReceiverLog(const RtcpReceiverLogMessage* receiver_log_message, void BuildReceiverLog(RtcpReceiverLogMessage* receiver_log_message,
std::vector<uint8>* packet) const; std::vector<uint8>* packet) const;
inline void BitrateToRembExponentBitrate(uint32 bitrate, inline void BitrateToRembExponentBitrate(uint32 bitrate,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment