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" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // stopped. | 88 // stopped. |
89 void CreateNativeLocalMediaStream( | 89 void CreateNativeLocalMediaStream( |
90 WebKit::WebMediaStream* description, | 90 WebKit::WebMediaStream* description, |
91 const MediaStreamExtraData::StreamStopCallback& stream_stop); | 91 const MediaStreamExtraData::StreamStopCallback& stream_stop); |
92 | 92 |
93 // Adds a libjingle representation of a MediaStreamTrack to |stream| based | 93 // Adds a libjingle representation of a MediaStreamTrack to |stream| based |
94 // on the source of |track|. | 94 // on the source of |track|. |
95 bool AddNativeMediaStreamTrack(const WebKit::WebMediaStream& stream, | 95 bool AddNativeMediaStreamTrack(const WebKit::WebMediaStream& stream, |
96 const WebKit::WebMediaStreamTrack& track); | 96 const WebKit::WebMediaStreamTrack& track); |
97 | 97 |
| 98 // Creates and adds libjingle representation of a MediaStreamTrack to |stream| |
| 99 // based on the desired |track_id| and |capturer|. |
| 100 bool AddNativeVideoMediaTrack(const std::string& track_id, |
| 101 WebKit::WebMediaStream* stream, |
| 102 cricket::VideoCapturer* capturer); |
| 103 |
98 bool RemoveNativeMediaStreamTrack(const WebKit::WebMediaStream& stream, | 104 bool RemoveNativeMediaStreamTrack(const WebKit::WebMediaStream& stream, |
99 const WebKit::WebMediaStreamTrack& track); | 105 const WebKit::WebMediaStreamTrack& track); |
100 | 106 |
101 // Asks the libjingle PeerConnection factory to create a libjingle | 107 // Asks the libjingle PeerConnection factory to create a libjingle |
102 // PeerConnection object. | 108 // PeerConnection object. |
103 // The PeerConnection object is owned by PeerConnectionHandler. | 109 // The PeerConnection object is owned by PeerConnectionHandler. |
104 virtual scoped_refptr<webrtc::PeerConnectionInterface> | 110 virtual scoped_refptr<webrtc::PeerConnectionInterface> |
105 CreatePeerConnection( | 111 CreatePeerConnection( |
106 const webrtc::PeerConnectionInterface::IceServers& ice_servers, | 112 const webrtc::PeerConnectionInterface::IceServers& ice_servers, |
107 const webrtc::MediaConstraintsInterface* constraints, | 113 const webrtc::MediaConstraintsInterface* constraints, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // Asks the PeerConnection factory to create a Local AudioTrack object. | 166 // Asks the PeerConnection factory to create a Local AudioTrack object. |
161 virtual scoped_refptr<webrtc::AudioTrackInterface> | 167 virtual scoped_refptr<webrtc::AudioTrackInterface> |
162 CreateLocalAudioTrack(const std::string& id, | 168 CreateLocalAudioTrack(const std::string& id, |
163 webrtc::AudioSourceInterface* source); | 169 webrtc::AudioSourceInterface* source); |
164 | 170 |
165 // Asks the PeerConnection factory to create a Local VideoTrack object. | 171 // Asks the PeerConnection factory to create a Local VideoTrack object. |
166 virtual scoped_refptr<webrtc::VideoTrackInterface> | 172 virtual scoped_refptr<webrtc::VideoTrackInterface> |
167 CreateLocalVideoTrack(const std::string& id, | 173 CreateLocalVideoTrack(const std::string& id, |
168 webrtc::VideoSourceInterface* source); | 174 webrtc::VideoSourceInterface* source); |
169 | 175 |
| 176 // Asks the PeerConnection factory to create a Local VideoTrack object with |
| 177 // the video source using |capturer|. |
| 178 virtual scoped_refptr<webrtc::VideoTrackInterface> |
| 179 CreateLocalVideoTrack(const std::string& id, |
| 180 cricket::VideoCapturer* capturer); |
| 181 |
170 virtual bool EnsurePeerConnectionFactory(); | 182 virtual bool EnsurePeerConnectionFactory(); |
171 virtual bool PeerConnectionFactoryCreated(); | 183 virtual bool PeerConnectionFactoryCreated(); |
172 | 184 |
173 private: | 185 private: |
174 // Creates and deletes |pc_factory_|, which in turn is used for | 186 // Creates and deletes |pc_factory_|, which in turn is used for |
175 // creating PeerConnection objects. | 187 // creating PeerConnection objects. |
176 bool CreatePeerConnectionFactory(); | 188 bool CreatePeerConnectionFactory(); |
177 | 189 |
178 void InitializeWorkerThread(talk_base::Thread** thread, | 190 void InitializeWorkerThread(talk_base::Thread** thread, |
179 base::WaitableEvent* event); | 191 base::WaitableEvent* event); |
(...skipping 18 matching lines...) Expand all Loading... |
198 talk_base::Thread* signaling_thread_; | 210 talk_base::Thread* signaling_thread_; |
199 talk_base::Thread* worker_thread_; | 211 talk_base::Thread* worker_thread_; |
200 base::Thread chrome_worker_thread_; | 212 base::Thread chrome_worker_thread_; |
201 | 213 |
202 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); | 214 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
203 }; | 215 }; |
204 | 216 |
205 } // namespace content | 217 } // namespace content |
206 | 218 |
207 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 219 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |