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 | |
13 | |
14 namespace media { | |
15 namespace cast { | |
16 | |
17 class LocalUdpTransportData; | |
18 class LocalPacketSender; | |
19 | |
20 // Helper class for Cast test applications. | |
21 class Transport { | |
22 public: | |
23 Transport(scoped_refptr<base::TaskRunner> io_thread_proxy); | |
24 ~Transport(); | |
25 | |
26 // Specifies the ports and IP address to receive packets on. | |
27 // Will start listening immediately. | |
28 void SetLocalReceiver(PacketReceiver* packet_receiver, | |
29 std::string ip_address, | |
30 std::string local_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(); | |
37 | |
38 void StopReceiving(); | |
39 | |
40 private: | |
41 scoped_ptr<net::UDPServerSocket> udp_socket_; | |
42 scoped_refptr<LocalPacketSender> packet_sender_; | |
43 scoped_refptr<LocalUdpTransportData> local_udp_transport_data_; | |
44 scoped_refptr<base::TaskRunner> io_thread_proxy_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(Transport); | |
47 }; | |
48 | |
49 } // namespace cast | |
50 } // namespace media | |
51 | |
52 #endif // MEDIA_CAST_TEST_TRANSPORT_TRANSPORT_H_ | |
OLD | NEW |