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

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: Rebased. 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 // CreateNativeMediaStreamAudioSources creates 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 CreateNativeMediaStreamAudioSources(
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 virtual cricket::VideoCapturer* CreateVideoCapturer(
87 const StreamDeviceInfo& info);
88
89 // Asks the PeerConnection factory to create a Local Video Source.
90 // Takes ownership of |capturer|.
91 // TODO(perkj): Temporary until we don't need a webrtc::VideoSourceInterface.
92 virtual scoped_refptr<webrtc::VideoSourceInterface>
93 CreateLocalVideoSource(
94 cricket::VideoCapturer* capturer,
95 const blink::WebMediaConstraints& video_constraints);
90 96
91 // Creates a libjingle representation of a MediaStream and stores 97 // Creates a libjingle representation of a MediaStream and stores
92 // it in the extra data field of |web_stream|. 98 // it in the extra data field of |web_stream|.
93 void CreateNativeLocalMediaStream( 99 void CreateNativeLocalMediaStream(
94 blink::WebMediaStream* web_stream); 100 blink::WebMediaStream* web_stream);
95 101
96 // Creates a libjingle representation of a MediaStream and stores 102 // Creates a libjingle representation of a MediaStream and stores
97 // it in the extra data field of |web_stream|. 103 // it in the extra data field of |web_stream|.
98 // |stream_stopped| is a callback that is run when a MediaStream have been 104 // |stream_stopped| is a callback that is run when a MediaStream have been
99 // stopped. 105 // stopped.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 protected: 168 protected:
163 // Asks the PeerConnection factory to create a Local MediaStream object. 169 // Asks the PeerConnection factory to create a Local MediaStream object.
164 virtual scoped_refptr<webrtc::MediaStreamInterface> 170 virtual scoped_refptr<webrtc::MediaStreamInterface>
165 CreateLocalMediaStream(const std::string& label); 171 CreateLocalMediaStream(const std::string& label);
166 172
167 // Asks the PeerConnection factory to create a Local Audio Source. 173 // Asks the PeerConnection factory to create a Local Audio Source.
168 virtual scoped_refptr<webrtc::AudioSourceInterface> 174 virtual scoped_refptr<webrtc::AudioSourceInterface>
169 CreateLocalAudioSource( 175 CreateLocalAudioSource(
170 const webrtc::MediaConstraintsInterface* constraints); 176 const webrtc::MediaConstraintsInterface* constraints);
171 177
172 // Asks the PeerConnection factory to create a Local Video Source.
173 virtual scoped_refptr<webrtc::VideoSourceInterface>
174 CreateLocalVideoSource(
175 int video_session_id,
176 bool is_screen_cast,
177 const webrtc::MediaConstraintsInterface* constraints);
178
179 // Creates a media::AudioCapturerSource with an implementation that is 178 // Creates a media::AudioCapturerSource with an implementation that is
180 // specific for a WebAudio source. The created WebAudioCapturerSource 179 // specific for a WebAudio source. The created WebAudioCapturerSource
181 // instance will function as audio source instead of the default 180 // instance will function as audio source instead of the default
182 // WebRtcAudioCapturer. 181 // WebRtcAudioCapturer.
183 // The |constraints| will be modified to include the default, mandatory 182 // The |constraints| will be modified to include the default, mandatory
184 // WebAudio constraints. 183 // WebAudio constraints.
185 virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource( 184 virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource(
186 blink::WebMediaStreamSource* source, RTCMediaConstraints* constraints); 185 blink::WebMediaStreamSource* source, RTCMediaConstraints* constraints);
187 186
188 // Asks the PeerConnection factory to create a Local AudioTrack object. 187 // Asks the PeerConnection factory to create a Local AudioTrack object.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 base::Thread chrome_worker_thread_; 262 base::Thread chrome_worker_thread_;
264 263
265 base::PlatformFile aec_dump_file_; 264 base::PlatformFile aec_dump_file_;
266 265
267 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); 266 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory);
268 }; 267 };
269 268
270 } // namespace content 269 } // namespace content
271 270
272 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 271 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698