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