| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 5 #ifndef MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
| 6 #define MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 6 #define MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/values.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "media/cast/cast_environment.h" | 16 #include "media/cast/cast_environment.h" |
| 16 #include "media/cast/net/cast_transport_config.h" | 17 #include "media/cast/net/cast_transport_config.h" |
| 17 #include "media/cast/net/cast_transport_sender.h" | 18 #include "media/cast/net/cast_transport_sender.h" |
| 18 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 19 #include "net/base/ip_endpoint.h" | 20 #include "net/base/ip_endpoint.h" |
| 20 #include "net/udp/diff_serv_code_point.h" | 21 #include "net/udp/diff_serv_code_point.h" |
| 21 #include "net/udp/udp_socket.h" | 22 #include "net/udp/udp_socket.h" |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 42 UdpTransport( | 43 UdpTransport( |
| 43 net::NetLog* net_log, | 44 net::NetLog* net_log, |
| 44 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy, | 45 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy, |
| 45 const net::IPEndPoint& local_end_point, | 46 const net::IPEndPoint& local_end_point, |
| 46 const net::IPEndPoint& remote_end_point, | 47 const net::IPEndPoint& remote_end_point, |
| 47 int32_t send_buffer_size, | 48 int32_t send_buffer_size, |
| 48 const CastTransportStatusCallback& status_callback); | 49 const CastTransportStatusCallback& status_callback); |
| 49 ~UdpTransport() final; | 50 ~UdpTransport() final; |
| 50 | 51 |
| 51 // Start receiving packets. Packets are submitted to |packet_receiver|. | 52 // Start receiving packets. Packets are submitted to |packet_receiver|. |
| 52 void StartReceiving(const PacketReceiverCallbackWithStatus& packet_receiver); | 53 void StartReceiving( |
| 53 void StopReceiving(); | 54 const PacketReceiverCallbackWithStatus& packet_receiver) final; |
| 55 void StopReceiving() final; |
| 54 | 56 |
| 55 // Set a new DSCP value to the socket. The value will be set right before | 57 // Set a new DSCP value to the socket. The value will be set right before |
| 56 // the next send. | 58 // the next send. |
| 57 void SetDscp(net::DiffServCodePoint dscp); | 59 void SetDscp(net::DiffServCodePoint dscp); |
| 58 | 60 |
| 59 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
| 60 // Switch to use non-blocking IO. Must be called before StartReceiving(). | 62 // Switch to use non-blocking IO. Must be called before StartReceiving(). |
| 61 void UseNonBlockingIO(); | 63 void UseNonBlockingIO(); |
| 62 #endif | 64 #endif |
| 63 | 65 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // NOTE: Weak pointers must be invalidated before all other member variables. | 101 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 100 base::WeakPtrFactory<UdpTransport> weak_factory_; | 102 base::WeakPtrFactory<UdpTransport> weak_factory_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(UdpTransport); | 104 DISALLOW_COPY_AND_ASSIGN(UdpTransport); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace cast | 107 } // namespace cast |
| 106 } // namespace media | 108 } // namespace media |
| 107 | 109 |
| 108 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 110 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
| OLD | NEW |