1448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org// Copyright 2013 The Chromium Authors. All rights reserved. 2448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org// Use of this source code is governed by a BSD-style license that can be 3448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org// found in the LICENSE file. 4448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org 5448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#ifndef CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ 6448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#define CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ 7448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org 8448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#include "base/basictypes.h" 9448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#include "base/memory/ref_counted.h" 10448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#include "base/memory/weak_ptr.h" 11448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org#include "net/base/ip_endpoint.h" 12448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org 13448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.orgnamespace base { 14448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.orgclass DictionaryValue; 15448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org} // namespace base 16448a52dfe9691d2b24f152b950b773c59e8b0ee6scottmg@chromium.org 177509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.orgclass CastSession; 187509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 197509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org// This class represents the transport mechanism used by Cast RTP streams 207509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org// to connect to a remote client. It specifies the destination address 217509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org// and network protocol used to send Cast RTP streams. 227509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.orgclass CastUdpTransport { 237509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org public: 247509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org explicit CastUdpTransport(const scoped_refptr<CastSession>& session); 257509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org virtual ~CastUdpTransport(); 267509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 277509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org // Specify the remote IP address and port. 287509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org void SetDestination(const net::IPEndPoint& remote_address); 297509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 307509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org // Set options. 317509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org void SetOptions(scoped_ptr<base::DictionaryValue> options); 327509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 337509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org private: 347509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org const scoped_refptr<CastSession> cast_session_; 357509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org net::IPEndPoint remote_address_; 367509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org scoped_ptr<base::DictionaryValue> options_; 377509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org base::WeakPtrFactory<CastUdpTransport> weak_factory_; 387509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 397509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org DISALLOW_COPY_AND_ASSIGN(CastUdpTransport); 407509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org}; 417509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org 427509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org#endif // CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ 437509f5f9cd770e1ae1a4d1b720dda59ca60c5524yukawa@chromium.org