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

Unified Diff: webrtc/video/rtp_stream_receiver.cc

Issue 2681673004: Replace RtpStreamReceiver::DeliverRtp with 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 d49d0959f32fc826dd3da0cb26d7dda3fe1e0079..0025539fba20968b2af16cc707a60b588e47213a 100644
--- a/webrtc/video/rtp_stream_receiver.cc
+++ b/webrtc/video/rtp_stream_receiver.cc
@@ -26,6 +26,7 @@
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/include/ulpfec_receiver.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
#include "webrtc/modules/video_coding/frame_object.h"
#include "webrtc/modules/video_coding/h264_sprop_parameter_sets.h"
#include "webrtc/modules/video_coding/h264_sps_pps_tracker.h"
@@ -316,9 +317,7 @@ void RtpStreamReceiver::OnIncomingSSRCChanged(const uint32_t ssrc) {
rtp_rtcp_->SetRemoteSSRC(ssrc);
}
-bool RtpStreamReceiver::DeliverRtp(const uint8_t* rtp_packet,
- size_t rtp_packet_length,
- const PacketTime& packet_time) {
+bool RtpStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
{
rtc::CritScope lock(&receive_cs_);
if (!receiving_) {
@@ -327,16 +326,9 @@ bool RtpStreamReceiver::DeliverRtp(const uint8_t* rtp_packet,
}
RTPHeader header;
- if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length,
- &header)) {
- return false;
- }
- int64_t arrival_time_ms;
+ packet.GetHeader(&header);
+
int64_t now_ms = clock_->TimeInMilliseconds();
- if (packet_time.timestamp != -1)
- arrival_time_ms = (packet_time.timestamp + 500) / 1000;
- else
- arrival_time_ms = now_ms;
{
// Periodically log the RTP header of incoming packets.
@@ -346,7 +338,7 @@ bool RtpStreamReceiver::DeliverRtp(const uint8_t* rtp_packet,
ss << "Packet received on SSRC: " << header.ssrc << " with payload type: "
brandtr 2017/02/09 14:22:17 Might as well remove the usage of |header| here, t
nisse-webrtc 2017/02/10 10:26:55 Done, except that (i) the ReceivePacket and Incomi
<< static_cast<int>(header.payloadType) << ", timestamp: "
<< header.timestamp << ", sequence number: " << header.sequenceNumber
- << ", arrival time: " << arrival_time_ms;
+ << ", arrival time: " << packet.arrival_time_ms();
if (header.extension.hasTransmissionTimeOffset)
ss << ", toffset: " << header.extension.transmissionTimeOffset;
if (header.extension.hasAbsoluteSendTime)
@@ -360,12 +352,13 @@ bool RtpStreamReceiver::DeliverRtp(const uint8_t* rtp_packet,
bool in_order = IsPacketInOrder(header);
rtp_payload_registry_.SetIncomingPayloadType(header);
- bool ret = ReceivePacket(rtp_packet, rtp_packet_length, header, in_order);
+ // TODO(nisse): Is .data() and .size() right? Strip headers or not?
+ bool ret = ReceivePacket(packet.data(), packet.size(), header, in_order);
brandtr 2017/02/09 14:22:17 I believe this is correct. If it were incorrect,
nisse-webrtc 2017/02/10 10:26:55 We'll see what happens to the tests.
// 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, rtp_packet_length, IsPacketRetransmitted(header, in_order));
+ header, packet.size(), IsPacketRetransmitted(header, in_order));
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698