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

Unified Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1226093002: Don't create unsignalled receive streams for RTX and ULPFEC packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: ASSERT_EQ->EXPECT_EQ Created 5 years, 5 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 | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoengine2.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc
index d68d6192dbe4d818400cca524b246fdf86e80329..f75d36bbec0171ef7cfc5ac9def0276cc871c2ab 100644
--- a/talk/media/webrtc/webrtcvideoengine2.cc
+++ b/talk/media/webrtc/webrtcvideoengine2.cc
@@ -1376,9 +1376,24 @@ void WebRtcVideoChannel2::OnPacketReceived(
return;
}
- // TODO(pbos): Ignore unsignalled packets that don't use the video payload
- // (prevent creating default receivers for RTX configured as if it would
- // receive media payloads on those SSRCs).
+ int payload_type = 0;
+ if (!GetRtpPayloadType(packet->data(), packet->size(), &payload_type)) {
+ return;
+ }
+
+ // See if this payload_type is registered as one that usually gets its own
+ // SSRC (RTX) or at least is safe to drop either way (ULPFEC). If it is, and
+ // it wasn't handled above by DeliverPacket, that means we don't know what
+ // stream it associates with, and we shouldn't ever create an implicit channel
+ // for these.
+ for (auto& codec : recv_codecs_) {
+ if (payload_type == codec.rtx_payload_type ||
+ payload_type == codec.fec.red_rtx_payload_type ||
+ payload_type == codec.fec.ulpfec_payload_type) {
+ return;
+ }
+ }
+
switch (unsignalled_ssrc_handler_->OnUnsignalledSsrc(this, ssrc)) {
case UnsignalledSsrcHandler::kDropPacket:
return;
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698