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

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

Issue 2274573002: Adjust RtcpReceiver to be testable with callbacks: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: RtpRtcpSender -> ModuleRtpRtcp Created 4 years, 3 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 | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type, 218 void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type,
219 int associated_payload_type) { 219 int associated_payload_type) {
220 rtp_sender_.SetRtxPayloadType(payload_type, associated_payload_type); 220 rtp_sender_.SetRtxPayloadType(payload_type, associated_payload_type);
221 } 221 }
222 222
223 int32_t ModuleRtpRtcpImpl::IncomingRtcpPacket( 223 int32_t ModuleRtpRtcpImpl::IncomingRtcpPacket(
224 const uint8_t* rtcp_packet, 224 const uint8_t* rtcp_packet,
225 const size_t length) { 225 const size_t length) {
226 // Allow receive of non-compound RTCP packets. 226 return rtcp_receiver_.IncomingPacket(rtcp_packet, length) ? 0 : -1;
227 RTCPUtility::RTCPParserV2 rtcp_parser(rtcp_packet, length, true);
228
229 const bool valid_rtcpheader = rtcp_parser.IsValid();
230 if (!valid_rtcpheader) {
231 LOG(LS_WARNING) << "Incoming invalid RTCP packet";
232 return -1;
233 }
234 RTCPHelp::RTCPPacketInformation rtcp_packet_information;
235 int32_t ret_val =
236 rtcp_receiver_.IncomingRTCPPacket(rtcp_packet_information, &rtcp_parser);
237 if (ret_val == 0) {
238 rtcp_receiver_.TriggerCallbacksFromRTCPPacket(rtcp_packet_information);
239 }
240 return ret_val;
241 } 227 }
242 228
243 int32_t ModuleRtpRtcpImpl::RegisterSendPayload( 229 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(
244 const CodecInst& voice_codec) { 230 const CodecInst& voice_codec) {
245 return rtp_sender_.RegisterPayload( 231 return rtp_sender_.RegisterPayload(
246 voice_codec.plname, voice_codec.pltype, voice_codec.plfreq, 232 voice_codec.plname, voice_codec.pltype, voice_codec.plfreq,
247 voice_codec.channels, (voice_codec.rate < 0) ? 0 : voice_codec.rate); 233 voice_codec.channels, (voice_codec.rate < 0) ? 0 : voice_codec.rate);
248 } 234 }
249 235
250 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) { 236 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) {
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( 942 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback(
957 StreamDataCountersCallback* callback) { 943 StreamDataCountersCallback* callback) {
958 rtp_sender_.RegisterRtpStatisticsCallback(callback); 944 rtp_sender_.RegisterRtpStatisticsCallback(callback);
959 } 945 }
960 946
961 StreamDataCountersCallback* 947 StreamDataCountersCallback*
962 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { 948 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const {
963 return rtp_sender_.GetRtpStatisticsCallback(); 949 return rtp_sender_.GetRtpStatisticsCallback();
964 } 950 }
965 } // namespace webrtc 951 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698