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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 1909333002: Switch voice transport to use Call and Stream instead of VoENetwork. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove VoENetwork from perf test. Created 4 years, 8 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
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 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 "disabled"); 1479 "disabled");
1480 return 0; 1480 return 0;
1481 } 1481 }
1482 _externalTransport = false; 1482 _externalTransport = false;
1483 _transportPtr = NULL; 1483 _transportPtr = NULL;
1484 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 1484 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
1485 "DeRegisterExternalTransport() all transport is disabled"); 1485 "DeRegisterExternalTransport() all transport is disabled");
1486 return 0; 1486 return 0;
1487 } 1487 }
1488 1488
1489 int32_t Channel::ReceivedRTPPacket(const int8_t* data, 1489 int32_t Channel::ReceivedRTPPacket(const uint8_t* received_packet,
1490 size_t length, 1490 size_t length,
1491 const PacketTime& packet_time) { 1491 const PacketTime& packet_time) {
1492 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 1492 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
1493 "Channel::ReceivedRTPPacket()"); 1493 "Channel::ReceivedRTPPacket()");
1494 1494
1495 // Store playout timestamp for the received RTP packet 1495 // Store playout timestamp for the received RTP packet
1496 UpdatePlayoutTimestamp(false); 1496 UpdatePlayoutTimestamp(false);
1497 1497
1498 const uint8_t* received_packet = reinterpret_cast<const uint8_t*>(data);
1499 RTPHeader header; 1498 RTPHeader header;
1500 if (!rtp_header_parser_->Parse(received_packet, length, &header)) { 1499 if (!rtp_header_parser_->Parse(received_packet, length, &header)) {
1501 WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVoice, _channelId, 1500 WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVoice, _channelId,
1502 "Incoming packet: invalid RTP header"); 1501 "Incoming packet: invalid RTP header");
1503 return -1; 1502 return -1;
1504 } 1503 }
1505 header.payload_type_frequency = 1504 header.payload_type_frequency =
1506 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType); 1505 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType);
1507 if (header.payload_type_frequency < 0) 1506 if (header.payload_type_frequency < 0)
1508 return -1; 1507 return -1;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 StreamStatistician* statistician = 1577 StreamStatistician* statistician =
1579 rtp_receive_statistics_->GetStatistician(header.ssrc); 1578 rtp_receive_statistics_->GetStatistician(header.ssrc);
1580 if (!statistician) 1579 if (!statistician)
1581 return false; 1580 return false;
1582 // Check if this is a retransmission. 1581 // Check if this is a retransmission.
1583 int64_t min_rtt = 0; 1582 int64_t min_rtt = 0;
1584 _rtpRtcpModule->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); 1583 _rtpRtcpModule->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
1585 return !in_order && statistician->IsRetransmitOfOldPacket(header, min_rtt); 1584 return !in_order && statistician->IsRetransmitOfOldPacket(header, min_rtt);
1586 } 1585 }
1587 1586
1588 int32_t Channel::ReceivedRTCPPacket(const int8_t* data, size_t length) { 1587 int32_t Channel::ReceivedRTCPPacket(const uint8_t* data, size_t length) {
1589 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 1588 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
1590 "Channel::ReceivedRTCPPacket()"); 1589 "Channel::ReceivedRTCPPacket()");
1591 // Store playout timestamp for the received RTCP packet 1590 // Store playout timestamp for the received RTCP packet
1592 UpdatePlayoutTimestamp(true); 1591 UpdatePlayoutTimestamp(true);
1593 1592
1594 // Deliver RTCP packet to RTP/RTCP module for parsing 1593 // Deliver RTCP packet to RTP/RTCP module for parsing
1595 if (_rtpRtcpModule->IncomingRtcpPacket((const uint8_t*)data, length) == -1) { 1594 if (_rtpRtcpModule->IncomingRtcpPacket(data, length) == -1) {
1596 _engineStatisticsPtr->SetLastError( 1595 _engineStatisticsPtr->SetLastError(
1597 VE_SOCKET_TRANSPORT_MODULE_ERROR, kTraceWarning, 1596 VE_SOCKET_TRANSPORT_MODULE_ERROR, kTraceWarning,
1598 "Channel::IncomingRTPPacket() RTCP packet is invalid"); 1597 "Channel::IncomingRTPPacket() RTCP packet is invalid");
1599 } 1598 }
1600 1599
1601 int64_t rtt = GetRTT(true); 1600 int64_t rtt = GetRTT(true);
1602 if (rtt == 0) { 1601 if (rtt == 0) {
1603 // Waiting for valid RTT. 1602 // Waiting for valid RTT.
1604 return 0; 1603 return 0;
1605 } 1604 }
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3549 int64_t min_rtt = 0; 3548 int64_t min_rtt = 0;
3550 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3549 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3551 0) { 3550 0) {
3552 return 0; 3551 return 0;
3553 } 3552 }
3554 return rtt; 3553 return rtt;
3555 } 3554 }
3556 3555
3557 } // namespace voe 3556 } // namespace voe
3558 } // namespace webrtc 3557 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698