| OLD | NEW | 
|    1 /* |    1 /* | 
|    2  *  Copyright 2011 The WebRTC project authors. All Rights Reserved. |    2  *  Copyright 2011 The WebRTC project authors. All Rights Reserved. | 
|    3  * |    3  * | 
|    4  *  Use of this source code is governed by a BSD-style license |    4  *  Use of this source code is governed by a BSD-style license | 
|    5  *  that can be found in the LICENSE file in the root of the source |    5  *  that can be found in the LICENSE file in the root of the source | 
|    6  *  tree. An additional intellectual property rights grant can be found |    6  *  tree. An additional intellectual property rights grant can be found | 
|    7  *  in the file PATENTS.  All contributing project authors may |    7  *  in the file PATENTS.  All contributing project authors may | 
|    8  *  be found in the AUTHORS file in the root of the source tree. |    8  *  be found in the AUTHORS file in the root of the source tree. | 
|    9  */ |    9  */ | 
|   10  |   10  | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|   26 class BasicNetworkManager; |   26 class BasicNetworkManager; | 
|   27 class BasicPacketSocketFactory; |   27 class BasicPacketSocketFactory; | 
|   28 } |   28 } | 
|   29  |   29  | 
|   30 namespace webrtc { |   30 namespace webrtc { | 
|   31  |   31  | 
|   32 class RtcEventLog; |   32 class RtcEventLog; | 
|   33  |   33  | 
|   34 class PeerConnectionFactory : public PeerConnectionFactoryInterface { |   34 class PeerConnectionFactory : public PeerConnectionFactoryInterface { | 
|   35  public: |   35  public: | 
 |   36   // Use the overloads of CreateVideoSource that take raw VideoCapturer | 
 |   37   // pointers from PeerConnectionFactoryInterface. | 
 |   38   // TODO(deadbeef): Remove this using statement once those overloads are | 
 |   39   // removed. | 
 |   40   using PeerConnectionFactoryInterface::CreateVideoSource; | 
 |   41  | 
|   36   void SetOptions(const Options& options) override; |   42   void SetOptions(const Options& options) override; | 
|   37  |   43  | 
|   38   // Deprecated, use version without constraints. |   44   // Deprecated, use version without constraints. | 
|   39   rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |   45   rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 
|   40       const PeerConnectionInterface::RTCConfiguration& configuration, |   46       const PeerConnectionInterface::RTCConfiguration& configuration, | 
|   41       const MediaConstraintsInterface* constraints, |   47       const MediaConstraintsInterface* constraints, | 
|   42       std::unique_ptr<cricket::PortAllocator> allocator, |   48       std::unique_ptr<cricket::PortAllocator> allocator, | 
|   43       std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |   49       std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, | 
|   44       PeerConnectionObserver* observer) override; |   50       PeerConnectionObserver* observer) override; | 
|   45  |   51  | 
|   46   virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |   52   virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 
|   47       const PeerConnectionInterface::RTCConfiguration& configuration, |   53       const PeerConnectionInterface::RTCConfiguration& configuration, | 
|   48       std::unique_ptr<cricket::PortAllocator> allocator, |   54       std::unique_ptr<cricket::PortAllocator> allocator, | 
|   49       std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |   55       std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, | 
|   50       PeerConnectionObserver* observer) override; |   56       PeerConnectionObserver* observer) override; | 
|   51  |   57  | 
|   52   bool Initialize(); |   58   bool Initialize(); | 
|   53  |   59  | 
|   54   rtc::scoped_refptr<MediaStreamInterface> |   60   rtc::scoped_refptr<MediaStreamInterface> | 
|   55       CreateLocalMediaStream(const std::string& label) override; |   61       CreateLocalMediaStream(const std::string& label) override; | 
|   56  |   62  | 
|   57   virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |   63   virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | 
|   58       const cricket::AudioOptions& options) override; |   64       const cricket::AudioOptions& options) override; | 
|   59   // Deprecated, use version without constraints. |   65   // Deprecated, use version without constraints. | 
|   60   rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |   66   rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | 
|   61       const MediaConstraintsInterface* constraints) override; |   67       const MediaConstraintsInterface* constraints) override; | 
|   62  |   68  | 
|   63   virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |   69   virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( | 
|   64       cricket::VideoCapturer* capturer) override; |   70       std::unique_ptr<cricket::VideoCapturer> capturer) override; | 
|   65   // This version supports filtering on width, height and frame rate. |   71   // This version supports filtering on width, height and frame rate. | 
|   66   // For the "constraints=null" case, use the version without constraints. |   72   // For the "constraints=null" case, use the version without constraints. | 
|   67   // TODO(hta): Design a version without MediaConstraintsInterface. |   73   // TODO(hta): Design a version without MediaConstraintsInterface. | 
|   68   // https://bugs.chromium.org/p/webrtc/issues/detail?id=5617 |   74   // https://bugs.chromium.org/p/webrtc/issues/detail?id=5617 | 
|   69   rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |   75   rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( | 
|   70       cricket::VideoCapturer* capturer, |   76       std::unique_ptr<cricket::VideoCapturer> capturer, | 
|   71       const MediaConstraintsInterface* constraints) override; |   77       const MediaConstraintsInterface* constraints) override; | 
|   72  |   78  | 
|   73   rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( |   79   rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( | 
|   74       const std::string& id, |   80       const std::string& id, | 
|   75       VideoTrackSourceInterface* video_source) override; |   81       VideoTrackSourceInterface* video_source) override; | 
|   76  |   82  | 
|   77   rtc::scoped_refptr<AudioTrackInterface> |   83   rtc::scoped_refptr<AudioTrackInterface> | 
|   78       CreateAudioTrack(const std::string& id, |   84       CreateAudioTrack(const std::string& id, | 
|   79                        AudioSourceInterface* audio_source) override; |   85                        AudioSourceInterface* audio_source) override; | 
|   80  |   86  | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|  111       rtc::Thread* signaling_thread, |  117       rtc::Thread* signaling_thread, | 
|  112       AudioDeviceModule* default_adm, |  118       AudioDeviceModule* default_adm, | 
|  113       rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, |  119       rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, | 
|  114       rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, |  120       rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, | 
|  115       cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |  121       cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 
|  116       cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |  122       cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | 
|  117       rtc::scoped_refptr<AudioMixer> audio_mixer); |  123       rtc::scoped_refptr<AudioMixer> audio_mixer); | 
|  118   virtual ~PeerConnectionFactory(); |  124   virtual ~PeerConnectionFactory(); | 
|  119  |  125  | 
|  120  private: |  126  private: | 
|  121   cricket::MediaEngineInterface* CreateMediaEngine_w(); |  127   std::unique_ptr<cricket::MediaEngineInterface> CreateMediaEngine_w(); | 
|  122  |  128  | 
|  123   bool owns_ptrs_; |  129   bool owns_ptrs_; | 
|  124   bool wraps_current_thread_; |  130   bool wraps_current_thread_; | 
|  125   rtc::Thread* network_thread_; |  131   rtc::Thread* network_thread_; | 
|  126   rtc::Thread* worker_thread_; |  132   rtc::Thread* worker_thread_; | 
|  127   rtc::Thread* signaling_thread_; |  133   rtc::Thread* signaling_thread_; | 
|  128   Options options_; |  134   Options options_; | 
|  129   // External Audio device used for audio playback. |  135   // External Audio device used for audio playback. | 
|  130   rtc::scoped_refptr<AudioDeviceModule> default_adm_; |  136   rtc::scoped_refptr<AudioDeviceModule> default_adm_; | 
|  131   rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory_; |  137   rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory_; | 
|  132   std::unique_ptr<cricket::ChannelManager> channel_manager_; |  138   std::unique_ptr<cricket::ChannelManager> channel_manager_; | 
|  133   // External Video encoder factory. This can be NULL if the client has not |  139   // External Video encoder factory. This can be NULL if the client has not | 
|  134   // injected any. In that case, video engine will use the internal SW encoder. |  140   // injected any. In that case, video engine will use the internal SW encoder. | 
|  135   std::unique_ptr<cricket::WebRtcVideoEncoderFactory> video_encoder_factory_; |  141   std::unique_ptr<cricket::WebRtcVideoEncoderFactory> video_encoder_factory_; | 
|  136   // External Video decoder factory. This can be NULL if the client has not |  142   // External Video decoder factory. This can be NULL if the client has not | 
|  137   // injected any. In that case, video engine will use the internal SW decoder. |  143   // injected any. In that case, video engine will use the internal SW decoder. | 
|  138   std::unique_ptr<cricket::WebRtcVideoDecoderFactory> video_decoder_factory_; |  144   std::unique_ptr<cricket::WebRtcVideoDecoderFactory> video_decoder_factory_; | 
|  139   std::unique_ptr<rtc::BasicNetworkManager> default_network_manager_; |  145   std::unique_ptr<rtc::BasicNetworkManager> default_network_manager_; | 
|  140   std::unique_ptr<rtc::BasicPacketSocketFactory> default_socket_factory_; |  146   std::unique_ptr<rtc::BasicPacketSocketFactory> default_socket_factory_; | 
|  141   // External audio mixer. This can be NULL. In that case, internal audio mixer |  147   // External audio mixer. This can be NULL. In that case, internal audio mixer | 
|  142   // will be created and used. |  148   // will be created and used. | 
|  143   rtc::scoped_refptr<AudioMixer> external_audio_mixer_; |  149   rtc::scoped_refptr<AudioMixer> external_audio_mixer_; | 
|  144 }; |  150 }; | 
|  145  |  151  | 
|  146 }  // namespace webrtc |  152 }  // namespace webrtc | 
|  147  |  153  | 
|  148 #endif  // WEBRTC_PC_PEERCONNECTIONFACTORY_H_ |  154 #endif  // WEBRTC_PC_PEERCONNECTIONFACTORY_H_ | 
| OLD | NEW |