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

Unified Diff: webrtc/call/call.cc

Issue 2693123002: Make Call::OnRecoveredPacket parse RTP header and call OnRtpPacket. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index ec8053768d794bdc814b0a290a2d8b434b3d0ef1..e8c4c0cf54e9db3a164dc925a4e1701aa62c00ee 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -177,7 +177,7 @@ class Call : public webrtc::Call,
rtc::Optional<RtpPacketReceived> ParseRtpPacket(const uint8_t* packet,
size_t length,
- const PacketTime& packet_time)
+ const PacketTime* packet_time)
SHARED_LOCKS_REQUIRED(receive_crit_);
void UpdateSendHistograms() EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
@@ -398,7 +398,7 @@ Call::~Call() {
rtc::Optional<RtpPacketReceived> Call::ParseRtpPacket(
const uint8_t* packet,
size_t length,
- const PacketTime& packet_time) {
+ const PacketTime* packet_time) {
RtpPacketReceived parsed_packet;
if (!parsed_packet.Parse(packet, length))
return rtc::Optional<RtpPacketReceived>();
@@ -408,8 +408,8 @@ rtc::Optional<RtpPacketReceived> Call::ParseRtpPacket(
parsed_packet.IdentifyExtensions(it->second.extensions);
int64_t arrival_time_ms;
- if (packet_time.timestamp != -1) {
- arrival_time_ms = (packet_time.timestamp + 500) / 1000;
+ if (packet_time && packet_time->timestamp != -1) {
+ arrival_time_ms = (packet_time->timestamp + 500) / 1000;
} else {
arrival_time_ms = clock_->TimeInMilliseconds();
}
@@ -1184,7 +1184,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
// TODO(nisse): We should parse the RTP header only here, and pass
// on parsed_packet to the receive streams.
rtc::Optional<RtpPacketReceived> parsed_packet =
- ParseRtpPacket(packet, length, packet_time);
+ ParseRtpPacket(packet, length, &packet_time);
if (!parsed_packet)
return DELIVERY_PACKET_ERROR;
@@ -1254,12 +1254,20 @@ PacketReceiver::DeliveryStatus Call::DeliverPacket(
// TODO(brandtr): Update this member function when we support protecting
// audio packets with FlexFEC.
bool Call::OnRecoveredPacket(const uint8_t* packet, size_t length) {
brandtr 2017/02/15 12:20:50 could the return value be turned into void here as
nisse-webrtc 2017/02/15 13:59:14 That's a change of the RecoveredPacketReceiver int
- uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]);
ReadLockScoped read_lock(*receive_crit_);
- auto it = video_receive_ssrcs_.find(ssrc);
+ rtc::Optional<RtpPacketReceived> parsed_packet =
+ ParseRtpPacket(packet, length, nullptr);
+ if (!parsed_packet)
+ return false;
+
+ parsed_packet->set_recovered(true);
+
+ auto it = video_receive_ssrcs_.find(parsed_packet->Ssrc());
if (it == video_receive_ssrcs_.end())
return false;
- return it->second->OnRecoveredPacket(packet, length);
+
+ it->second->OnRtpPacket(*parsed_packet);
+ return true;
}
void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,

Powered by Google App Engine
This is Rietveld 408576698