Bug 1492834 - Remove "Attempting to protect RTP" and related log messages; r=bwc
authorDan Minor <dminor@mozilla.com>
Thu, 20 Sep 2018 14:11:44 +0000
changeset 495917 7b083f358c81e63473537145be12127708c4c550
parent 495916 e3d6fb688839a56647d975ddaaa60fbeb6fd910f
child 495918 80ccc40bdd0a725ecbb86d4a891345934b14deab
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1492834
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492834 - Remove "Attempting to protect RTP" and related log messages; r=bwc This removes the info messages and adds the packet type to the error messages. Differential Revision: https://phabricator.services.mozilla.com/D6392
media/mtransport/transportlayersrtp.cpp
--- a/media/mtransport/transportlayersrtp.cpp
+++ b/media/mtransport/transportlayersrtp.cpp
@@ -99,30 +99,30 @@ TransportLayerSrtp::SendPacket(MediaPack
   }
 
   MOZ_ASSERT(packet.capacity() - packet.len() >= SRTP_MAX_EXPANSION);
 
   int out_len;
   nsresult res;
   switch (packet.type()) {
     case MediaPacket::RTP:
-      MOZ_MTLOG(ML_INFO, "Attempting to protect RTP...");
       res = mSendSrtp->ProtectRtp(packet.data(), packet.len(), packet.capacity(), &out_len);
       break;
     case MediaPacket::RTCP:
-      MOZ_MTLOG(ML_INFO, "Attempting to protect RTCP...");
       res = mSendSrtp->ProtectRtcp(packet.data(), packet.len(), packet.capacity(), &out_len);
       break;
     default:
       MOZ_CRASH("SRTP layer asked to send packet that is neither RTP or RTCP");
   }
 
   if (NS_FAILED(res)) {
     MOZ_MTLOG(ML_ERROR,
-                "Error protecting RTP/RTCP len=" << packet.len()
+                "Error protecting "
+                << (packet.type() == MediaPacket::RTP ? "RTP" : "RTCP")
+                << " len=" << packet.len()
                 << "[" << std::hex
                 << packet.data()[0] << " "
                 << packet.data()[1] << " "
                 << packet.data()[2] << " "
                 << packet.data()[3]
                 << "]");
     return TE_ERROR;
   }
@@ -238,32 +238,32 @@ TransportLayerSrtp::PacketReceived(Trans
 
   // We want to keep the encrypted packet around for packet dumping
   packet.CopyDataToEncrypted();
   int outLen;
   nsresult res;
 
   if (IsRtp(packet.data(), packet.len())) {
     packet.SetType(MediaPacket::RTP);
-    MOZ_MTLOG(ML_INFO, "Attempting to unprotect RTP...");
     res = mRecvSrtp->UnprotectRtp(packet.data(), packet.len(), packet.len(), &outLen);
   } else {
     packet.SetType(MediaPacket::RTCP);
-    MOZ_MTLOG(ML_INFO, "Attempting to unprotect RTCP...");
     res = mRecvSrtp->UnprotectRtcp(packet.data(), packet.len(), packet.len(), &outLen);
   }
 
   if (NS_SUCCEEDED(res)) {
     packet.SetLength(outLen);
     SignalPacketReceived(this, packet);
   } else {
     // TODO: What do we do wrt packet dumping here? Maybe signal an empty
     // packet? Signal the still-encrypted packet?
     MOZ_MTLOG(ML_ERROR,
-                "Error unprotecting RTP/RTCP len=" << packet.len()
+                "Error unprotecting "
+                << (packet.type() == MediaPacket::RTP ? "RTP" : "RTCP")
+                << " len=" << packet.len()
                 << "[" << std::hex
                 << packet.data()[0] << " "
                 << packet.data()[1] << " "
                 << packet.data()[2] << " "
                 << packet.data()[3]
                 << "]");
   }
 }