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

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

Issue 2523843002: Send audio and video codecs to RTPPayloadRegistry (Closed)
Patch Set: Change strcpy to strncpy 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/modules/rtp_rtcp/test/testAPI/test_api_video.cc ('k') | webrtc/voice_engine/channel.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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 process_thread_->DeRegisterModule(nack_module_.get()); 219 process_thread_->DeRegisterModule(nack_module_.get());
220 220
221 packet_router_->RemoveRtpModule(rtp_rtcp_.get()); 221 packet_router_->RemoveRtpModule(rtp_rtcp_.get());
222 rtp_rtcp_->SetREMBStatus(false); 222 rtp_rtcp_->SetREMBStatus(false);
223 remb_->RemoveReceiveChannel(rtp_rtcp_.get()); 223 remb_->RemoveReceiveChannel(rtp_rtcp_.get());
224 UpdateHistograms(); 224 UpdateHistograms();
225 } 225 }
226 226
227 bool RtpStreamReceiver::SetReceiveCodec(const VideoCodec& video_codec) { 227 bool RtpStreamReceiver::SetReceiveCodec(const VideoCodec& video_codec) {
228 int8_t old_pltype = -1; 228 int8_t old_pltype = -1;
229 if (rtp_payload_registry_.ReceivePayloadType( 229 if (rtp_payload_registry_.ReceivePayloadType(video_codec, &old_pltype) !=
230 video_codec.plName, kVideoPayloadTypeFrequency, 0, 230 -1) {
231 video_codec.maxBitrate, &old_pltype) != -1) {
232 rtp_payload_registry_.DeRegisterReceivePayload(old_pltype); 231 rtp_payload_registry_.DeRegisterReceivePayload(old_pltype);
233 } 232 }
234 233
235 return rtp_receiver_->RegisterReceivePayload( 234 return rtp_payload_registry_.RegisterReceivePayload(video_codec) == 0;
236 video_codec.plName, video_codec.plType, kVideoPayloadTypeFrequency,
237 0, 0) == 0;
238 } 235 }
239 236
240 uint32_t RtpStreamReceiver::GetRemoteSsrc() const { 237 uint32_t RtpStreamReceiver::GetRemoteSsrc() const {
241 return rtp_receiver_->SSRC(); 238 return rtp_receiver_->SSRC();
242 } 239 }
243 240
244 int RtpStreamReceiver::GetCsrcs(uint32_t* csrcs) const { 241 int RtpStreamReceiver::GetCsrcs(uint32_t* csrcs) const {
245 return rtp_receiver_->CSRCs(csrcs); 242 return rtp_receiver_->CSRCs(csrcs);
246 } 243 }
247 244
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 const std::string& extension, int id) { 637 const std::string& extension, int id) {
641 // One-byte-extension local identifiers are in the range 1-14 inclusive. 638 // One-byte-extension local identifiers are in the range 1-14 inclusive.
642 RTC_DCHECK_GE(id, 1); 639 RTC_DCHECK_GE(id, 1);
643 RTC_DCHECK_LE(id, 14); 640 RTC_DCHECK_LE(id, 14);
644 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); 641 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
645 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( 642 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension(
646 StringToRtpExtensionType(extension), id)); 643 StringToRtpExtensionType(extension), id));
647 } 644 }
648 645
649 } // namespace webrtc 646 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/test/testAPI/test_api_video.cc ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698