| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "media/cast/test/transport/transport.h" | 5 #include "media/cast/test/transport/transport.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 VLOG(1) << "Drop packet f:" << static_cast<int>(data[12 + 1]) | 96 VLOG(1) << "Drop packet f:" << static_cast<int>(data[12 + 1]) |
| 97 << " p:" << static_cast<int>(data[12 + 3]) | 97 << " p:" << static_cast<int>(data[12 + 3]) |
| 98 << " m:" << static_cast<int>(data[12 + 5]); | 98 << " m:" << static_cast<int>(data[12 + 5]); |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 net::TestCompletionCallback callback; | 102 net::TestCompletionCallback callback; |
| 103 scoped_refptr<net::WrappedIOBuffer> buffer( | 103 scoped_refptr<net::WrappedIOBuffer> buffer( |
| 104 new net::WrappedIOBuffer(reinterpret_cast<const char*>(data))); | 104 new net::WrappedIOBuffer(reinterpret_cast<const char*>(data))); |
| 105 int rv = udp_socket_->SendTo( | 105 int rv = udp_socket_->SendTo( |
| 106 buffer.get(), packet.size(), send_address_, callback.callback()); | 106 buffer.get(), static_cast<int>(packet.size()), send_address_, |
| 107 callback.callback()); |
| 107 return (rv == packet.size()); | 108 return (rv == packet.size()); |
| 108 } | 109 } |
| 109 | 110 |
| 110 virtual bool SendPackets(const PacketList& packets) OVERRIDE { | 111 virtual bool SendPackets(const PacketList& packets) OVERRIDE { |
| 111 bool out_val = true; | 112 bool out_val = true; |
| 112 for (size_t i = 0; i < packets.size(); ++i) { | 113 for (size_t i = 0; i < packets.size(); ++i) { |
| 113 const Packet& packet = packets[i]; | 114 const Packet& packet = packets[i]; |
| 114 out_val |= SendPacket(packet); | 115 out_val |= SendPacket(packet); |
| 115 } | 116 } |
| 116 return out_val; | 117 return out_val; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 void Transport::SetSendDestination(std::string ip_address, int port) { | 169 void Transport::SetSendDestination(std::string ip_address, int port) { |
| 169 net::IPEndPoint send_address; | 170 net::IPEndPoint send_address; |
| 170 CreateUDPAddress(ip_address, port, &send_address); | 171 CreateUDPAddress(ip_address, port, &send_address); |
| 171 packet_sender_->SetSendAddress(send_address); | 172 packet_sender_->SetSendAddress(send_address); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace test | 175 } // namespace test |
| 175 } // namespace cast | 176 } // namespace cast |
| 176 } // namespace media | 177 } // namespace media |
| OLD | NEW |