Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
| 12 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | |
| 12 | 13 |
| 13 #include <assert.h> | 14 #include <assert.h> |
| 14 #include <math.h> // ceil | 15 #include <math.h> // ceil |
| 15 #include <string.h> // memcpy | 16 #include <string.h> // memcpy |
| 16 | 17 |
| 17 namespace webrtc { | 18 namespace webrtc { |
| 18 | 19 |
| 19 namespace RTCPUtility { | 20 namespace RTCPUtility { |
| 20 | 21 |
| 21 NackStats::NackStats() | 22 NackStats::NackStats() |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 { | 70 { |
| 70 return _packetType; | 71 return _packetType; |
| 71 } | 72 } |
| 72 | 73 |
| 73 const RTCPUtility::RTCPPacket& | 74 const RTCPUtility::RTCPPacket& |
| 74 RTCPUtility::RTCPParserV2::Packet() const | 75 RTCPUtility::RTCPParserV2::Packet() const |
| 75 { | 76 { |
| 76 return _packet; | 77 return _packet; |
| 77 } | 78 } |
| 78 | 79 |
| 80 rtcp::RtcpPacket* RTCPUtility::RTCPParserV2::ReleaseRtcpPacket() { | |
| 81 return rtcp_packet_.release(); | |
| 82 } | |
| 79 RTCPUtility::RTCPPacketTypes | 83 RTCPUtility::RTCPPacketTypes |
| 80 RTCPUtility::RTCPParserV2::Begin() | 84 RTCPUtility::RTCPParserV2::Begin() |
| 81 { | 85 { |
| 82 _ptrRTCPData = _ptrRTCPDataBegin; | 86 _ptrRTCPData = _ptrRTCPDataBegin; |
| 83 | 87 |
| 84 return Iterate(); | 88 return Iterate(); |
| 85 } | 89 } |
| 86 | 90 |
| 87 RTCPUtility::RTCPPacketTypes | 91 RTCPUtility::RTCPPacketTypes |
| 88 RTCPUtility::RTCPParserV2::Iterate() | 92 RTCPUtility::RTCPParserV2::Iterate() |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1207 | 1211 |
| 1208 return true; | 1212 return true; |
| 1209 } | 1213 } |
| 1210 case 5: | 1214 case 5: |
| 1211 { | 1215 { |
| 1212 // RTCP-SR-REQ Rapid Synchronisation of RTP Flows | 1216 // RTCP-SR-REQ Rapid Synchronisation of RTP Flows |
| 1213 // draft-perkins-avt-rapid-rtp-sync-03.txt | 1217 // draft-perkins-avt-rapid-rtp-sync-03.txt |
| 1214 // trigger a new RTCP SR | 1218 // trigger a new RTCP SR |
| 1215 _packetType = RTCPPacketTypes::kRtpfbSrReq; | 1219 _packetType = RTCPPacketTypes::kRtpfbSrReq; |
| 1216 | 1220 |
| 1217 // Note: No state transition, SR REQ is empty! | 1221 // Note: No state transition, SR REQ is empty! |
|
stefan-webrtc
2015/09/17 10:33:19
May want to add a comment similar to this below as
sprang_webrtc
2015/09/17 15:08:28
Done.
| |
| 1218 return true; | 1222 return true; |
| 1219 } | 1223 } |
| 1224 case 15: { | |
| 1225 _packetType = RTCPPacketTypes::kTransportFeedback; | |
| 1226 rtcp_packet_ = | |
| 1227 rtcp::TransportFeedback::ParseFrom(_ptrRTCPData - 12, length); | |
| 1228 if (rtcp_packet_.get() == nullptr) { | |
| 1229 EndCurrentBlock(); | |
| 1230 return false; | |
| 1231 } | |
| 1232 | |
| 1233 _ptrRTCPData += rtcp_packet_->BlockLength(); | |
| 1234 return true; | |
| 1235 } | |
| 1220 default: | 1236 default: |
| 1221 break; | 1237 break; |
| 1222 } | 1238 } |
| 1223 EndCurrentBlock(); | 1239 EndCurrentBlock(); |
| 1224 return false; | 1240 return false; |
| 1225 } | 1241 } |
| 1226 else if (header.PT == PT_PSFB) | 1242 else if (header.PT == PT_PSFB) |
| 1227 { | 1243 { |
| 1228 // Payload specific feedback | 1244 // Payload specific feedback |
| 1229 switch (header.IC) | 1245 switch (header.IC) |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1683 RTCPUtility::RTCPPacketIterator::Current() | 1699 RTCPUtility::RTCPPacketIterator::Current() |
| 1684 { | 1700 { |
| 1685 if (!_ptrBlock) | 1701 if (!_ptrBlock) |
| 1686 { | 1702 { |
| 1687 return NULL; | 1703 return NULL; |
| 1688 } | 1704 } |
| 1689 | 1705 |
| 1690 return &_header; | 1706 return &_header; |
| 1691 } | 1707 } |
| 1692 } // namespace webrtc | 1708 } // namespace webrtc |
| OLD | NEW |