Delete webrtc::PacketTime and backwards compatibility.
This is a followup to
https://webrtc-review.googlesource.com/c/src/+/91840, which needed
transitional methods while updating downstream code. This cl completes
the deletion, and can be landed after downstream code is updated.
Bug: webtrc:9584
Change-Id: I4d3654748973a4757a8d79bb93f524c630a0eca3
Reviewed-on: https://webrtc-review.googlesource.com/93285
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24329}diff --git a/call/BUILD.gn b/call/BUILD.gn
index d09ae35..7965097 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -20,7 +20,6 @@
"call_config.h",
"flexfec_receive_stream.cc",
"flexfec_receive_stream.h",
- "packet_receiver.cc",
"packet_receiver.h",
"syncable.cc",
"syncable.h",
diff --git a/call/fake_network_pipe.cc b/call/fake_network_pipe.cc
index 55af767..a71ba4d 100644
--- a/call/fake_network_pipe.cc
+++ b/call/fake_network_pipe.cc
@@ -44,23 +44,6 @@
media_type_(media_type),
packet_time_us_(packet_time_us) {}
-NetworkPacket::NetworkPacket(rtc::CopyOnWriteBuffer packet,
- int64_t send_time,
- int64_t arrival_time,
- absl::optional<PacketOptions> packet_options,
- bool is_rtcp,
- MediaType media_type,
- absl::optional<PacketTime> packet_time)
- : NetworkPacket(packet,
- send_time,
- arrival_time,
- packet_options,
- is_rtcp,
- media_type,
- packet_time
- ? absl::optional<int64_t>(packet_time->timestamp)
- : absl::nullopt) {}
-
NetworkPacket::NetworkPacket(NetworkPacket&& o)
: packet_(std::move(o.packet_)),
send_time_(o.send_time_),
@@ -215,25 +198,11 @@
bool is_rtcp,
MediaType media_type,
absl::optional<int64_t> packet_time_us) {
- absl::optional<PacketTime> packet_time;
- if (packet_time_us) {
- packet_time = PacketTime(*packet_time_us, -1);
- }
- return EnqueuePacket(packet, options, is_rtcp, media_type, packet_time);
-}
-
-bool FakeNetworkPipe::EnqueuePacket(rtc::CopyOnWriteBuffer packet,
- absl::optional<PacketOptions> options,
- bool is_rtcp,
- MediaType media_type,
- absl::optional<PacketTime> packet_time) {
int64_t time_now_us = clock_->TimeInMicroseconds();
rtc::CritScope crit(&process_lock_);
size_t packet_size = packet.size();
- NetworkPacket net_packet(
- std::move(packet), time_now_us, time_now_us, options, is_rtcp, media_type,
- packet_time ? absl::optional<int64_t>(packet_time->timestamp)
- : absl::nullopt);
+ NetworkPacket net_packet(std::move(packet), time_now_us, time_now_us, options,
+ is_rtcp, media_type, packet_time_us);
packets_in_flight_.emplace_back(StoredPacket(std::move(net_packet)));
int64_t packet_id = reinterpret_cast<uint64_t>(&packets_in_flight_.back());
diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h
index 1f660b8..a46cd75 100644
--- a/call/fake_network_pipe.h
+++ b/call/fake_network_pipe.h
@@ -43,14 +43,6 @@
bool is_rtcp,
MediaType media_type,
absl::optional<int64_t> packet_time_us);
- // TODO(nisse): Deprecated.
- NetworkPacket(rtc::CopyOnWriteBuffer packet,
- int64_t send_time,
- int64_t arrival_time,
- absl::optional<PacketOptions> packet_options,
- bool is_rtcp,
- MediaType media_type,
- absl::optional<PacketTime> packet_time);
// Disallow copy constructor and copy assignment (no deep copies of |data_|).
NetworkPacket(const NetworkPacket&) = delete;
@@ -74,10 +66,6 @@
bool is_rtcp() const { return is_rtcp_; }
MediaType media_type() const { return media_type_; }
absl::optional<int64_t> packet_time_us() const { return packet_time_us_; }
- // TODO(nisse): Deprecated.
- PacketTime packet_time() const {
- return PacketTime(packet_time_us_.value_or(-1), -1);
- }
private:
rtc::CopyOnWriteBuffer packet_;
@@ -218,19 +206,11 @@
MediaType media_type,
absl::optional<int64_t> packet_time_us);
- // TODO(nisse): Deprecated. Delete as soon as overrides in downstream code are
- // updated.
- virtual bool EnqueuePacket(rtc::CopyOnWriteBuffer packet,
- absl::optional<PacketOptions> options,
- bool is_rtcp,
- MediaType media_type,
- absl::optional<PacketTime> packet_time);
bool EnqueuePacket(rtc::CopyOnWriteBuffer packet,
absl::optional<PacketOptions> options,
bool is_rtcp,
MediaType media_type) {
- return EnqueuePacket(packet, options, is_rtcp, media_type,
- absl::optional<PacketTime>());
+ return EnqueuePacket(packet, options, is_rtcp, media_type, absl::nullopt);
}
void DeliverNetworkPacket(NetworkPacket* packet)
RTC_EXCLUSIVE_LOCKS_REQUIRED(config_lock_);
diff --git a/call/packet_receiver.cc b/call/packet_receiver.cc
deleted file mode 100644
index d6786d2..0000000
--- a/call/packet_receiver.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "call/packet_receiver.h"
-
-namespace webrtc {
-
-PacketReceiver::DeliveryStatus PacketReceiver::DeliverPacket(
- MediaType media_type,
- rtc::CopyOnWriteBuffer packet,
- int64_t packet_time_us) {
- return DeliverPacket(media_type, packet, PacketTime(packet_time_us, -1));
-}
-
-// TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
-// implementations are used, and subclasses must override one or the other.
-PacketReceiver::DeliveryStatus PacketReceiver::DeliverPacket(
- MediaType media_type,
- rtc::CopyOnWriteBuffer packet,
- const PacketTime& packet_time) {
- return DeliverPacket(media_type, packet, packet_time.timestamp);
-}
-
-} // namespace webrtc
diff --git a/call/packet_receiver.h b/call/packet_receiver.h
index 2a0e3ef..f05e409 100644
--- a/call/packet_receiver.h
+++ b/call/packet_receiver.h
@@ -31,13 +31,7 @@
virtual DeliveryStatus DeliverPacket(MediaType media_type,
rtc::CopyOnWriteBuffer packet,
- int64_t packet_time_us);
-
- // TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
- // implementations are used, and subclasses must override one or the other.
- virtual DeliveryStatus DeliverPacket(MediaType media_type,
- rtc::CopyOnWriteBuffer packet,
- const PacketTime& packet_time);
+ int64_t packet_time_us) = 0;
protected:
virtual ~PacketReceiver() {}
diff --git a/common_types.h b/common_types.h
index c9eeee4..c1c5b4e 100644
--- a/common_types.h
+++ b/common_types.h
@@ -404,24 +404,6 @@
double initial_var_noise;
};
-// TODO(nisse): This struct is phased out, delete as soon as down stream code is
-// updated.
-
-// This structure will have the information about when packet is actually
-// received by socket.
-struct PacketTime {
- PacketTime() : timestamp(-1), not_before(-1) {}
- PacketTime(int64_t timestamp, int64_t not_before)
- : timestamp(timestamp), not_before(not_before) {}
-
- int64_t timestamp; // Receive time after socket delivers the data.
- int64_t not_before; // Earliest possible time the data could have arrived,
- // indicating the potential error in the |timestamp|
- // value,in case the system is busy.
- // For example, the time of the last select() call.
- // If unknown, this value will be set to zero.
-};
-
// Minimum and maximum playout delay values from capture to render.
// These are best effort values.
//