Signal detailed packet info for each packet sent.

Per-packet info is now signaled in SentPacket to provide useful stats
for bandwidth consumption and overhead analysis in the network stack.

Bug: webrtc:9103
Change-Id: I2b8f6491567d0fa54cc559fc5a96d7aac7d9565e
Reviewed-on: https://webrtc-review.googlesource.com/66281
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22834}
This commit is contained in:
Qingsi Wang
2018-04-11 20:14:17 -07:00
committed by Commit Bot
parent bc49b10a69
commit 6e641e64b2
17 changed files with 188 additions and 34 deletions

View File

@ -24,23 +24,28 @@ namespace rtc {
// after changing the value.
struct PacketTimeUpdateParams {
PacketTimeUpdateParams();
PacketTimeUpdateParams(const PacketTimeUpdateParams& other);
~PacketTimeUpdateParams();
int rtp_sendtime_extension_id; // extension header id present in packet.
int rtp_sendtime_extension_id = -1; // extension header id present in packet.
std::vector<char> srtp_auth_key; // Authentication key.
int srtp_auth_tag_len; // Authentication tag length.
int64_t srtp_packet_index; // Required for Rtp Packet authentication.
int srtp_auth_tag_len = -1; // Authentication tag length.
int64_t srtp_packet_index = -1; // Required for Rtp Packet authentication.
};
// This structure holds meta information for the packet which is about to send
// over network.
struct PacketOptions {
PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {}
explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {}
PacketOptions();
explicit PacketOptions(DiffServCodePoint dscp);
PacketOptions(const PacketOptions& other);
~PacketOptions();
DiffServCodePoint dscp;
int packet_id; // 16 bits, -1 represents "not set".
DiffServCodePoint dscp = DSCP_NO_CHANGE;
int packet_id = -1; // 16 bits, -1 represents "not set".
PacketTimeUpdateParams packet_time_params;
// PacketInfo is passed to SentPacket when signaling this packet is sent.
PacketInfo info_signaled_after_sent;
};
// This structure will have the information about when packet is actually
@ -138,6 +143,10 @@ class AsyncPacketSocket : public sigslot::has_slots<> {
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket);
};
void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
const AsyncPacketSocket& socket_from,
rtc::PacketInfo* info);
} // namespace rtc
#endif // RTC_BASE_ASYNCPACKETSOCKET_H_