From 0378997db32b9ac4c46f5a5f705e91c55ba099de Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 9 Oct 2018 18:27:57 +0200 Subject: [PATCH] Adds flags indicating presence in allocation and feedback per packet. This CL adds flags to the PacketOptions and PacktInfo struct that are intended to be used to indicate if the packet belongs to a media stream that is part of bitrate allocation as well as if it is included in transport wide packet feedback. This is part of a series of CLs that allows GoogCC to track sent bitrate that is included in bitrate allocation but without transport feedback. Bug: webrtc:9796 Change-Id: Icdf3e1e13d3f119574ee1b2c574f2d3329a7e303 Reviewed-on: https://webrtc-review.googlesource.com/c/104920 Commit-Queue: Sebastian Jansson Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#25069} --- api/call/transport.h | 2 ++ call/degraded_call.cc | 2 ++ media/engine/webrtcvideoengine.cc | 4 ++++ media/engine/webrtcvoiceengine.h | 4 ++++ rtc_base/socket.h | 2 ++ test/direct_transport.cc | 2 ++ test/scenario/network_node.cc | 2 ++ 7 files changed, 18 insertions(+) diff --git a/api/call/transport.h b/api/call/transport.h index 18d22705cd..32e5ddf874 100644 --- a/api/call/transport.h +++ b/api/call/transport.h @@ -32,6 +32,8 @@ struct PacketOptions { std::vector application_data; // Whether this is a retransmission of an earlier packet. bool is_retransmit = false; + bool included_in_feedback = false; + bool included_in_allocation = false; }; class Transport { diff --git a/call/degraded_call.cc b/call/degraded_call.cc index 353fe4c716..e02a7f9c8d 100644 --- a/call/degraded_call.cc +++ b/call/degraded_call.cc @@ -183,6 +183,8 @@ bool DegradedCall::SendRtp(const uint8_t* packet, rtc::SentPacket sent_packet; sent_packet.packet_id = options.packet_id; sent_packet.send_time_ms = clock_->TimeInMilliseconds(); + sent_packet.info.included_in_feedback = options.included_in_feedback; + sent_packet.info.included_in_allocation = options.included_in_allocation; sent_packet.info.packet_size_bytes = length; sent_packet.info.packet_type = rtc::PacketType::kData; call_->OnSentPacket(sent_packet); diff --git a/media/engine/webrtcvideoengine.cc b/media/engine/webrtcvideoengine.cc index d9596152c2..70468a8c86 100644 --- a/media/engine/webrtcvideoengine.cc +++ b/media/engine/webrtcvideoengine.cc @@ -1479,6 +1479,10 @@ bool WebRtcVideoChannel::SendRtp(const uint8_t* data, if (DscpEnabled()) { rtc_options.dscp = PreferredDscp(); } + rtc_options.info_signaled_after_sent.included_in_feedback = + options.included_in_feedback; + rtc_options.info_signaled_after_sent.included_in_allocation = + options.included_in_allocation; return MediaChannel::SendPacket(&packet, rtc_options); } diff --git a/media/engine/webrtcvoiceengine.h b/media/engine/webrtcvoiceengine.h index bedede1248..b39642a1d3 100644 --- a/media/engine/webrtcvoiceengine.h +++ b/media/engine/webrtcvoiceengine.h @@ -218,6 +218,10 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel, if (DscpEnabled()) { rtc_options.dscp = PreferredDscp(); } + rtc_options.info_signaled_after_sent.included_in_feedback = + options.included_in_feedback; + rtc_options.info_signaled_after_sent.included_in_allocation = + options.included_in_allocation; return VoiceMediaChannel::SendPacket(&packet, rtc_options); } diff --git a/rtc_base/socket.h b/rtc_base/socket.h index b8290bb139..2a3d61d573 100644 --- a/rtc_base/socket.h +++ b/rtc_base/socket.h @@ -145,6 +145,8 @@ struct PacketInfo { PacketInfo(const PacketInfo& info); ~PacketInfo(); + bool included_in_feedback; + bool included_in_allocation; PacketType packet_type = PacketType::kUnknown; PacketInfoProtocolType protocol = PacketInfoProtocolType::kUnknown; // A unique id assigned by the network manager, and absl::nullopt if not set. diff --git a/test/direct_transport.cc b/test/direct_transport.cc index 6aa8c9158f..fd7369171a 100644 --- a/test/direct_transport.cc +++ b/test/direct_transport.cc @@ -72,6 +72,8 @@ bool DirectTransport::SendRtp(const uint8_t* data, if (send_call_) { rtc::SentPacket sent_packet(options.packet_id, clock_->TimeInMilliseconds()); + sent_packet.info.included_in_feedback = options.included_in_feedback; + sent_packet.info.included_in_allocation = options.included_in_allocation; sent_packet.info.packet_size_bytes = length; sent_packet.info.packet_type = rtc::PacketType::kData; send_call_->OnSentPacket(sent_packet); diff --git a/test/scenario/network_node.cc b/test/scenario/network_node.cc index ec841091d9..87fc32a5d5 100644 --- a/test/scenario/network_node.cc +++ b/test/scenario/network_node.cc @@ -187,6 +187,8 @@ bool NetworkNodeTransport::SendRtp(const uint8_t* packet, int64_t send_time_ms = sender_->clock_->TimeInMilliseconds(); rtc::SentPacket sent_packet; sent_packet.packet_id = options.packet_id; + sent_packet.info.included_in_feedback = options.included_in_feedback; + sent_packet.info.included_in_allocation = options.included_in_allocation; sent_packet.send_time_ms = send_time_ms; sent_packet.info.packet_size_bytes = length; sent_packet.info.packet_type = rtc::PacketType::kData;