Separating internal and external methods of RtpSender/RtpReceiver.
This moves the implementation specific methods to separate classes
(RtpSenderInternal/RtpReceiverInternal) so that the interface classes
represent the interface that external applications can rely on.
The reason this wasn't done earlier was that PeerConnection needed
to store proxy pointers, but also needed to access implementation-
specific methods on the underlying objects. This is now possible
by using "RtpSenderProxyWithInternal<RtpSenderInternal>", which is a proxy
that implements RtpSenderInterface but also provides direct access
to an RtpSenderInternal.
Review-Url: https://codereview.webrtc.org/2023373002
Cr-Commit-Position: refs/heads/master@{#13056}
diff --git a/webrtc/api/peerconnection.h b/webrtc/api/peerconnection.h
index a683e8d..aba595c 100644
--- a/webrtc/api/peerconnection.h
+++ b/webrtc/api/peerconnection.h
@@ -18,8 +18,8 @@
#include "webrtc/api/peerconnectionfactory.h"
#include "webrtc/api/peerconnectioninterface.h"
-#include "webrtc/api/rtpreceiverinterface.h"
-#include "webrtc/api/rtpsenderinterface.h"
+#include "webrtc/api/rtpreceiver.h"
+#include "webrtc/api/rtpsender.h"
#include "webrtc/api/statscollector.h"
#include "webrtc/api/streamcollection.h"
#include "webrtc/api/webrtcsession.h"
@@ -334,11 +334,13 @@
void OnDataChannelOpenMessage(const std::string& label,
const InternalDataChannelInit& config);
- RtpSenderInterface* FindSenderById(const std::string& id);
+ RtpSenderInternal* FindSenderById(const std::string& id);
- std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator
+ std::vector<rtc::scoped_refptr<
+ RtpSenderProxyWithInternal<RtpSenderInternal>>>::iterator
FindSenderForTrack(MediaStreamTrackInterface* track);
- std::vector<rtc::scoped_refptr<RtpReceiverInterface>>::iterator
+ std::vector<rtc::scoped_refptr<
+ RtpReceiverProxyWithInternal<RtpReceiverInternal>>>::iterator
FindReceiverForTrack(const std::string& track_id);
TrackInfos* GetRemoteTracks(cricket::MediaType media_type);
@@ -400,8 +402,11 @@
bool remote_peer_supports_msid_ = false;
- std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_;
- std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers_;
+ std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+ senders_;
+ std::vector<
+ rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+ receivers_;
std::unique_ptr<WebRtcSession> session_;
std::unique_ptr<StatsCollector> stats_;