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

Side by Side Diff: webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h

Issue 1394573004: Fix RTPPayloadRegistry to correctly restore RTX, if a valid mapping exists. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CR comments and git cl format Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 bool RtxEnabled() const; 76 bool RtxEnabled() const;
77 77
78 void SetRtxSsrc(uint32_t ssrc); 78 void SetRtxSsrc(uint32_t ssrc);
79 79
80 bool GetRtxSsrc(uint32_t* ssrc) const; 80 bool GetRtxSsrc(uint32_t* ssrc) const;
81 81
82 void SetRtxPayloadType(int payload_type, int associated_payload_type); 82 void SetRtxPayloadType(int payload_type, int associated_payload_type);
83 83
84 bool IsRtx(const RTPHeader& header) const; 84 bool IsRtx(const RTPHeader& header) const;
85 85
86 bool RestoreOriginalPacket(uint8_t** restored_packet, 86 bool RestoreOriginalPacket(uint8_t* restored_packet,
87 const uint8_t* packet, 87 const uint8_t* packet,
88 size_t* packet_length, 88 size_t* packet_length,
89 uint32_t original_ssrc, 89 uint32_t original_ssrc,
90 const RTPHeader& header) const; 90 const RTPHeader& header) const;
91 91
92 bool IsRed(const RTPHeader& header) const; 92 bool IsRed(const RTPHeader& header) const;
93 93
94 // Returns true if the media of this RTP packet is encapsulated within an 94 // Returns true if the media of this RTP packet is encapsulated within an
95 // extra header, such as RTX or RED. 95 // extra header, such as RTX or RED.
96 bool IsEncapsulated(const RTPHeader& header) const; 96 bool IsEncapsulated(const RTPHeader& header) const;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void set_last_received_payload_type(int8_t last_received_payload_type) { 131 void set_last_received_payload_type(int8_t last_received_payload_type) {
132 CriticalSectionScoped cs(crit_sect_.get()); 132 CriticalSectionScoped cs(crit_sect_.get());
133 last_received_payload_type_ = last_received_payload_type; 133 last_received_payload_type_ = last_received_payload_type;
134 } 134 }
135 135
136 int8_t last_received_media_payload_type() const { 136 int8_t last_received_media_payload_type() const {
137 CriticalSectionScoped cs(crit_sect_.get()); 137 CriticalSectionScoped cs(crit_sect_.get());
138 return last_received_media_payload_type_; 138 return last_received_media_payload_type_;
139 }; 139 };
140 140
141 bool use_rtx_payload_mapping_on_restore() const {
142 CriticalSectionScoped cs(crit_sect_.get());
143 return use_rtx_payload_mapping_on_restore_;
144 }
145
146 void set_use_rtx_payload_mapping_on_restore(bool val) {
147 CriticalSectionScoped cs(crit_sect_.get());
148 use_rtx_payload_mapping_on_restore_ = val;
149 }
150
141 private: 151 private:
142 // Prunes the payload type map of the specific payload type, if it exists. 152 // Prunes the payload type map of the specific payload type, if it exists.
143 void DeregisterAudioCodecOrRedTypeRegardlessOfPayloadType( 153 void DeregisterAudioCodecOrRedTypeRegardlessOfPayloadType(
144 const char payload_name[RTP_PAYLOAD_NAME_SIZE], 154 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
145 const size_t payload_name_length, 155 const size_t payload_name_length,
146 const uint32_t frequency, 156 const uint32_t frequency,
147 const uint8_t channels, 157 const uint8_t channels,
148 const uint32_t rate); 158 const uint32_t rate);
149 159
150 bool IsRtxInternal(const RTPHeader& header) const; 160 bool IsRtxInternal(const RTPHeader& header) const;
151 161
152 rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_; 162 rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
153 RtpUtility::PayloadTypeMap payload_type_map_; 163 RtpUtility::PayloadTypeMap payload_type_map_;
154 rtc::scoped_ptr<RTPPayloadStrategy> rtp_payload_strategy_; 164 rtc::scoped_ptr<RTPPayloadStrategy> rtp_payload_strategy_;
155 int8_t red_payload_type_; 165 int8_t red_payload_type_;
156 int8_t ulpfec_payload_type_; 166 int8_t ulpfec_payload_type_;
157 int8_t incoming_payload_type_; 167 int8_t incoming_payload_type_;
158 int8_t last_received_payload_type_; 168 int8_t last_received_payload_type_;
159 int8_t last_received_media_payload_type_; 169 int8_t last_received_media_payload_type_;
160 bool rtx_; 170 bool rtx_;
161 // TODO(changbin): Remove rtx_payload_type_ once interop with old clients that 171 // TODO(changbin): Remove rtx_payload_type_ once interop with old clients that
162 // only understand one RTX PT is no longer needed. 172 // only understand one RTX PT is no longer needed.
163 int rtx_payload_type_; 173 int rtx_payload_type_;
164 // Mapping rtx_payload_type_map_[rtx] = associated. 174 // Mapping rtx_payload_type_map_[rtx] = associated.
165 std::map<int, int> rtx_payload_type_map_; 175 std::map<int, int> rtx_payload_type_map_;
176 // When true, use rtx_payload_type_map_ when restoring RTX packets to get the
177 // correct payload type.
178 bool use_rtx_payload_mapping_on_restore_;
166 uint32_t ssrc_rtx_; 179 uint32_t ssrc_rtx_;
167 }; 180 };
168 181
169 } // namespace webrtc 182 } // namespace webrtc
170 183
171 #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_PAYLOAD_REGISTRY_H_ 184 #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_PAYLOAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698