OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/pc/rtptransport.h" | 11 #include "webrtc/pc/rtptransport.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
| 14 #include "webrtc/p2p/base/packettransportinterface.h" |
14 | 15 |
15 namespace webrtc { | 16 namespace webrtc { |
16 | 17 |
| 18 void RtpTransport::set_rtp_packet_transport(rtc::PacketTransportInternal* rtp) { |
| 19 rtp_packet_transport_ = rtp; |
| 20 } |
| 21 |
17 void RtpTransport::set_rtcp_packet_transport( | 22 void RtpTransport::set_rtcp_packet_transport( |
18 rtc::PacketTransportInternal* rtcp) { | 23 rtc::PacketTransportInternal* rtcp) { |
19 RTC_DCHECK(!rtcp_mux_required_); | 24 RTC_DCHECK(!rtcp_mux_required_); |
20 rtcp_packet_transport_ = rtcp; | 25 rtcp_packet_transport_ = rtcp; |
21 } | 26 } |
22 | 27 |
| 28 PacketTransportInterface* RtpTransport::GetRtpPacketTransport() const { |
| 29 return rtp_packet_transport_; |
| 30 } |
| 31 |
| 32 PacketTransportInterface* RtpTransport::GetRtcpPacketTransport() const { |
| 33 return rtcp_packet_transport_; |
| 34 } |
| 35 |
| 36 RTCError RtpTransport::SetRtcpParameters(const RtcpParameters& parameters) { |
| 37 if (rtcp_parameters_.mux && !parameters.mux) { |
| 38 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_STATE, |
| 39 "Disabling RTCP muxing is not allowed."); |
| 40 } |
| 41 |
| 42 RtcpParameters new_parameters = parameters; |
| 43 |
| 44 if (new_parameters.cname.empty()) { |
| 45 new_parameters.cname = rtcp_parameters_.cname; |
| 46 } |
| 47 |
| 48 rtcp_parameters_ = new_parameters; |
| 49 return RTCError::OK(); |
| 50 } |
| 51 |
| 52 RtcpParameters RtpTransport::GetRtcpParameters() const { |
| 53 return rtcp_parameters_; |
| 54 } |
| 55 |
| 56 RtpTransportAdapter* RtpTransport::GetInternal() { |
| 57 return nullptr; |
| 58 } |
| 59 |
23 } // namespace webrtc | 60 } // namespace webrtc |
OLD | NEW |