OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 return; | 1369 return; |
1370 case webrtc::PacketReceiver::DELIVERY_UNKNOWN_SSRC: | 1370 case webrtc::PacketReceiver::DELIVERY_UNKNOWN_SSRC: |
1371 break; | 1371 break; |
1372 } | 1372 } |
1373 | 1373 |
1374 uint32 ssrc = 0; | 1374 uint32 ssrc = 0; |
1375 if (!GetRtpSsrc(packet->data(), packet->size(), &ssrc)) { | 1375 if (!GetRtpSsrc(packet->data(), packet->size(), &ssrc)) { |
1376 return; | 1376 return; |
1377 } | 1377 } |
1378 | 1378 |
1379 // TODO(pbos): Ignore unsignalled packets that don't use the video payload | 1379 int payload_type = 0; |
1380 // (prevent creating default receivers for RTX configured as if it would | 1380 if (!GetRtpPayloadType(packet->data(), packet->size(), &payload_type)) { |
1381 // receive media payloads on those SSRCs). | 1381 return; |
| 1382 } |
| 1383 |
| 1384 // See if this payload_type is registered as one that usually gets its own |
| 1385 // SSRC (RTX) or at least is safe to drop either way (ULPFEC). If it is, and |
| 1386 // it wasn't handled above by DeliverPacket, that means we don't know what |
| 1387 // stream it associates with, and we shouldn't ever create an implicit channel |
| 1388 // for these. |
| 1389 for (auto& codec : recv_codecs_) { |
| 1390 if (payload_type == codec.rtx_payload_type || |
| 1391 payload_type == codec.fec.red_rtx_payload_type || |
| 1392 payload_type == codec.fec.ulpfec_payload_type) { |
| 1393 return; |
| 1394 } |
| 1395 } |
| 1396 |
1382 switch (unsignalled_ssrc_handler_->OnUnsignalledSsrc(this, ssrc)) { | 1397 switch (unsignalled_ssrc_handler_->OnUnsignalledSsrc(this, ssrc)) { |
1383 case UnsignalledSsrcHandler::kDropPacket: | 1398 case UnsignalledSsrcHandler::kDropPacket: |
1384 return; | 1399 return; |
1385 case UnsignalledSsrcHandler::kDeliverPacket: | 1400 case UnsignalledSsrcHandler::kDeliverPacket: |
1386 break; | 1401 break; |
1387 } | 1402 } |
1388 | 1403 |
1389 if (call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, | 1404 if (call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, |
1390 reinterpret_cast<const uint8_t*>(packet->data()), packet->size()) != | 1405 reinterpret_cast<const uint8_t*>(packet->data()), packet->size()) != |
1391 webrtc::PacketReceiver::DELIVERY_OK) { | 1406 webrtc::PacketReceiver::DELIVERY_OK) { |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2595 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2581 } | 2596 } |
2582 } | 2597 } |
2583 | 2598 |
2584 return video_codecs; | 2599 return video_codecs; |
2585 } | 2600 } |
2586 | 2601 |
2587 } // namespace cricket | 2602 } // namespace cricket |
2588 | 2603 |
2589 #endif // HAVE_WEBRTC_VIDEO | 2604 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |