blob: f5ffe3fe5f154aad0956d81a1877358f50ad6e48 [file] [log] [blame]
zsteind48dbda2017-04-04 19:45:57 -07001/*
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
zsteind9ce7642017-04-10 16:17:57 -070014#include "webrtc/api/ortc/rtptransportinterface.h"
15
zsteind48dbda2017-04-04 19:45:57 -070016namespace rtc {
17
18class PacketTransportInternal;
19
20} // namespace rtc
21
22namespace webrtc {
23
zsteind9ce7642017-04-10 16:17:57 -070024class RtpTransport : public RtpTransportInterface {
zsteind48dbda2017-04-04 19:45:57 -070025 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 }
zsteind9ce7642017-04-10 16:17:57 -070037 void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp);
zsteind48dbda2017-04-04 19:45:57 -070038
39 rtc::PacketTransportInternal* rtcp_packet_transport() const {
40 return rtcp_packet_transport_;
41 }
42 void set_rtcp_packet_transport(rtc::PacketTransportInternal* rtcp);
43
zsteind9ce7642017-04-10 16:17:57 -070044 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
zsteind48dbda2017-04-04 19:45:57 -070055 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
zsteind48dbda2017-04-04 19:45:57 -070060 rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr;
61 rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr;
zsteind9ce7642017-04-10 16:17:57 -070062
63 RtcpParameters rtcp_parameters_;
zsteind48dbda2017-04-04 19:45:57 -070064};
65
66} // namespace webrtc
67
68#endif // WEBRTC_PC_RTPTRANSPORT_H_