Index: webrtc/api/peerconnectioninterface.h |
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h |
index 8ff7e1e469c7805e84eed4a0ec2eadb1c5874a23..e95fc5760f85c58de16fa5e755261a42b5e088b3 100644 |
--- a/webrtc/api/peerconnectioninterface.h |
+++ b/webrtc/api/peerconnectioninterface.h |
@@ -90,6 +90,8 @@ |
#include "webrtc/base/rtccertificategenerator.h" |
#include "webrtc/base/socketaddress.h" |
#include "webrtc/base/sslstreamadapter.h" |
+#include "webrtc/call/callfactoryinterface.h" |
+#include "webrtc/logging/rtc_event_log/rtc_event_log_factory_interface.h" |
#include "webrtc/media/base/mediachannel.h" |
#include "webrtc/media/base/videocapturer.h" |
#include "webrtc/p2p/base/portallocator.h" |
@@ -100,6 +102,7 @@ class Thread; |
} |
namespace cricket { |
+class MediaEngineInterface; |
class WebRtcVideoDecoderFactory; |
class WebRtcVideoEncoderFactory; |
} |
@@ -107,6 +110,7 @@ class WebRtcVideoEncoderFactory; |
namespace webrtc { |
class AudioDeviceModule; |
class AudioMixer; |
+class CallFactoryInterface; |
class MediaConstraintsInterface; |
// MediaStream container interface. |
@@ -1018,6 +1022,8 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface { |
~PeerConnectionFactoryInterface() {} // NOLINT |
}; |
+// Deprecated. Use the CreateModularPeerConnectionFactory instead. |
+// |
Taylor Brandstetter
2017/06/14 01:54:15
I don't think we need to deprecate CreatePeerConne
Zhi Huang
2017/06/14 06:57:01
Acknowledged.
|
// Create a new instance of PeerConnectionFactoryInterface. |
// |
// This method relies on the thread it's called on as the "signaling thread" |
@@ -1032,11 +1038,13 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( |
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory); |
-// Deprecated variant of the above. |
+// Deprecated. Use the CreateModularPeerConnectionFactory instead. |
// TODO(kwiberg): Remove. |
rtc::scoped_refptr<PeerConnectionFactoryInterface> |
CreatePeerConnectionFactory(); |
+// Deprecated. Use the CreateModularPeerConnectionFactory instead. |
+// |
// Create a new instance of PeerConnectionFactoryInterface. |
// |
// |network_thread|, |worker_thread| and |signaling_thread| are |
@@ -1067,6 +1075,8 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( |
cricket::WebRtcVideoEncoderFactory* encoder_factory, |
cricket::WebRtcVideoDecoderFactory* decoder_factory); |
+// Deprecated. Use the CreateModularPeerConnectionFactory instead. |
+// |
// Create a new instance of PeerConnectionFactoryInterface with external audio |
// mixer. |
// |
@@ -1095,6 +1105,8 @@ CreatePeerConnectionFactoryWithAudioMixer( |
cricket::WebRtcVideoDecoderFactory* decoder_factory, |
rtc::scoped_refptr<AudioMixer> audio_mixer); |
+// Deprecated. Use the CreateModularPeerConnectionFactory instead. |
+// |
// Create a new instance of PeerConnectionFactoryInterface. |
// Same thread is used as worker and network thread. |
inline rtc::scoped_refptr<PeerConnectionFactoryInterface> |
@@ -1126,6 +1138,37 @@ CreatePeerConnectionFactory( |
default_adm, encoder_factory, decoder_factory); |
} |
+// Create a new instance of PeerConnectionFactoryInterface. |
+// |
+// |worker_thread| is the only mandatory parameter. If the |network_thread| or |
+// the |signaling_thread| is null, the PeerConnectionFactory would create the |
+// |network_thread| internally and use the thread which this method is called as |
+// the |signaling_thread|. In this case, all the threads would be owned by the |
+// PeerConnectionFactory. |
+// |
+// If all the threads passed in are non-null, the PeerConnectionFactory will not |
+// own them. |
Taylor Brandstetter
2017/06/14 01:54:15
This logic related to threads is pretty confusing.
Zhi Huang
2017/06/14 06:57:01
I think your suggestion is not equivalent to the o
Taylor Brandstetter
2017/06/15 00:35:02
We already talked about this in person, but for th
|
+// |
+// If non-null, a reference is added to |default_adm|, and ownership of |
+// |video_encoder_factory| and |video_decoder_factory| is transferred to the |
+// returned factory. |
+// TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this |
+// ownership transfer and ref counting more obvious. |
+rtc::scoped_refptr<PeerConnectionFactoryInterface> |
+CreateModularPeerConnectionFactory( |
+ rtc::Thread* network_thread, |
+ rtc::Thread* worker_thread, |
+ rtc::Thread* signaling_thread, |
+ AudioDeviceModule* default_adm, |
+ rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
+ rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, |
+ cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
+ cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
+ rtc::scoped_refptr<AudioMixer> audio_mixer, |
+ std::unique_ptr<cricket::MediaEngineInterface> media_engine, |
+ std::unique_ptr<CallFactoryInterface> call_factory, |
+ std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory); |
+ |
} // namespace webrtc |
#endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |