From 29e13fd2ca5a1f9539deab83bde65315ac22a9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Mon, 17 Dec 2018 12:35:30 +0100 Subject: [PATCH] Delete rtc::PacketTime (was an alias for int64_t) Followup to https://webrtc-review.googlesource.com/c/91860. Bug: webrtc:9584 Change-Id: Icadf73d6c275ef32167357fc33b3c08158fa096f Reviewed-on: https://webrtc-review.googlesource.com/c/114545 Reviewed-by: Steve Anton Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#26109} --- call/fake_network_pipe.h | 8 ++++---- media/engine/webrtcvideoengine_unittest.cc | 8 ++++---- pc/channel.cc | 6 ++---- rtc_base/BUILD.gn | 3 --- rtc_base/asyncpacketsocket.h | 5 ----- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h index b1b4cee14d..34e1b5070f 100644 --- a/call/fake_network_pipe.h +++ b/call/fake_network_pipe.h @@ -77,8 +77,8 @@ class NetworkPacket { absl::optional packet_options_; bool is_rtcp_; // If using a PacketReceiver for incoming degradation, populate with - // appropriate MediaType and PacketTime. This type/timing will be kept and - // forwarded. The PacketTime might be altered to reflect time spent in fake + // appropriate MediaType and packet time. This type/timing will be kept and + // forwarded. The packet time might be altered to reflect time spent in fake // network pipe. MediaType media_type_; absl::optional packet_time_us_; @@ -124,8 +124,8 @@ class FakeNetworkPipe : public webrtc::SimulatedPacketReceiverInterface, // Implements the PacketReceiver interface. When/if packets are delivered, // they will be passed directly to the receiver instance given in - // SetReceiver(), without passing through a Demuxer. The receive time in - // PacketTime will be increased by the amount of time the packet spent in the + // SetReceiver(), without passing through a Demuxer. The receive time + // will be increased by the amount of time the packet spent in the // fake network pipe. PacketReceiver::DeliveryStatus DeliverPacket(MediaType media_type, rtc::CopyOnWriteBuffer packet, diff --git a/media/engine/webrtcvideoengine_unittest.cc b/media/engine/webrtcvideoengine_unittest.cc index f63c2c0a3d..31dfb55890 100644 --- a/media/engine/webrtcvideoengine_unittest.cc +++ b/media/engine/webrtcvideoengine_unittest.cc @@ -7042,7 +7042,7 @@ TEST_F(WebRtcVideoChannelTestWithClock, GetSources) { EXPECT_TRUE(SetDefaultCodec()); EXPECT_TRUE(SetSend(true)); EXPECT_EQ(0, renderer_.num_rendered_frames()); - channel_->OnPacketReceived(&packet1, rtc::PacketTime()); + channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1); std::vector sources = channel_->GetSources(kSsrc); EXPECT_EQ(1u, sources.size()); @@ -7052,7 +7052,7 @@ TEST_F(WebRtcVideoChannelTestWithClock, GetSources) { // a new packet. int64_t timeDeltaMs = 1; fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(timeDeltaMs)); - channel_->OnPacketReceived(&packet1, rtc::PacketTime()); + channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1); int64_t timestamp2 = channel_->GetSources(kSsrc)[0].timestamp_ms(); EXPECT_EQ(timestamp2, timestamp1 + timeDeltaMs); @@ -7077,7 +7077,7 @@ TEST_F(WebRtcVideoChannelTestWithClock, GetContributingSources) { EXPECT_TRUE(SetDefaultCodec()); EXPECT_TRUE(SetSend(true)); EXPECT_EQ(0, renderer_.num_rendered_frames()); - channel_->OnPacketReceived(&packet1, rtc::PacketTime()); + channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1); { ASSERT_EQ(2u, channel_->GetSources(kSsrc).size()); @@ -7106,7 +7106,7 @@ TEST_F(WebRtcVideoChannelTestWithClock, GetContributingSources) { int64_t timeDeltaMs = 1; fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(timeDeltaMs)); - channel_->OnPacketReceived(&packet2, rtc::PacketTime()); + channel_->OnPacketReceived(&packet2, /*packet_time_us=*/-1); { ASSERT_EQ(2u, channel_->GetSources(kSsrc).size()); diff --git a/pc/channel.cc b/pc/channel.cc index 2635069c15..8a2fcb5456 100644 --- a/pc/channel.cc +++ b/pc/channel.cc @@ -460,10 +460,8 @@ bool BaseChannel::SendPacket(bool rtcp, } void BaseChannel::OnRtpPacket(const webrtc::RtpPacketReceived& parsed_packet) { - // Reconstruct the PacketTime from the |parsed_packet|. - // RtpPacketReceived.arrival_time_ms = (PacketTime + 500) / 1000; - // Note: The |not_before| field is always 0 here. This field is not currently - // used, so it should be fine. + // Take packet time from the |parsed_packet|. + // RtpPacketReceived.arrival_time_ms = (timestamp_us + 500) / 1000; int64_t timestamp_us = -1; if (parsed_packet.arrival_time_ms() > 0) { timestamp_us = parsed_packet.arrival_time_ms() * 1000; diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index d8af370fbb..896e5d8e69 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -862,9 +862,6 @@ rtc_static_library("rtc_base") { defines = [] deps = [ ":checks", - - # For deprecation of rtc::PacketTime, in asyncpacketsocket.h. - ":deprecation", ":stringutils", "..:webrtc_common", "../api:array_view", diff --git a/rtc_base/asyncpacketsocket.h b/rtc_base/asyncpacketsocket.h index b35ba0c503..0e31c2bac1 100644 --- a/rtc_base/asyncpacketsocket.h +++ b/rtc_base/asyncpacketsocket.h @@ -12,7 +12,6 @@ #define RTC_BASE_ASYNCPACKETSOCKET_H_ #include "rtc_base/constructormagic.h" -#include "rtc_base/deprecation.h" #include "rtc_base/dscp.h" #include "rtc_base/network/sent_packet.h" #include "rtc_base/socket.h" @@ -52,10 +51,6 @@ struct PacketOptions { PacketInfo info_signaled_after_sent; }; -// TODO(bugs.webrtc.org/9584): Compatibility alias, delete as soon as downstream -// code is updated. -typedef int64_t PacketTime; - // Provides the ability to receive packets asynchronously. Sends are not // buffered since it is acceptable to drop packets under high load. class AsyncPacketSocket : public sigslot::has_slots<> {