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

Unified Diff: webrtc/api/peerconnection.h

Issue 1713043002: Late initialize MediaController, for less resource i.e. ProcessThread, usage by PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: some comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnection.cc » ('j') | webrtc/api/peerconnection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.h
diff --git a/webrtc/api/peerconnection.h b/webrtc/api/peerconnection.h
index a63dd4342358fc96b21a38fe3f67237ed7d98545..93bfe381ce1e244e9b5eb2bc2ed4e837b469520d 100644
--- a/webrtc/api/peerconnection.h
+++ b/webrtc/api/peerconnection.h
@@ -14,6 +14,7 @@
#include <string>
#include "webrtc/api/dtlsidentitystore.h"
+#include "webrtc/api/mediaconstraintsinterface.h"
#include "webrtc/api/peerconnectionfactory.h"
#include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/api/rtpreceiverinterface.h"
@@ -21,6 +22,7 @@
#include "webrtc/api/statscollector.h"
#include "webrtc/api/streamcollection.h"
#include "webrtc/api/webrtcsession.h"
+#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
@@ -74,7 +76,8 @@ class PeerConnection : public PeerConnectionInterface,
std::vector<MediaStreamInterface*> streams) override;
bool RemoveTrack(RtpSenderInterface* sender) override;
- virtual WebRtcSession* session() { return session_.get(); }
+ // This is virtual so it can be mocked.
+ virtual WebRtcSession* session();
rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
AudioTrackInterface* track) override;
@@ -150,6 +153,9 @@ class PeerConnection : public PeerConnectionInterface,
};
typedef std::vector<TrackInfo> TrackInfos;
+ class StoredConstraints;
+ class LiveSession;
+
// Implements MessageHandler.
void OnMessage(rtc::Message* msg) override;
@@ -329,6 +335,12 @@ class PeerConnection : public PeerConnectionInterface,
// or nullptr if not found.
DataChannel* FindDataChannelBySid(int sid) const;
+ void CreateLiveSession();
+ void DestroyLiveSession();
+ const WebRtcSession* session() const;
+ RemoteMediaStreamFactory* remote_stream_factory();
+ StatsCollector* stats();
+
// Storing the factory as a scoped reference pointer ensures that the memory
// in the PeerConnectionFactoryImpl remains available as long as the
// PeerConnection is running. It is passed to PeerConnection as a raw pointer.
@@ -345,7 +357,6 @@ class PeerConnection : public PeerConnectionInterface,
IceGatheringState ice_gathering_state_;
rtc::scoped_ptr<cricket::PortAllocator> port_allocator_;
- rtc::scoped_ptr<MediaControllerInterface> media_controller_;
// Streams added via AddStream.
rtc::scoped_refptr<StreamCollection> local_streams_;
@@ -367,17 +378,21 @@ class PeerConnection : public PeerConnectionInterface,
std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_to_free_;
bool remote_peer_supports_msid_ = false;
- rtc::scoped_ptr<RemoteMediaStreamFactory> remote_stream_factory_;
std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_;
std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers_;
- // The session_ scoped_ptr is declared at the bottom of PeerConnection
+ cricket::MediaConfig media_config_;
+ PeerConnectionInterface::RTCConfiguration configuration_;
+ rtc::scoped_ptr<StoredConstraints> constraints_;
+ rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_;
+
+ // The live_session_ scoped_ptr is declared at the bottom of PeerConnection
// because its destruction fires signals (such as VoiceChannelDestroyed)
// which will trigger some final actions in PeerConnection...
- rtc::scoped_ptr<WebRtcSession> session_;
- // ... But stats_ depends on session_ so it should be destroyed even earlier.
- rtc::scoped_ptr<StatsCollector> stats_;
+ rtc::scoped_ptr<LiveSession> live_session_;
+
+ RTC_DISALLOW_COPY_AND_ASSIGN(PeerConnection);
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/api/peerconnection.cc » ('j') | webrtc/api/peerconnection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698