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

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

Issue 266373008: Cast: Fix rtcp event dedup logic in rtcp_receiver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 7 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/rtcp/rtcp_utility.h ('k') | media/cast/rtcp/test_rtcp_packet_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/rtcp/rtcp_utility.cc
diff --git a/media/cast/rtcp/rtcp_utility.cc b/media/cast/rtcp/rtcp_utility.cc
index fd86e8e9e17f57f7b2271a9f4bcbc34c5b3f252d..da6ef9df668557afc7e2bcbfff8cd29bce3b8fb4 100644
--- a/media/cast/rtcp/rtcp_utility.cc
+++ b/media/cast/rtcp/rtcp_utility.cc
@@ -1051,5 +1051,63 @@ bool RtcpParser::ParseExtendedReportDelaySinceLastReceiverReport() {
return true;
}
+uint8 ConvertEventTypeToWireFormat(CastLoggingEvent event) {
+ switch (event) {
+ case kAudioAckSent:
+ return 1;
+ case kAudioPlayoutDelay:
+ return 2;
+ case kAudioFrameDecoded:
+ return 3;
+ case kAudioPacketReceived:
+ return 4;
+ case kVideoAckSent:
+ return 5;
+ case kVideoFrameDecoded:
+ return 6;
+ case kVideoRenderDelay:
+ return 7;
+ case kVideoPacketReceived:
+ return 8;
+ case kDuplicateAudioPacketReceived:
+ return 9;
+ case kDuplicateVideoPacketReceived:
+ return 10;
+ default:
+ return 0; // Not an interesting event.
+ }
+}
+
+CastLoggingEvent TranslateToLogEventFromWireFormat(uint8 event) {
+ switch (event) {
+ case 1:
+ return media::cast::kAudioAckSent;
+ case 2:
+ return media::cast::kAudioPlayoutDelay;
+ case 3:
+ return media::cast::kAudioFrameDecoded;
+ case 4:
+ return media::cast::kAudioPacketReceived;
+ case 5:
+ return media::cast::kVideoAckSent;
+ case 6:
+ return media::cast::kVideoFrameDecoded;
+ case 7:
+ return media::cast::kVideoRenderDelay;
+ case 8:
+ return media::cast::kVideoPacketReceived;
+ case 9:
+ return media::cast::kDuplicateAudioPacketReceived;
+ case 10:
+ return media::cast::kDuplicateVideoPacketReceived;
+ default:
+ // If the sender adds new log messages we will end up here until we add
+ // the new messages in the receiver.
+ VLOG(1) << "Unexpected log message received: " << static_cast<int>(event);
+ NOTREACHED();
+ return media::cast::kUnknown;
+ }
+}
+
} // namespace cast
} // namespace media
« no previous file with comments | « media/cast/rtcp/rtcp_utility.h ('k') | media/cast/rtcp/test_rtcp_packet_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698