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

Side by Side Diff: webrtc/video/rtp_stream_receiver.cc

Issue 2573593003: Rename RtpPayloadTypeRegistry::SetCodec() to ::AddCodec(). (Closed)
Patch Set: Created 4 years 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 | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/video_receive_stream.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) 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
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 rtp_payload_registry_.SetRtxSsrc(kv.second.ssrc); 166 rtp_payload_registry_.SetRtxSsrc(kv.second.ssrc);
167 rtp_payload_registry_.SetRtxPayloadType(kv.second.payload_type, 167 rtp_payload_registry_.SetRtxPayloadType(kv.second.payload_type,
168 kv.first); 168 kv.first);
169 } 169 }
170 170
171 if (IsUlpfecEnabled()) { 171 if (IsUlpfecEnabled()) {
172 VideoCodec ulpfec_codec = {}; 172 VideoCodec ulpfec_codec = {};
173 ulpfec_codec.codecType = kVideoCodecULPFEC; 173 ulpfec_codec.codecType = kVideoCodecULPFEC;
174 strncpy(ulpfec_codec.plName, "ulpfec", sizeof(ulpfec_codec.plName)); 174 strncpy(ulpfec_codec.plName, "ulpfec", sizeof(ulpfec_codec.plName));
175 ulpfec_codec.plType = config_.rtp.ulpfec.ulpfec_payload_type; 175 ulpfec_codec.plType = config_.rtp.ulpfec.ulpfec_payload_type;
176 RTC_CHECK(SetReceiveCodec(ulpfec_codec)); 176 RTC_CHECK(AddReceiveCodec(ulpfec_codec));
177 } 177 }
178 178
179 if (IsRedEnabled()) { 179 if (IsRedEnabled()) {
180 VideoCodec red_codec = {}; 180 VideoCodec red_codec = {};
181 red_codec.codecType = kVideoCodecRED; 181 red_codec.codecType = kVideoCodecRED;
182 strncpy(red_codec.plName, "red", sizeof(red_codec.plName)); 182 strncpy(red_codec.plName, "red", sizeof(red_codec.plName));
183 red_codec.plType = config_.rtp.ulpfec.red_payload_type; 183 red_codec.plType = config_.rtp.ulpfec.red_payload_type;
184 RTC_CHECK(SetReceiveCodec(red_codec)); 184 RTC_CHECK(AddReceiveCodec(red_codec));
185 if (config_.rtp.ulpfec.red_rtx_payload_type != -1) { 185 if (config_.rtp.ulpfec.red_rtx_payload_type != -1) {
186 rtp_payload_registry_.SetRtxPayloadType( 186 rtp_payload_registry_.SetRtxPayloadType(
187 config_.rtp.ulpfec.red_rtx_payload_type, 187 config_.rtp.ulpfec.red_rtx_payload_type,
188 config_.rtp.ulpfec.red_payload_type); 188 config_.rtp.ulpfec.red_payload_type);
189 } 189 }
190 } 190 }
191 191
192 if (config_.rtp.rtcp_xr.receiver_reference_time_report) 192 if (config_.rtp.rtcp_xr.receiver_reference_time_report)
193 rtp_rtcp_->SetRtcpXrRrtrStatus(true); 193 rtp_rtcp_->SetRtcpXrRrtrStatus(true);
194 194
(...skipping 21 matching lines...) Expand all
216 216
217 if (jitter_buffer_experiment_) 217 if (jitter_buffer_experiment_)
218 process_thread_->DeRegisterModule(nack_module_.get()); 218 process_thread_->DeRegisterModule(nack_module_.get());
219 219
220 packet_router_->RemoveRtpModule(rtp_rtcp_.get()); 220 packet_router_->RemoveRtpModule(rtp_rtcp_.get());
221 rtp_rtcp_->SetREMBStatus(false); 221 rtp_rtcp_->SetREMBStatus(false);
222 remb_->RemoveReceiveChannel(rtp_rtcp_.get()); 222 remb_->RemoveReceiveChannel(rtp_rtcp_.get());
223 UpdateHistograms(); 223 UpdateHistograms();
224 } 224 }
225 225
226 bool RtpStreamReceiver::SetReceiveCodec(const VideoCodec& video_codec) { 226 bool RtpStreamReceiver::AddReceiveCodec(const VideoCodec& video_codec) {
227 int8_t old_pltype = -1; 227 int8_t old_pltype = -1;
228 if (rtp_payload_registry_.ReceivePayloadType(video_codec, &old_pltype) != 228 if (rtp_payload_registry_.ReceivePayloadType(video_codec, &old_pltype) !=
229 -1) { 229 -1) {
230 rtp_payload_registry_.DeRegisterReceivePayload(old_pltype); 230 rtp_payload_registry_.DeRegisterReceivePayload(old_pltype);
231 } 231 }
232 232
233 return rtp_payload_registry_.RegisterReceivePayload(video_codec) == 0; 233 return rtp_payload_registry_.RegisterReceivePayload(video_codec) == 0;
234 } 234 }
235 235
236 uint32_t RtpStreamReceiver::GetRemoteSsrc() const { 236 uint32_t RtpStreamReceiver::GetRemoteSsrc() const {
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 const std::string& extension, int id) { 644 const std::string& extension, int id) {
645 // One-byte-extension local identifiers are in the range 1-14 inclusive. 645 // One-byte-extension local identifiers are in the range 1-14 inclusive.
646 RTC_DCHECK_GE(id, 1); 646 RTC_DCHECK_GE(id, 1);
647 RTC_DCHECK_LE(id, 14); 647 RTC_DCHECK_LE(id, 14);
648 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); 648 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
649 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( 649 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension(
650 StringToRtpExtensionType(extension), id)); 650 StringToRtpExtensionType(extension), id));
651 } 651 }
652 652
653 } // namespace webrtc 653 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698