From f189c48c868531a6d8ff323c625cd363b828bb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Fri, 17 Aug 2018 09:49:20 +0200 Subject: [PATCH] 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 Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#24329} --- call/BUILD.gn | 1 - call/fake_network_pipe.cc | 35 ++--------------------------------- call/fake_network_pipe.h | 22 +--------------------- call/packet_receiver.cc | 31 ------------------------------- call/packet_receiver.h | 8 +------- common_types.h | 18 ------------------ 6 files changed, 4 insertions(+), 111 deletions(-) delete mode 100644 call/packet_receiver.cc diff --git a/call/BUILD.gn b/call/BUILD.gn index d09ae35f3a..796509746b 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -20,7 +20,6 @@ rtc_source_set("call_interfaces") { "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 55af767cb2..a71ba4d718 100644 --- a/call/fake_network_pipe.cc +++ b/call/fake_network_pipe.cc @@ -44,23 +44,6 @@ NetworkPacket::NetworkPacket(rtc::CopyOnWriteBuffer packet, 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 packet_options, - bool is_rtcp, - MediaType media_type, - absl::optional packet_time) - : NetworkPacket(packet, - send_time, - arrival_time, - packet_options, - is_rtcp, - media_type, - packet_time - ? absl::optional(packet_time->timestamp) - : absl::nullopt) {} - NetworkPacket::NetworkPacket(NetworkPacket&& o) : packet_(std::move(o.packet_)), send_time_(o.send_time_), @@ -215,25 +198,11 @@ bool FakeNetworkPipe::EnqueuePacket(rtc::CopyOnWriteBuffer packet, bool is_rtcp, MediaType media_type, absl::optional packet_time_us) { - absl::optional 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 options, - bool is_rtcp, - MediaType media_type, - absl::optional 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(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(&packets_in_flight_.back()); diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h index 1f660b8063..a46cd75f18 100644 --- a/call/fake_network_pipe.h +++ b/call/fake_network_pipe.h @@ -43,14 +43,6 @@ class NetworkPacket { bool is_rtcp, MediaType media_type, absl::optional packet_time_us); - // TODO(nisse): Deprecated. - NetworkPacket(rtc::CopyOnWriteBuffer packet, - int64_t send_time, - int64_t arrival_time, - absl::optional packet_options, - bool is_rtcp, - MediaType media_type, - absl::optional packet_time); // Disallow copy constructor and copy assignment (no deep copies of |data_|). NetworkPacket(const NetworkPacket&) = delete; @@ -74,10 +66,6 @@ class NetworkPacket { bool is_rtcp() const { return is_rtcp_; } MediaType media_type() const { return media_type_; } absl::optional 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 @@ class FakeNetworkPipe : public Transport, public PacketReceiver, public Module { MediaType media_type, absl::optional packet_time_us); - // TODO(nisse): Deprecated. Delete as soon as overrides in downstream code are - // updated. - virtual bool EnqueuePacket(rtc::CopyOnWriteBuffer packet, - absl::optional options, - bool is_rtcp, - MediaType media_type, - absl::optional packet_time); bool EnqueuePacket(rtc::CopyOnWriteBuffer packet, absl::optional options, bool is_rtcp, MediaType media_type) { - return EnqueuePacket(packet, options, is_rtcp, media_type, - absl::optional()); + 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 d6786d29a7..0000000000 --- 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 2a0e3ef7b3..f05e409d79 100644 --- a/call/packet_receiver.h +++ b/call/packet_receiver.h @@ -31,13 +31,7 @@ class PacketReceiver { 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 c9eeee434e..c1c5b4e1eb 100644 --- a/common_types.h +++ b/common_types.h @@ -404,24 +404,6 @@ struct OverUseDetectorOptions { 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. //