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

Unified Diff: webrtc/pc/rtptransport.h

Issue 2805783002: Make RtpTransport actually implement RtpTransportInterface (Closed)
Patch Set: Add a TODO about RtpTransport::GetInternal Created 3 years, 8 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/pc/rtptransport.cc » ('j') | webrtc/pc/rtptransport.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/rtptransport.h
diff --git a/webrtc/pc/rtptransport.h b/webrtc/pc/rtptransport.h
index 5dbebe6ed9a6fdad4674cf54af601b5ccd67a1e0..c42a34ac62da49e425d03d9c4541afe4571fda75 100644
--- a/webrtc/pc/rtptransport.h
+++ b/webrtc/pc/rtptransport.h
@@ -11,6 +11,8 @@
#ifndef WEBRTC_PC_RTPTRANSPORT_H_
#define WEBRTC_PC_RTPTRANSPORT_H_
+#include "webrtc/api/ortc/rtptransportinterface.h"
+
namespace rtc {
class PacketTransportInternal;
@@ -19,37 +21,63 @@ class PacketTransportInternal;
namespace webrtc {
-class RtpTransport {
+class PacketTransportWrapper : public PacketTransportInterface {
Taylor Brandstetter 2017/04/07 04:16:03 I was confused about why this was necessary until
Zach Stein 2017/04/10 22:37:43 Done.
+ public:
+ PacketTransportWrapper() = default;
+ explicit PacketTransportWrapper(rtc::PacketTransportInternal* transport)
+ : transport_(transport) {}
+
+ rtc::PacketTransportInternal* transport() const { return transport_; }
+
+ void set_transport(rtc::PacketTransportInternal* transport) {
+ transport_ = transport;
+ }
+
+ protected:
+ rtc::PacketTransportInternal* GetInternal() { return transport_; }
+
+ private:
+ rtc::PacketTransportInternal* transport_ = nullptr;
+};
+
+class RtpTransport : public RtpTransportInterface {
public:
RtpTransport(const RtpTransport&) = delete;
RtpTransport& operator=(const RtpTransport&) = delete;
- explicit RtpTransport(bool rtcp_mux_required)
- : rtcp_mux_required_(rtcp_mux_required) {}
+ explicit RtpTransport(bool rtcp_mux_required);
bool rtcp_mux_required() const { return rtcp_mux_required_; }
rtc::PacketTransportInternal* rtp_packet_transport() const {
- return rtp_packet_transport_;
- }
- void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp) {
- rtp_packet_transport_ = rtp;
+ return rtp_packet_transport_wrapper_->transport();
}
+ void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp);
rtc::PacketTransportInternal* rtcp_packet_transport() const {
- return rtcp_packet_transport_;
+ return rtcp_packet_transport_wrapper_->transport();
}
void set_rtcp_packet_transport(rtc::PacketTransportInternal* rtcp);
+ PacketTransportInterface* GetRtpPacketTransport() const override;
+ PacketTransportInterface* GetRtcpPacketTransport() const override;
+
+ RTCError SetRtcpParameters(const RtcpParameters& parameters) override;
+ RtcpParameters GetRtcpParameters() const override;
Taylor Brandstetter 2017/04/07 04:16:03 Since these methods aren't used anywhere yet, can
Zach Stein 2017/04/10 22:37:43 Done.
+
+ protected:
+ // TODO(zstein): Remove this when we remove RtpTransportAdapter.
+ RtpTransportAdapter* GetInternal() override;
+
private:
// True if RTCP-multiplexing is required. rtcp_packet_transport_ should
// always be null in this case.
const bool rtcp_mux_required_;
- // TODO(zstein): Revisit ownership here - transports are currently owned by
- // TransportController
- rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr;
- rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr;
+ std::unique_ptr<PacketTransportWrapper> rtp_packet_transport_wrapper_;
+ std::unique_ptr<PacketTransportWrapper> rtcp_packet_transport_wrapper_;
+
+ RtcpParameters rtcp_parameters_;
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/pc/rtptransport.cc » ('j') | webrtc/pc/rtptransport.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698