OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/renderer/media/media_stream_extra_data.h" |
14 #include "content/renderer/p2p/socket_dispatcher.h" | 15 #include "content/renderer/p2p/socket_dispatcher.h" |
15 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" | 16 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class WaitableEvent; | 19 class WaitableEvent; |
19 } | 20 } |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 class IpcNetworkManager; | 23 class IpcNetworkManager; |
23 class IpcPacketSocketFactory; | 24 class IpcPacketSocketFactory; |
(...skipping 10 matching lines...) Expand all Loading... |
34 } | 35 } |
35 | 36 |
36 namespace WebKit { | 37 namespace WebKit { |
37 class WebMediaStreamDescriptor; | 38 class WebMediaStreamDescriptor; |
38 class WebPeerConnection00Handler; | 39 class WebPeerConnection00Handler; |
39 class WebPeerConnection00HandlerClient; | 40 class WebPeerConnection00HandlerClient; |
40 class WebRTCPeerConnectionHandler; | 41 class WebRTCPeerConnectionHandler; |
41 class WebRTCPeerConnectionHandlerClient; | 42 class WebRTCPeerConnectionHandlerClient; |
42 } | 43 } |
43 | 44 |
| 45 class VideoCaptureImplManager; |
44 class WebRtcAudioDeviceImpl; | 46 class WebRtcAudioDeviceImpl; |
45 class VideoCaptureImplManager; | |
46 | 47 |
47 // Object factory for RTC MediaStreams and RTC PeerConnections. | 48 // Object factory for RTC MediaStreams and RTC PeerConnections. |
48 class CONTENT_EXPORT MediaStreamDependencyFactory | 49 class CONTENT_EXPORT MediaStreamDependencyFactory |
49 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 50 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
50 public: | 51 public: |
51 MediaStreamDependencyFactory( | 52 MediaStreamDependencyFactory( |
52 VideoCaptureImplManager* vc_manager, | 53 VideoCaptureImplManager* vc_manager, |
53 content::P2PSocketDispatcher* p2p_socket_dispatcher); | 54 content::P2PSocketDispatcher* p2p_socket_dispatcher); |
54 virtual ~MediaStreamDependencyFactory(); | 55 virtual ~MediaStreamDependencyFactory(); |
55 | 56 |
56 // Create a PeerConnectionHandlerJsep object that implements the | 57 // Create a PeerConnectionHandlerJsep object that implements the |
57 // WebKit WebPeerConnection00Handler interface. | 58 // WebKit WebPeerConnection00Handler interface. |
58 WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep( | 59 WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep( |
59 WebKit::WebPeerConnection00HandlerClient* client); | 60 WebKit::WebPeerConnection00HandlerClient* client); |
60 | 61 |
61 // Create a RTCPeerConnectionHandler object that implements the | 62 // Create a RTCPeerConnectionHandler object that implements the |
62 // WebKit WebRTCPeerConnectionHandler interface. | 63 // WebKit WebRTCPeerConnectionHandler interface. |
63 WebKit::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( | 64 WebKit::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( |
64 WebKit::WebRTCPeerConnectionHandlerClient* client); | 65 WebKit::WebRTCPeerConnectionHandlerClient* client); |
65 | 66 |
66 // Creates a libjingle representation of a MediaStream and stores | 67 // Creates a libjingle representation of a MediaStream and stores |
67 // it in the extra data field of |description| | 68 // it in the extra data field of |description|. |
68 bool CreateNativeLocalMediaStream( | 69 bool CreateNativeLocalMediaStream( |
69 WebKit::WebMediaStreamDescriptor* description); | 70 WebKit::WebMediaStreamDescriptor* description); |
70 | 71 |
| 72 // Creates a libjingle representation of a MediaStream and stores |
| 73 // it in the extra data field of |description|. |
| 74 // |stream_stopped| a is callback that is run when a MediaStream have been |
| 75 // stopped. |
| 76 bool CreateNativeLocalMediaStream( |
| 77 WebKit::WebMediaStreamDescriptor* description, |
| 78 const MediaStreamExtraData::StreamStopCallback& stream_stop); |
| 79 |
71 // Asks the libjingle PeerConnection factory to create a libjingle | 80 // Asks the libjingle PeerConnection factory to create a libjingle |
72 // PeerConnection object. | 81 // PeerConnection object. |
73 // The PeerConnection object is owned by PeerConnectionHandler. | 82 // The PeerConnection object is owned by PeerConnectionHandler. |
74 virtual scoped_refptr<webrtc::PeerConnectionInterface> | 83 virtual scoped_refptr<webrtc::PeerConnectionInterface> |
75 CreatePeerConnection(const std::string& config, | 84 CreatePeerConnection(const std::string& config, |
76 webrtc::PeerConnectionObserver* observer); | 85 webrtc::PeerConnectionObserver* observer); |
77 | 86 |
78 virtual scoped_refptr<webrtc::PeerConnectionInterface> | 87 virtual scoped_refptr<webrtc::PeerConnectionInterface> |
79 CreatePeerConnection(const webrtc::JsepInterface::IceServers& ice_servers, | 88 CreatePeerConnection(const webrtc::JsepInterface::IceServers& ice_servers, |
80 const webrtc::MediaConstraintsInterface* constraints, | 89 const webrtc::MediaConstraintsInterface* constraints, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // PeerConnection threads. signaling_thread_ is created from the | 156 // PeerConnection threads. signaling_thread_ is created from the |
148 // "current" chrome thread. | 157 // "current" chrome thread. |
149 talk_base::Thread* signaling_thread_; | 158 talk_base::Thread* signaling_thread_; |
150 talk_base::Thread* worker_thread_; | 159 talk_base::Thread* worker_thread_; |
151 base::Thread chrome_worker_thread_; | 160 base::Thread chrome_worker_thread_; |
152 | 161 |
153 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); | 162 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
154 }; | 163 }; |
155 | 164 |
156 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 165 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |