Index: chrome/renderer/media/cast_udp_transport.cc |
diff --git a/chrome/renderer/media/cast_udp_transport.cc b/chrome/renderer/media/cast_udp_transport.cc |
index fd98e572d67bd52d27f264f9aa2f9c32fda145e4..f13a0ce8dbf48623a8f43edaa91af35a39d400fb 100644 |
--- a/chrome/renderer/media/cast_udp_transport.cc |
+++ b/chrome/renderer/media/cast_udp_transport.cc |
@@ -6,6 +6,23 @@ |
#include "base/logging.h" |
#include "chrome/renderer/media/cast_session.h" |
+#include "content/public/renderer/p2p_socket_client.h" |
+#include "net/base/host_port_pair.h" |
+#include "net/base/net_util.h" |
+ |
+class CastUdpSocketFactory : public CastSession::P2PSocketFactory { |
+ public: |
+ virtual scoped_refptr<content::P2PSocketClient> Create() OVERRIDE { |
+ net::IPEndPoint unspecified_end_point; |
+ scoped_refptr<content::P2PSocketClient> socket = |
+ content::P2PSocketClient::Create( |
+ content::P2P_SOCKET_UDP, |
+ unspecified_end_point, |
+ unspecified_end_point, |
+ NULL); |
+ return socket; |
+ } |
+}; |
CastUdpTransport::CastUdpTransport( |
const scoped_refptr<CastSession>& session) |
@@ -15,6 +32,9 @@ CastUdpTransport::CastUdpTransport( |
CastUdpTransport::~CastUdpTransport() { |
} |
-void CastUdpTransport::Start(const net::HostPortPair& remote_address) { |
- NOTIMPLEMENTED(); |
+void CastUdpTransport::Start(const net::IPEndPoint& remote_address) { |
+ cast_session_->SetSocketFactory( |
+ scoped_ptr<CastSession::P2PSocketFactory>( |
+ new CastUdpSocketFactory()).Pass(), |
+ remote_address); |
} |