Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Unified Diff: media/cast/net/rtcp/rtcp_utility.cc

Issue 1709863002: Add Cast PLI support on sender side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate Pli message from Cast message. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/net/rtcp/rtcp_utility.cc
diff --git a/media/cast/net/rtcp/rtcp_utility.cc b/media/cast/net/rtcp/rtcp_utility.cc
index 74af3a04fb45ab8b3998c185d80cafdcda4e49a4..be2b3eb85a6b2ca492e6570908465f14cd85ef64 100644
--- a/media/cast/net/rtcp/rtcp_utility.cc
+++ b/media/cast/net/rtcp/rtcp_utility.cc
@@ -33,7 +33,8 @@ RtcpParser::RtcpParser(uint32_t local_ssrc, uint32_t remote_ssrc)
has_sender_report_(false),
has_last_report_(false),
has_cast_message_(false),
- has_receiver_reference_time_report_(false) {}
+ has_receiver_reference_time_report_(false),
+ has_picture_loss_indicator_(false) {}
RtcpParser::~RtcpParser() {}
@@ -45,6 +46,7 @@ bool RtcpParser::Parse(base::BigEndianReader* reader) {
receiver_log_.clear();
has_cast_message_ = false;
has_receiver_reference_time_report_ = false;
+ has_picture_loss_indicator_ = false;
while (reader->remaining()) {
RtcpCommonHeader header;
@@ -72,10 +74,13 @@ bool RtcpParser::Parse(base::BigEndianReader* reader) {
return false;
break;
- case kPacketTypePayloadSpecific:
+ case kPacketTypePayloadSpecific: {
if (!ParseFeedbackCommon(&chunk, header))
return false;
+ if (!ParsePli(&chunk, header))
+ return false;
break;
+ }
case kPacketTypeXr:
if (!ParseExtendedReport(&chunk, header))
@@ -184,6 +189,30 @@ bool RtcpParser::ParseReportBlock(base::BigEndianReader* reader) {
return true;
}
+bool RtcpParser::ParsePli(base::BigEndianReader* reader,
+ const RtcpCommonHeader& header) {
+ if (header.IC != 1)
+ return true;
+
+ uint32_t receiver_ssrc, sender_ssrc;
+ if (!reader->ReadU32(&receiver_ssrc))
+ return false;
+
+ // Ignore this Rtcp if the receiver ssrc does not match.
+ if (receiver_ssrc != remote_ssrc_)
+ return true;
+
+ if (!reader->ReadU32(&sender_ssrc))
+ return false;
+
+ // Ignore this Rtcp if the sender ssrc does not match.
+ if (sender_ssrc != local_ssrc_)
+ return true;
+
+ has_picture_loss_indicator_ = true;
+ return true;
+}
+
bool RtcpParser::ParseApplicationDefined(base::BigEndianReader* reader,
const RtcpCommonHeader& header) {
uint32_t sender_ssrc;

Powered by Google App Engine
This is Rietveld 408576698