OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_CAST_TEST_TRANSPORT_TRANSPORT_H_ | |
6 #define MEDIA_CAST_TEST_TRANSPORT_TRANSPORT_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "media/cast/cast_config.h" | |
10 #include "media/cast/cast_environment.h" | |
11 #include "net/udp/udp_server_socket.h" | |
12 #include "net/udp/udp_socket.h" | |
13 | |
14 | |
Alpha Left Google
2013/11/01 23:23:19
nit: remove this extra space.
| |
15 namespace media { | |
16 namespace cast { | |
17 namespace test { | |
18 | |
19 class LocalUdpTransportData; | |
20 | |
21 // Helper class for Cast test applications. | |
22 class Transport { | |
23 public: | |
24 Transport(scoped_refptr<CastEnvironment> cast_environment); | |
25 ~Transport(); | |
26 | |
27 // Specifies the ports and IP address to receive packets on. | |
Alpha Left Google
2013/11/01 23:23:19
nit: s/ports/port/.
| |
28 // Will start listening immediately. | |
29 void SetLocalReceiver(PacketReceiver* packet_receiver, | |
30 std::string ip_address, | |
31 int port); | |
32 | |
33 // Specifies the destination port and IP address. | |
34 void SetSendDestination(std::string ip_address, int port); | |
35 | |
36 PacketSender* packet_sender() {return packet_sender_.get();} | |
Alpha Left Google
2013/11/01 23:23:19
nit: { return packet_sender_.get(); }
Give a spac
| |
37 | |
38 void SetSendSidePacketLoss(int percentage); | |
39 | |
40 void StopReceiving(); | |
41 | |
42 private: | |
43 scoped_ptr<net::DatagramServerSocket> udp_socket_; | |
44 scoped_ptr<PacketSender> packet_sender_; | |
Alpha Left Google
2013/11/01 23:23:19
Why not just use scoped_ptr<LocalPacketSender>? Yo
| |
45 scoped_ptr<LocalUdpTransportData> local_udp_transport_data_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(Transport); | |
48 }; | |
49 | |
50 } // namespace test | |
51 } // namespace cast | |
52 } // namespace media | |
53 | |
54 #endif // MEDIA_CAST_TEST_TRANSPORT_TRANSPORT_H_ | |
OLD | NEW |