Bug 917794: make packet filter for RTP vs RTCP match webrtc.org impl r?pkerr
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -603,38 +603,42 @@ void MediaPipeline::RtcpPacketReceived(T
}
bool MediaPipeline::IsRtp(const unsigned char *data, size_t len) {
if (len < 2)
return false;
// Check if this is a RTCP packet. Logic based on the types listed in
// media/webrtc/trunk/src/modules/rtp_rtcp/source/rtp_utility.cc
-
- // Anything outside this range is RTP.
- if ((data[1] < 192) || (data[1] > 207))
- return true;
+ // and needs to conform with RFC 5761 (RTP/RTCP Mux)
- if (data[1] == 192) // FIR
- return false;
+ // Anything outside this range is RTP, and this catches them first
+ if ((data[1] < 192) || (data[1] > 207)) {
+ return true;
+ }
- if (data[1] == 193) // NACK, but could also be RTP. This makes us sad
- return true; // but it's how webrtc.org behaves.
+ if (data[1] == 192) { // RFC 2032 FIR
+ return false;
+ }
- if (data[1] == 194)
+ if (data[1] == 193 || data[1] == 194) { // RFC 2032 NACK and SMPTETC -- not supported
return true;
+ }
- if (data[1] == 195) // IJ.
+ if (data[1] == 195) { // IJ (Extended Intra-Jitter RFC 5450)
return false;
+ }
- if ((data[1] > 195) && (data[1] < 200)) // the > 195 is redundant
+ if ((data[1] > 195) && (data[1] < 200)) { // the > 195 is redundant
return true;
+ }
- if ((data[1] >= 200) && (data[1] <= 207)) // SR, RR, SDES, BYE,
- return false; // APP, RTPFB, PSFB, XR
+ if ((data[1] >= 200) && (data[1] <= 207)) { // SR, RR, SDES, BYE,
+ return false; // APP, RTPFB, PSFB, XR
+ }
MOZ_ASSERT(false); // Not reached, belt and suspenders.
return true;
}
void MediaPipeline::PacketReceived(TransportLayer *layer,
const unsigned char *data,
size_t len) {