| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 10 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 RTPHeader* header) const { | 51 RTPHeader* header) const { |
| 52 RtpUtility::RtpHeaderParser rtp_parser(packet, length); | 52 RtpUtility::RtpHeaderParser rtp_parser(packet, length); |
| 53 memset(header, 0, sizeof(*header)); | 53 memset(header, 0, sizeof(*header)); |
| 54 | 54 |
| 55 RtpHeaderExtensionMap map; | 55 RtpHeaderExtensionMap map; |
| 56 { | 56 { |
| 57 CriticalSectionScoped cs(critical_section_.get()); | 57 CriticalSectionScoped cs(critical_section_.get()); |
| 58 rtp_header_extension_map_.GetCopy(&map); | 58 rtp_header_extension_map_.GetCopy(&map); |
| 59 } | 59 } |
| 60 | 60 |
| 61 const bool valid_rtpheader = rtp_parser.Parse(*header, &map); | 61 const bool valid_rtpheader = rtp_parser.Parse(header, &map); |
| 62 if (!valid_rtpheader) { | 62 if (!valid_rtpheader) { |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 return true; | 65 return true; |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RTPExtensionType type, | 68 bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RTPExtensionType type, |
| 69 uint8_t id) { | 69 uint8_t id) { |
| 70 CriticalSectionScoped cs(critical_section_.get()); | 70 CriticalSectionScoped cs(critical_section_.get()); |
| 71 return rtp_header_extension_map_.Register(type, id) == 0; | 71 return rtp_header_extension_map_.Register(type, id) == 0; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool RtpHeaderParserImpl::DeregisterRtpHeaderExtension(RTPExtensionType type) { | 74 bool RtpHeaderParserImpl::DeregisterRtpHeaderExtension(RTPExtensionType type) { |
| 75 CriticalSectionScoped cs(critical_section_.get()); | 75 CriticalSectionScoped cs(critical_section_.get()); |
| 76 return rtp_header_extension_map_.Deregister(type) == 0; | 76 return rtp_header_extension_map_.Deregister(type) == 0; |
| 77 } | 77 } |
| 78 } // namespace webrtc | 78 } // namespace webrtc |
| OLD | NEW |