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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc

Issue 2532663002: RtpReceiver: Add RegisterReceivePayload function for VideoCodec (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/modules/rtp_rtcp/source/rtp_receiver_impl.h ('k') | no next file » | 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (created_new_payload) { 93 if (created_new_payload) {
94 if (rtp_media_receiver_->OnNewPayloadTypeCreated(audio_codec) != 0) { 94 if (rtp_media_receiver_->OnNewPayloadTypeCreated(audio_codec) != 0) {
95 LOG(LS_ERROR) << "Failed to register payload: " << audio_codec.plname 95 LOG(LS_ERROR) << "Failed to register payload: " << audio_codec.plname
96 << "/" << static_cast<int>(audio_codec.pltype); 96 << "/" << static_cast<int>(audio_codec.pltype);
97 return -1; 97 return -1;
98 } 98 }
99 } 99 }
100 return result; 100 return result;
101 } 101 }
102 102
103 int32_t RtpReceiverImpl::RegisterReceivePayload(const VideoCodec& video_codec) {
104 rtc::CritScope lock(&critical_section_rtp_receiver_);
105 return rtp_payload_registry_->RegisterReceivePayload(video_codec);
106 }
107
103 // TODO(magjed): Remove once external code is updated. 108 // TODO(magjed): Remove once external code is updated.
104 int32_t RtpReceiverImpl::RegisterReceivePayload( 109 int32_t RtpReceiverImpl::RegisterReceivePayload(
105 const char payload_name[RTP_PAYLOAD_NAME_SIZE], 110 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
106 const int8_t payload_type, 111 const int8_t payload_type,
107 const uint32_t frequency, 112 const uint32_t frequency,
108 const size_t channels, 113 const size_t channels,
109 const uint32_t rate) { 114 const uint32_t rate) {
110 CodecInst codec; 115 CodecInst codec;
111 codec.pltype = payload_type; 116 codec.pltype = payload_type;
112 strncpy(codec.plname, payload_name, RTP_PAYLOAD_NAME_SIZE); 117 strncpy(codec.plname, payload_name, RTP_PAYLOAD_NAME_SIZE);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 // implementations might have CSRC 0 as a valid value. 471 // implementations might have CSRC 0 as a valid value.
467 if (num_csrcs_diff > 0) { 472 if (num_csrcs_diff > 0) {
468 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); 473 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true);
469 } else if (num_csrcs_diff < 0) { 474 } else if (num_csrcs_diff < 0) {
470 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); 475 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false);
471 } 476 }
472 } 477 }
473 } 478 }
474 479
475 } // namespace webrtc 480 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698