OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectionfactory.h" |
| 13 #include "webkit/glue/p2p_transport.h" |
| 14 |
| 15 namespace content { |
| 16 class IpcNetworkManager; |
| 17 class IpcPacketSocketFactory; |
| 18 class P2PSocketDispatcher; |
| 19 } |
| 20 |
| 21 namespace cricket { |
| 22 class MediaEngineInterface; |
| 23 class PortAllocator; |
| 24 class WebRtcMediaEngine; |
| 25 } |
| 26 |
| 27 namespace talk_base { |
| 28 class NetworkManager; |
| 29 class PacketSocketFactory; |
| 30 class Thread; |
| 31 } |
| 32 |
| 33 namespace webrtc { |
| 34 class PeerConnection; |
| 35 class VideoCaptureModule; |
| 36 } |
| 37 |
| 38 // Object factory for MediaStreamImpl and PeerConnectionHandler. |
| 39 class MediaStreamDependencyFactory { |
| 40 public: |
| 41 MediaStreamDependencyFactory(); |
| 42 virtual ~MediaStreamDependencyFactory(); |
| 43 |
| 44 // WebRtcMediaEngine is used in CreatePeerConnectionFactory(). |
| 45 virtual cricket::WebRtcMediaEngine* CreateWebRtcMediaEngine(); |
| 46 |
| 47 // Creates and deletes |pc_factory_|, which in turn is used for |
| 48 // creating PeerConnection objects. |media_engine| is the engine created by |
| 49 // CreateWebRtcMediaEngine(). |port_allocator| and |media_engine| will be |
| 50 // owned by |pc_factory_|. |worker_thread| is owned by MediaStreamImpl. |
| 51 virtual bool CreatePeerConnectionFactory( |
| 52 cricket::MediaEngineInterface* media_engine, |
| 53 talk_base::Thread* worker_thread); |
| 54 virtual void DeletePeerConnectionFactory(); |
| 55 virtual bool PeerConnectionFactoryCreated(); |
| 56 |
| 57 // The port allocator is used in CreatePeerConnection(). |
| 58 virtual cricket::PortAllocator* CreatePortAllocator( |
| 59 content::P2PSocketDispatcher* socket_dispatcher, |
| 60 talk_base::NetworkManager* network_manager, |
| 61 talk_base::PacketSocketFactory* socket_factory, |
| 62 const webkit_glue::P2PTransport::Config& config); |
| 63 |
| 64 // Asks the PeerConnection factory to create a PeerConnection object. See |
| 65 // MediaStreamImpl for details about |signaling_thread|. The PeerConnection |
| 66 // object is owned by PeerConnectionHandler. |
| 67 virtual webrtc::PeerConnection* CreatePeerConnection( |
| 68 cricket::PortAllocator* port_allocator, |
| 69 talk_base::Thread* signaling_thread); |
| 70 |
| 71 private: |
| 72 scoped_ptr<webrtc::PeerConnectionFactory> pc_factory_; |
| 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
| 75 }; |
| 76 |
| 77 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |