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

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

Issue 11783059: Ensures that WebRTC works for device selection using a different sample rate than default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Had to restore usage of UTF16ToUTF8() in MediaStreamImpl::OnCreateNativeSourcesComplete to build on… Created 7 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 28 matching lines...) Expand all
39 class WebRTCPeerConnectionHandler; 39 class WebRTCPeerConnectionHandler;
40 class WebRTCPeerConnectionHandlerClient; 40 class WebRTCPeerConnectionHandlerClient;
41 } 41 }
42 42
43 namespace content { 43 namespace content {
44 44
45 class IpcNetworkManager; 45 class IpcNetworkManager;
46 class IpcPacketSocketFactory; 46 class IpcPacketSocketFactory;
47 class VideoCaptureImplManager; 47 class VideoCaptureImplManager;
48 class WebRtcAudioDeviceImpl; 48 class WebRtcAudioDeviceImpl;
49 struct StreamDeviceInfo;
49 50
50 // Object factory for RTC MediaStreams and RTC PeerConnections. 51 // Object factory for RTC MediaStreams and RTC PeerConnections.
51 class CONTENT_EXPORT MediaStreamDependencyFactory 52 class CONTENT_EXPORT MediaStreamDependencyFactory
52 : NON_EXPORTED_BASE(public base::NonThreadSafe) { 53 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
53 public: 54 public:
54 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. 55 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources.
55 typedef base::Callback<void(WebKit::WebMediaStreamDescriptor* description, 56 typedef base::Callback<void(WebKit::WebMediaStreamDescriptor* description,
56 bool live)> MediaSourcesCreatedCallback; 57 bool live)> MediaSourcesCreatedCallback;
57 MediaStreamDependencyFactory( 58 MediaStreamDependencyFactory(
58 VideoCaptureImplManager* vc_manager, 59 VideoCaptureImplManager* vc_manager,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Asks the PeerConnection factory to create a Local MediaStream object. 123 // Asks the PeerConnection factory to create a Local MediaStream object.
123 virtual scoped_refptr<webrtc::LocalMediaStreamInterface> 124 virtual scoped_refptr<webrtc::LocalMediaStreamInterface>
124 CreateLocalMediaStream(const std::string& label); 125 CreateLocalMediaStream(const std::string& label);
125 126
126 // Asks the PeerConnection factory to create a Local Video Source. 127 // Asks the PeerConnection factory to create a Local Video Source.
127 virtual scoped_refptr<webrtc::VideoSourceInterface> 128 virtual scoped_refptr<webrtc::VideoSourceInterface>
128 CreateVideoSource(int video_session_id, 129 CreateVideoSource(int video_session_id,
129 bool is_screen_cast, 130 bool is_screen_cast,
130 const webrtc::MediaConstraintsInterface* constraints); 131 const webrtc::MediaConstraintsInterface* constraints);
131 132
133 // Initializes the source using audio parameters for the selected
134 // capture device and specifies which capture device to use as capture
135 // source.
136 virtual bool InitializeAudioSource(const StreamDeviceInfo& device_info);
137
132 // Asks the PeerConnection factory to create a Local VideoTrack object. 138 // Asks the PeerConnection factory to create a Local VideoTrack object.
133 virtual scoped_refptr<webrtc::VideoTrackInterface> 139 virtual scoped_refptr<webrtc::VideoTrackInterface>
134 CreateLocalVideoTrack(const std::string& label, 140 CreateLocalVideoTrack(const std::string& label,
135 webrtc::VideoSourceInterface* source); 141 webrtc::VideoSourceInterface* source);
136 142
137 // Asks the PeerConnection factory to create a Local AudioTrack object. 143 // Asks the PeerConnection factory to create a Local AudioTrack object.
138 virtual scoped_refptr<webrtc::LocalAudioTrackInterface> 144 virtual scoped_refptr<webrtc::LocalAudioTrackInterface>
139 CreateLocalAudioTrack(const std::string& label, 145 CreateLocalAudioTrack(const std::string& label,
140 webrtc::AudioDeviceModule* audio_device); 146 webrtc::AudioDeviceModule* audio_device);
141 147
142 virtual bool EnsurePeerConnectionFactory(); 148 virtual bool EnsurePeerConnectionFactory();
143 virtual bool PeerConnectionFactoryCreated(); 149 virtual bool PeerConnectionFactoryCreated();
144 virtual void SetAudioDeviceSessionId(int session_id);
145 150
146 private: 151 private:
147 // Creates and deletes |pc_factory_|, which in turn is used for 152 // Creates and deletes |pc_factory_|, which in turn is used for
148 // creating PeerConnection objects. 153 // creating PeerConnection objects.
149 bool CreatePeerConnectionFactory(); 154 bool CreatePeerConnectionFactory();
150 155
151 void InitializeWorkerThread(talk_base::Thread** thread, 156 void InitializeWorkerThread(talk_base::Thread** thread,
152 base::WaitableEvent* event); 157 base::WaitableEvent* event);
153 158
154 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); 159 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event);
(...skipping 16 matching lines...) Expand all
171 talk_base::Thread* signaling_thread_; 176 talk_base::Thread* signaling_thread_;
172 talk_base::Thread* worker_thread_; 177 talk_base::Thread* worker_thread_;
173 base::Thread chrome_worker_thread_; 178 base::Thread chrome_worker_thread_;
174 179
175 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); 180 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory);
176 }; 181 };
177 182
178 } // namespace content 183 } // namespace content
179 184
180 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 185 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698