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

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

Issue 131763002: Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Ronghuas and Jois comments. Created 6 years, 11 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 bool live)> MediaSourcesCreatedCallback; 67 bool live)> MediaSourcesCreatedCallback;
68 MediaStreamDependencyFactory( 68 MediaStreamDependencyFactory(
69 P2PSocketDispatcher* p2p_socket_dispatcher); 69 P2PSocketDispatcher* p2p_socket_dispatcher);
70 virtual ~MediaStreamDependencyFactory(); 70 virtual ~MediaStreamDependencyFactory();
71 71
72 // Create a RTCPeerConnectionHandler object that implements the 72 // Create a RTCPeerConnectionHandler object that implements the
73 // WebKit WebRTCPeerConnectionHandler interface. 73 // WebKit WebRTCPeerConnectionHandler interface.
74 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( 74 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler(
75 blink::WebRTCPeerConnectionHandlerClient* client); 75 blink::WebRTCPeerConnectionHandlerClient* client);
76 76
77 // CreateNativeMediaSources creates libjingle representations of 77 // InitializeMediaStreamAudioSource initialize a MediaStream source object
78 // the underlying sources to the tracks in |web_stream|. 78 // for audio input.
79 // |sources_created| is invoked when the sources have either been created and 79 // The sources are stored in the extra data field of
80 // transitioned to a live state or failed.
81 // The libjingle sources is stored in the extra data field of
82 // WebMediaStreamSource. 80 // WebMediaStreamSource.
83 // |audio_constraints| and |video_constraints| set parameters for the sources. 81 bool InitializeMediaStreamAudioSource(
84 void CreateNativeMediaSources(
85 int render_view_id, 82 int render_view_id,
86 const blink::WebMediaConstraints& audio_constraints, 83 const blink::WebMediaConstraints& audio_constraints,
87 const blink::WebMediaConstraints& video_constraints, 84 const blink::WebVector<blink::WebMediaStreamSource>& audio_sources);
88 blink::WebMediaStream* web_stream, 85
89 const MediaSourcesCreatedCallback& sources_created); 86 // Creates an implementation of a cricket::VideoCapturer object that can be
87 // used when creating a libjingle webrtc::VideoSourceInterface object.
88 virtual cricket::VideoCapturer* CreateVideoCapturer(
89 const StreamDeviceInfo& info);
90 90
91 // Creates a libjingle representation of a MediaStream and stores 91 // Creates a libjingle representation of a MediaStream and stores
92 // it in the extra data field of |web_stream|. 92 // it in the extra data field of |web_stream|.
93 void CreateNativeLocalMediaStream( 93 void CreateNativeLocalMediaStream(
94 blink::WebMediaStream* web_stream); 94 blink::WebMediaStream* web_stream);
95 95
96 // Creates a libjingle representation of a MediaStream and stores 96 // Creates a libjingle representation of a MediaStream and stores
97 // it in the extra data field of |web_stream|. 97 // it in the extra data field of |web_stream|.
98 // |stream_stopped| is a callback that is run when a MediaStream have been 98 // |stream_stopped| is a callback that is run when a MediaStream have been
99 // stopped. 99 // stopped.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 protected: 169 protected:
170 // Asks the PeerConnection factory to create a Local MediaStream object. 170 // Asks the PeerConnection factory to create a Local MediaStream object.
171 virtual scoped_refptr<webrtc::MediaStreamInterface> 171 virtual scoped_refptr<webrtc::MediaStreamInterface>
172 CreateLocalMediaStream(const std::string& label); 172 CreateLocalMediaStream(const std::string& label);
173 173
174 // Asks the PeerConnection factory to create a Local Audio Source. 174 // Asks the PeerConnection factory to create a Local Audio Source.
175 virtual scoped_refptr<webrtc::AudioSourceInterface> 175 virtual scoped_refptr<webrtc::AudioSourceInterface>
176 CreateLocalAudioSource( 176 CreateLocalAudioSource(
177 const webrtc::MediaConstraintsInterface* constraints); 177 const webrtc::MediaConstraintsInterface* constraints);
178 178
179 // Asks the PeerConnection factory to create a Local Video Source.
180 virtual scoped_refptr<webrtc::VideoSourceInterface>
181 CreateLocalVideoSource(
182 int video_session_id,
183 bool is_screen_cast,
184 const webrtc::MediaConstraintsInterface* constraints);
185
186 // Creates a media::AudioCapturerSource with an implementation that is 179 // Creates a media::AudioCapturerSource with an implementation that is
187 // specific for a WebAudio source. The created WebAudioCapturerSource 180 // specific for a WebAudio source. The created WebAudioCapturerSource
188 // instance will function as audio source instead of the default 181 // instance will function as audio source instead of the default
189 // WebRtcAudioCapturer. 182 // WebRtcAudioCapturer.
190 // The |constraints| will be modified to include the default, mandatory 183 // The |constraints| will be modified to include the default, mandatory
191 // WebAudio constraints. 184 // WebAudio constraints.
192 virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource( 185 virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource(
193 blink::WebMediaStreamSource* source, 186 blink::WebMediaStreamSource* source,
194 const RTCMediaConstraints& constraints); 187 const RTCMediaConstraints& constraints);
195 188
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 base::Thread chrome_worker_thread_; 264 base::Thread chrome_worker_thread_;
272 265
273 base::PlatformFile aec_dump_file_; 266 base::PlatformFile aec_dump_file_;
274 267
275 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); 268 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory);
276 }; 269 };
277 270
278 } // namespace content 271 } // namespace content
279 272
280 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 273 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698