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

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: Address dcheng's comments. Created 4 years, 9 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
« no previous file with comments | « media/cast/net/rtcp/rtcp_utility.h ('k') | media/cast/net/rtcp/rtcp_utility_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ffc400d26430bb44d2b75d8e7e5d81e80ef371c..667026e012d87e27cb3a87266352ba71be603b8f 100644
--- a/media/cast/net/rtcp/rtcp_utility.cc
+++ b/media/cast/net/rtcp/rtcp_utility.cc
@@ -34,7 +34,8 @@ RtcpParser::RtcpParser(uint32_t local_ssrc, uint32_t remote_ssrc)
has_last_report_(false),
has_cast_message_(false),
has_cst2_message_(false),
- has_receiver_reference_time_report_(false) {}
+ has_receiver_reference_time_report_(false),
+ has_picture_loss_indicator_(false) {}
RtcpParser::~RtcpParser() {}
@@ -47,6 +48,7 @@ bool RtcpParser::Parse(base::BigEndianReader* reader) {
has_cast_message_ = false;
has_cst2_message_ = false;
has_receiver_reference_time_report_ = false;
+ has_picture_loss_indicator_ = false;
while (reader->remaining()) {
RtcpCommonHeader header;
@@ -74,10 +76,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))
@@ -186,6 +191,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;
@@ -281,7 +310,7 @@ bool RtcpParser::ParseFeedbackCommon(base::BigEndianReader* reader,
return true;
}
- cast_message_.media_ssrc = remote_ssrc;
+ cast_message_.remote_ssrc = remote_ssrc;
uint8_t last_frame_id;
uint8_t number_of_lost_fields;
« no previous file with comments | « media/cast/net/rtcp/rtcp_utility.h ('k') | media/cast/net/rtcp/rtcp_utility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698