Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.h

Issue 10703095: New PeerConnection handler in Chrome to support latest PeerConnection draft (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Readd the UMA histogram for Deprecated PeerConnection to not screw up the stats. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/media_stream_dependency_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 namespace webrtc { 32 namespace webrtc {
33 class PeerConnection; 33 class PeerConnection;
34 } 34 }
35 35
36 namespace WebKit { 36 namespace WebKit {
37 class WebMediaStreamDescriptor; 37 class WebMediaStreamDescriptor;
38 class WebPeerConnection00Handler; 38 class WebPeerConnection00Handler;
39 class WebPeerConnection00HandlerClient; 39 class WebPeerConnection00HandlerClient;
40 class WebRTCPeerConnectionHandler;
41 class WebRTCPeerConnectionHandlerClient;
40 } 42 }
41 43
42 class WebRtcAudioDeviceImpl; 44 class WebRtcAudioDeviceImpl;
43 class VideoCaptureImplManager; 45 class VideoCaptureImplManager;
44 46
45 // Object factory for RTC MediaStreams and RTC PeerConnections. 47 // Object factory for RTC MediaStreams and RTC PeerConnections.
46 class CONTENT_EXPORT MediaStreamDependencyFactory 48 class CONTENT_EXPORT MediaStreamDependencyFactory
47 : NON_EXPORTED_BASE(public base::NonThreadSafe) { 49 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
48 public: 50 public:
49 MediaStreamDependencyFactory( 51 MediaStreamDependencyFactory(
50 VideoCaptureImplManager* vc_manager, 52 VideoCaptureImplManager* vc_manager,
51 content::P2PSocketDispatcher* p2p_socket_dispatcher); 53 content::P2PSocketDispatcher* p2p_socket_dispatcher);
52 virtual ~MediaStreamDependencyFactory(); 54 virtual ~MediaStreamDependencyFactory();
53 55
54 // Create a a PeerConnectionHandlerJsep object that implements the 56 // Create a PeerConnectionHandlerJsep object that implements the
55 // WebKit WebPeerConnection00Handler interface. 57 // WebKit WebPeerConnection00Handler interface.
56 WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep( 58 WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep(
57 WebKit::WebPeerConnection00HandlerClient* client); 59 WebKit::WebPeerConnection00HandlerClient* client);
58 60
61 // Create a RTCPeerConnectionHandler object that implements the
62 // WebKit WebRTCPeerConnectionHandler interface.
63 WebKit::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler(
64 WebKit::WebRTCPeerConnectionHandlerClient* client);
65
59 // Creates a libjingle representation of a MediaStream and stores 66 // Creates a libjingle representation of a MediaStream and stores
60 // it in the extra data field of |description| 67 // it in the extra data field of |description|
61 bool CreateNativeLocalMediaStream( 68 bool CreateNativeLocalMediaStream(
62 WebKit::WebMediaStreamDescriptor* description); 69 WebKit::WebMediaStreamDescriptor* description);
63 70
64 // Asks the libjingle PeerConnection factory to create a libjingle 71 // Asks the libjingle PeerConnection factory to create a libjingle
65 // PeerConnection object. 72 // PeerConnection object.
66 // The PeerConnection object is owned by PeerConnectionHandler. 73 // The PeerConnection object is owned by PeerConnectionHandler.
67 virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface> 74 virtual scoped_refptr<webrtc::PeerConnectionInterface>
68 CreatePeerConnection(const std::string& config, 75 CreatePeerConnection(const std::string& config,
69 webrtc::PeerConnectionObserver* observer); 76 webrtc::PeerConnectionObserver* observer);
70 77
71 // Creates a libjingle representation of a Session description. 78 virtual scoped_refptr<webrtc::PeerConnectionInterface>
79 CreatePeerConnection(const webrtc::JsepInterface::IceServers& ice_servers,
80 const webrtc::MediaConstraintsInterface* constraints,
81 webrtc::PeerConnectionObserver* observer);
82
83 // Creates a libjingle representation of a Session description. Used by a
84 // PeerConnectionHandlerJsep instance.
72 virtual webrtc::SessionDescriptionInterface* CreateSessionDescription( 85 virtual webrtc::SessionDescriptionInterface* CreateSessionDescription(
73 const std::string& sdp); 86 const std::string& sdp);
74 87
88 // Creates a libjingle representation of a Session description. Used by a
89 // RTCPeerConnectionHandler instance.
90 virtual webrtc::SessionDescriptionInterface* CreateSessionDescription(
91 const std::string& type,
92 const std::string& sdp);
93
75 // Creates a libjingle representation of an ice candidate. 94 // Creates a libjingle representation of an ice candidate.
76 virtual webrtc::IceCandidateInterface* CreateIceCandidate( 95 virtual webrtc::IceCandidateInterface* CreateIceCandidate(
77 const std::string& sdp_mid, 96 const std::string& sdp_mid,
78 int sdp_mline_index, 97 int sdp_mline_index,
79 const std::string& sdp); 98 const std::string& sdp);
80 99
81 protected: 100 protected:
82 // Asks the PeerConnection factory to create a Local MediaStream object. 101 // Asks the PeerConnection factory to create a Local MediaStream object.
83 virtual talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> 102 virtual scoped_refptr<webrtc::LocalMediaStreamInterface>
84 CreateLocalMediaStream(const std::string& label); 103 CreateLocalMediaStream(const std::string& label);
85 104
86 // Asks the PeerConnection factory to create a Local VideoTrack object. 105 // Asks the PeerConnection factory to create a Local VideoTrack object.
87 virtual talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> 106 virtual scoped_refptr<webrtc::LocalVideoTrackInterface>
88 CreateLocalVideoTrack(const std::string& label, 107 CreateLocalVideoTrack(const std::string& label,
89 int video_session_id); 108 int video_session_id);
90 109
91 // Asks the PeerConnection factory to create a Local AudioTrack object. 110 // Asks the PeerConnection factory to create a Local AudioTrack object.
92 virtual talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> 111 virtual scoped_refptr<webrtc::LocalAudioTrackInterface>
93 CreateLocalAudioTrack(const std::string& label, 112 CreateLocalAudioTrack(const std::string& label,
94 webrtc::AudioDeviceModule* audio_device); 113 webrtc::AudioDeviceModule* audio_device);
95 114
96 virtual bool EnsurePeerConnectionFactory(); 115 virtual bool EnsurePeerConnectionFactory();
97 virtual void SetAudioDeviceSessionId(int session_id); 116 virtual void SetAudioDeviceSessionId(int session_id);
98 117
99 private: 118 private:
100 // Creates and deletes |pc_factory_|, which in turn is used for 119 // Creates and deletes |pc_factory_|, which in turn is used for
101 // creating PeerConnection objects. 120 // creating PeerConnection objects.
102 bool CreatePeerConnectionFactory( 121 bool CreatePeerConnectionFactory(
103 talk_base::Thread* worker_thread, 122 talk_base::Thread* worker_thread,
104 talk_base::Thread* signaling_thread, 123 talk_base::Thread* signaling_thread,
105 content::P2PSocketDispatcher* socket_dispatcher, 124 content::P2PSocketDispatcher* socket_dispatcher,
106 talk_base::NetworkManager* network_manager, 125 talk_base::NetworkManager* network_manager,
107 talk_base::PacketSocketFactory* socket_factory); 126 talk_base::PacketSocketFactory* socket_factory);
108 bool PeerConnectionFactoryCreated(); 127 bool PeerConnectionFactoryCreated();
109 128
110 void InitializeWorkerThread(talk_base::Thread** thread, 129 void InitializeWorkerThread(talk_base::Thread** thread,
111 base::WaitableEvent* event); 130 base::WaitableEvent* event);
112 131
113 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); 132 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event);
114 void DeleteIpcNetworkManager(); 133 void DeleteIpcNetworkManager();
115 void CleanupPeerConnectionFactory(); 134 void CleanupPeerConnectionFactory();
116 135
117 // We own network_manager_, must be deleted on the worker thread. 136 // We own network_manager_, must be deleted on the worker thread.
118 // The network manager uses |p2p_socket_dispatcher_|. 137 // The network manager uses |p2p_socket_dispatcher_|.
119 content::IpcNetworkManager* network_manager_; 138 content::IpcNetworkManager* network_manager_;
120 scoped_ptr<content::IpcPacketSocketFactory> socket_factory_; 139 scoped_ptr<content::IpcPacketSocketFactory> socket_factory_;
121 140
122 talk_base::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; 141 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_;
123 142
124 scoped_refptr<VideoCaptureImplManager> vc_manager_; 143 scoped_refptr<VideoCaptureImplManager> vc_manager_;
125 scoped_refptr<content::P2PSocketDispatcher> p2p_socket_dispatcher_; 144 scoped_refptr<content::P2PSocketDispatcher> p2p_socket_dispatcher_;
126 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; 145 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_;
127 146
128 // PeerConnection threads. signaling_thread_ is created from the 147 // PeerConnection threads. signaling_thread_ is created from the
129 // "current" chrome thread. 148 // "current" chrome thread.
130 talk_base::Thread* signaling_thread_; 149 talk_base::Thread* signaling_thread_;
131 talk_base::Thread* worker_thread_; 150 talk_base::Thread* worker_thread_;
132 base::Thread chrome_worker_thread_; 151 base::Thread chrome_worker_thread_;
133 152
134 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); 153 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory);
135 }; 154 };
136 155
137 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 156 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/media_stream_dependency_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698