zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_PC_RTPTRANSPORT_H_ |
| 12 | #define WEBRTC_PC_RTPTRANSPORT_H_ |
| 13 | |
zstein | d9ce764 | 2017-04-10 16:17:57 -0700 | [diff] [blame^] | 14 | #include "webrtc/api/ortc/rtptransportinterface.h" |
| 15 | |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 16 | namespace rtc { |
| 17 | |
| 18 | class PacketTransportInternal; |
| 19 | |
| 20 | } // namespace rtc |
| 21 | |
| 22 | namespace webrtc { |
| 23 | |
zstein | d9ce764 | 2017-04-10 16:17:57 -0700 | [diff] [blame^] | 24 | class RtpTransport : public RtpTransportInterface { |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 25 | public: |
| 26 | RtpTransport(const RtpTransport&) = delete; |
| 27 | RtpTransport& operator=(const RtpTransport&) = delete; |
| 28 | |
| 29 | explicit RtpTransport(bool rtcp_mux_required) |
| 30 | : rtcp_mux_required_(rtcp_mux_required) {} |
| 31 | |
| 32 | bool rtcp_mux_required() const { return rtcp_mux_required_; } |
| 33 | |
| 34 | rtc::PacketTransportInternal* rtp_packet_transport() const { |
| 35 | return rtp_packet_transport_; |
| 36 | } |
zstein | d9ce764 | 2017-04-10 16:17:57 -0700 | [diff] [blame^] | 37 | void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp); |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 38 | |
| 39 | rtc::PacketTransportInternal* rtcp_packet_transport() const { |
| 40 | return rtcp_packet_transport_; |
| 41 | } |
| 42 | void set_rtcp_packet_transport(rtc::PacketTransportInternal* rtcp); |
| 43 | |
zstein | d9ce764 | 2017-04-10 16:17:57 -0700 | [diff] [blame^] | 44 | PacketTransportInterface* GetRtpPacketTransport() const override; |
| 45 | PacketTransportInterface* GetRtcpPacketTransport() const override; |
| 46 | |
| 47 | // TODO(zstein): Use these RtcpParameters for configuration elsewhere. |
| 48 | RTCError SetRtcpParameters(const RtcpParameters& parameters) override; |
| 49 | RtcpParameters GetRtcpParameters() const override; |
| 50 | |
| 51 | protected: |
| 52 | // TODO(zstein): Remove this when we remove RtpTransportAdapter. |
| 53 | RtpTransportAdapter* GetInternal() override; |
| 54 | |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 55 | private: |
| 56 | // True if RTCP-multiplexing is required. rtcp_packet_transport_ should |
| 57 | // always be null in this case. |
| 58 | const bool rtcp_mux_required_; |
| 59 | |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 60 | rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr; |
| 61 | rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr; |
zstein | d9ce764 | 2017-04-10 16:17:57 -0700 | [diff] [blame^] | 62 | |
| 63 | RtcpParameters rtcp_parameters_; |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | } // namespace webrtc |
| 67 | |
| 68 | #endif // WEBRTC_PC_RTPTRANSPORT_H_ |