Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9986)

Unified Diff: chrome/renderer/media/cast_udp_transport.cc

Issue 66293003: P2P <-> cast library integration v0.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/media/cast_udp_transport.h ('k') | content/public/renderer/p2p_socket_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/renderer/media/cast_udp_transport.h ('k') | content/public/renderer/p2p_socket_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698