Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: webrtc/base/asyncpacketsocket.h

Issue 1363573002: Wire up transport sequence number / send time callbacks to webrtc via libjingle. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: No changes to const parameters. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/base/asyncpacketsocket.h
diff --git a/webrtc/base/asyncpacketsocket.h b/webrtc/base/asyncpacketsocket.h
index f0c221da1dec3fd4014be539224366d507fcac23..b6cd4a1b880c08f484d1385f231abc0d3cdb67b4 100644
--- a/webrtc/base/asyncpacketsocket.h
+++ b/webrtc/base/asyncpacketsocket.h
@@ -34,10 +34,11 @@ struct PacketTimeUpdateParams {
// This structure holds meta information for the packet which is about to send
// over network.
struct PacketOptions {
- PacketOptions() : dscp(DSCP_NO_CHANGE) {}
- explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {}
+ PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {}
+ PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {}
DiffServCodePoint dscp;
+ int packet_id; // 16 bits, -1 represents "not set".
PacketTimeUpdateParams packet_time_params;
};
@@ -61,6 +62,15 @@ inline PacketTime CreatePacketTime(int64 not_before) {
return PacketTime(TimeMicros(), not_before);
}
+struct SentPacket {
+ SentPacket() : packet_id(-1), send_time_ms(-1) {}
+ SentPacket(int32 packet_id, int64 send_time_ms)
+ : packet_id(packet_id), send_time_ms(send_time_ms) {}
+
+ int packet_id;
+ int64 send_time_ms;
+};
+
// 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<> {
@@ -109,6 +119,10 @@ class AsyncPacketSocket : public sigslot::has_slots<> {
const SocketAddress&,
const PacketTime&> SignalReadPacket;
+ // Emitted each time a packet is sent.
+ sigslot::signal3<AsyncPacketSocket*, const SocketAddress&, const SentPacket&>
+ SignalPacketSent;
stefan-webrtc 2015/10/05 13:43:19 I'm not sure if I actually need SocketAddress here
pthatcher1 2015/10/05 18:30:14 You shouldn't care what socket it is, as long as t
stefan-webrtc 2015/10/07 16:55:25 Acknowledged.
+
// Emitted when the socket is currently able to send.
sigslot::signal1<AsyncPacketSocket*> SignalReadyToSend;

Powered by Google App Engine
This is Rietveld 408576698