Roll ANGLE 6e56faa..34d719b
[chromium-blink-merge.git] / chrome / renderer / media / cast_udp_transport.h
blobd105c5f7a029d9a19f4dc7134a18a432cc74b90b
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.
5 #ifndef CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_
6 #define CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/renderer/media/cast_session_delegate.h"
12 #include "net/base/ip_endpoint.h"
14 namespace base {
15 class DictionaryValue;
16 } // namespace base
18 class CastSession;
20 // This class represents the transport mechanism used by Cast RTP streams
21 // to connect to a remote client. It specifies the destination address
22 // and network protocol used to send Cast RTP streams.
23 class CastUdpTransport {
24 public:
25 explicit CastUdpTransport(const scoped_refptr<CastSession>& session);
26 virtual ~CastUdpTransport();
28 // Specify the remote IP address and port.
29 void SetDestination(const net::IPEndPoint& remote_address,
30 const CastSessionDelegate::ErrorCallback& error_callback);
32 // Set options.
33 void SetOptions(scoped_ptr<base::DictionaryValue> options);
35 private:
36 const scoped_refptr<CastSession> cast_session_;
37 net::IPEndPoint remote_address_;
38 scoped_ptr<base::DictionaryValue> options_;
39 base::WeakPtrFactory<CastUdpTransport> weak_factory_;
41 DISALLOW_COPY_AND_ASSIGN(CastUdpTransport);
44 #endif // CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_