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

Side by Side 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: Add missing updated_options 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 int rtp_sendtime_extension_id; // extension header id present in packet. 28 int rtp_sendtime_extension_id; // extension header id present in packet.
29 std::vector<char> srtp_auth_key; // Authentication key. 29 std::vector<char> srtp_auth_key; // Authentication key.
30 int srtp_auth_tag_len; // Authentication tag length. 30 int srtp_auth_tag_len; // Authentication tag length.
31 int64_t srtp_packet_index; // Required for Rtp Packet authentication. 31 int64_t srtp_packet_index; // Required for Rtp Packet authentication.
32 }; 32 };
33 33
34 // This structure holds meta information for the packet which is about to send 34 // This structure holds meta information for the packet which is about to send
35 // over network. 35 // over network.
36 struct PacketOptions { 36 struct PacketOptions {
37 PacketOptions() : dscp(DSCP_NO_CHANGE) {} 37 PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {}
38 explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {} 38 explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {}
39 39
40 DiffServCodePoint dscp; 40 DiffServCodePoint dscp;
41 int packet_id; // 16 bits, -1 represents "not set".
41 PacketTimeUpdateParams packet_time_params; 42 PacketTimeUpdateParams packet_time_params;
42 }; 43 };
43 44
44 // This structure will have the information about when packet is actually 45 // This structure will have the information about when packet is actually
45 // received by socket. 46 // received by socket.
46 struct PacketTime { 47 struct PacketTime {
47 PacketTime() : timestamp(-1), not_before(-1) {} 48 PacketTime() : timestamp(-1), not_before(-1) {}
48 PacketTime(int64_t timestamp, int64_t not_before) 49 PacketTime(int64_t timestamp, int64_t not_before)
49 : timestamp(timestamp), not_before(not_before) {} 50 : timestamp(timestamp), not_before(not_before) {}
50 51
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // TODO: Remove SetError(). 103 // TODO: Remove SetError().
103 virtual int GetError() const = 0; 104 virtual int GetError() const = 0;
104 virtual void SetError(int error) = 0; 105 virtual void SetError(int error) = 0;
105 106
106 // Emitted each time a packet is read. Used only for UDP and 107 // Emitted each time a packet is read. Used only for UDP and
107 // connected TCP sockets. 108 // connected TCP sockets.
108 sigslot::signal5<AsyncPacketSocket*, const char*, size_t, 109 sigslot::signal5<AsyncPacketSocket*, const char*, size_t,
109 const SocketAddress&, 110 const SocketAddress&,
110 const PacketTime&> SignalReadPacket; 111 const PacketTime&> SignalReadPacket;
111 112
113 // Emitted each time a packet is sent.
114 sigslot::signal2<AsyncPacketSocket*, const SentPacket&> SignalSentPacket;
115
112 // Emitted when the socket is currently able to send. 116 // Emitted when the socket is currently able to send.
113 sigslot::signal1<AsyncPacketSocket*> SignalReadyToSend; 117 sigslot::signal1<AsyncPacketSocket*> SignalReadyToSend;
114 118
115 // Emitted after address for the socket is allocated, i.e. binding 119 // Emitted after address for the socket is allocated, i.e. binding
116 // is finished. State of the socket is changed from BINDING to BOUND 120 // is finished. State of the socket is changed from BINDING to BOUND
117 // (for UDP and server TCP sockets) or CONNECTING (for client TCP 121 // (for UDP and server TCP sockets) or CONNECTING (for client TCP
118 // sockets). 122 // sockets).
119 sigslot::signal2<AsyncPacketSocket*, const SocketAddress&> SignalAddressReady; 123 sigslot::signal2<AsyncPacketSocket*, const SocketAddress&> SignalAddressReady;
120 124
121 // Emitted for client TCP sockets when state is changed from 125 // Emitted for client TCP sockets when state is changed from
122 // CONNECTING to CONNECTED. 126 // CONNECTING to CONNECTED.
123 sigslot::signal1<AsyncPacketSocket*> SignalConnect; 127 sigslot::signal1<AsyncPacketSocket*> SignalConnect;
124 128
125 // Emitted for client TCP sockets when state is changed from 129 // Emitted for client TCP sockets when state is changed from
126 // CONNECTED to CLOSED. 130 // CONNECTED to CLOSED.
127 sigslot::signal2<AsyncPacketSocket*, int> SignalClose; 131 sigslot::signal2<AsyncPacketSocket*, int> SignalClose;
128 132
129 // Used only for listening TCP sockets. 133 // Used only for listening TCP sockets.
130 sigslot::signal2<AsyncPacketSocket*, AsyncPacketSocket*> SignalNewConnection; 134 sigslot::signal2<AsyncPacketSocket*, AsyncPacketSocket*> SignalNewConnection;
131 135
132 private: 136 private:
133 RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket); 137 RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket);
134 }; 138 };
135 139
136 } // namespace rtc 140 } // namespace rtc
137 141
138 #endif // WEBRTC_BASE_ASYNCPACKETSOCKET_H_ 142 #endif // WEBRTC_BASE_ASYNCPACKETSOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698