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

Unified Diff: webrtc/video/rtp_stream_receiver.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/video/rtp_stream_receiver.cc
diff --git a/webrtc/video/rtp_stream_receiver.cc b/webrtc/video/rtp_stream_receiver.cc
index cb1ffc90445ba869c6465ee97386e738eaa76209..264e031b49b83b02654c37f9f995b734ed01234c 100644
--- a/webrtc/video/rtp_stream_receiver.cc
+++ b/webrtc/video/rtp_stream_receiver.cc
@@ -291,6 +291,9 @@ int32_t RtpStreamReceiver::OnReceivedPayloadData(
return 0;
}
+// TODO(nisse): Try to delete this method. Obstacles: It is used by
+// ParseAndHandleEncapsulatingHeader, for handling Rtx packets. And
+// it's part of the RtpData interface which we implement.
bool RtpStreamReceiver::OnRecoveredPacket(const uint8_t* rtp_packet,
nisse-webrtc 2017/02/14 10:24:33 Is there any easy way to get rid of this method an
brandtr 2017/02/15 12:20:50 No, RTX, RED, and ULPFEC should not go back to Cal
nisse-webrtc 2017/02/15 13:59:15 This is tricky. Parsing extensions logically belon
size_t rtp_packet_length) {
RTPHeader header;
@@ -318,6 +321,8 @@ void RtpStreamReceiver::OnIncomingSSRCChanged(const uint32_t ssrc) {
rtp_rtcp_->SetRemoteSSRC(ssrc);
}
+// This method handles both regular Rtp packets and packets recovered
brandtr 2017/02/15 12:20:50 Nits: "RTP packets". "FlexFEC".
nisse-webrtc 2017/02/15 13:59:15 Done.
+// via Flexfec.
void RtpStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
{
rtc::CritScope lock(&receive_cs_);
@@ -325,29 +330,30 @@ void RtpStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
return;
}
}
+ if (!packet.recovered()) {
+ int64_t now_ms = clock_->TimeInMilliseconds();
- int64_t now_ms = clock_->TimeInMilliseconds();
-
- {
- // Periodically log the RTP header of incoming packets.
- rtc::CritScope lock(&receive_cs_);
- if (now_ms - last_packet_log_ms_ > kPacketLogIntervalMs) {
- std::stringstream ss;
- ss << "Packet received on SSRC: " << packet.Ssrc()
- << " with payload type: " << static_cast<int>(packet.PayloadType())
- << ", timestamp: " << packet.Timestamp()
- << ", sequence number: " << packet.SequenceNumber()
- << ", arrival time: " << packet.arrival_time_ms();
- int32_t time_offset;
- if (packet.GetExtension<TransmissionOffset>(&time_offset)) {
- ss << ", toffset: " << time_offset;
- }
- uint32_t send_time;
- if (packet.GetExtension<AbsoluteSendTime>(&send_time)) {
- ss << ", abs send time: " << send_time;
+ {
+ // Periodically log the RTP header of incoming packets.
+ rtc::CritScope lock(&receive_cs_);
+ if (now_ms - last_packet_log_ms_ > kPacketLogIntervalMs) {
+ std::stringstream ss;
+ ss << "Packet received on SSRC: " << packet.Ssrc()
+ << " with payload type: " << static_cast<int>(packet.PayloadType())
+ << ", timestamp: " << packet.Timestamp()
+ << ", sequence number: " << packet.SequenceNumber()
+ << ", arrival time: " << packet.arrival_time_ms();
+ int32_t time_offset;
+ if (packet.GetExtension<TransmissionOffset>(&time_offset)) {
+ ss << ", toffset: " << time_offset;
+ }
+ uint32_t send_time;
+ if (packet.GetExtension<AbsoluteSendTime>(&send_time)) {
+ ss << ", abs send time: " << send_time;
+ }
+ LOG(LS_INFO) << ss.str();
+ last_packet_log_ms_ = now_ms;
}
- LOG(LS_INFO) << ss.str();
- last_packet_log_ms_ = now_ms;
}
}
@@ -359,13 +365,19 @@ void RtpStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
header.payload_type_frequency = kVideoPayloadTypeFrequency;
bool in_order = IsPacketInOrder(header);
- rtp_payload_registry_.SetIncomingPayloadType(header);
+ if (!packet.recovered()) {
brandtr 2017/02/15 12:20:50 Could you reorder the lines in this method, so tha
nisse-webrtc 2017/02/15 13:59:15 I'm not sure how order matters. And I'd prefer to
+ // TODO(nisse): Why isn't this done for recovered packets?
+ rtp_payload_registry_.SetIncomingPayloadType(header);
+ }
ReceivePacket(packet.data(), packet.size(), header, in_order);
// Update receive statistics after ReceivePacket.
// Receive statistics will be reset if the payload type changes (make sure
// that the first packet is included in the stats).
- rtp_receive_statistics_->IncomingPacket(
- header, packet.size(), IsPacketRetransmitted(header, in_order));
+ if (!packet.recovered()) {
+ // TODO(nisse): Should we pass a recovered flag to stats?
brandtr 2017/02/15 12:20:50 That would be one way of implementing bugs.webrtc.
nisse-webrtc 2017/02/15 13:59:15 I'm adding a TODO and bug reference.
+ rtp_receive_statistics_->IncomingPacket(
+ header, packet.size(), IsPacketRetransmitted(header, in_order));
+ }
}
int32_t RtpStreamReceiver::RequestKeyFrame() {

Powered by Google App Engine
This is Rietveld 408576698