Chromium Code Reviews| 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 #ifndef WEBRTC_PC_RTPTRANSPORT_H_ | 11 #ifndef WEBRTC_PC_RTPTRANSPORT_H_ |
| 12 #define WEBRTC_PC_RTPTRANSPORT_H_ | 12 #define WEBRTC_PC_RTPTRANSPORT_H_ |
| 13 | 13 |
| 14 #include "webrtc/api/ortc/rtptransportinterface.h" | 14 #include "webrtc/api/ortc/rtptransportinterface.h" |
| 15 #include "webrtc/base/sigslot.h" | |
| 15 | 16 |
| 16 namespace rtc { | 17 namespace rtc { |
| 17 | 18 |
| 18 class PacketTransportInternal; | 19 class PacketTransportInternal; |
| 19 | 20 |
| 20 } // namespace rtc | 21 } // namespace rtc |
| 21 | 22 |
| 22 namespace webrtc { | 23 namespace webrtc { |
| 23 | 24 |
| 24 class RtpTransport : public RtpTransportInterface { | 25 class RtpTransport : public RtpTransportInterface, public sigslot::has_slots<> { |
| 25 public: | 26 public: |
| 26 RtpTransport(const RtpTransport&) = delete; | 27 RtpTransport(const RtpTransport&) = delete; |
| 27 RtpTransport& operator=(const RtpTransport&) = delete; | 28 RtpTransport& operator=(const RtpTransport&) = delete; |
| 28 | 29 |
| 29 explicit RtpTransport(bool rtcp_mux_required) | 30 explicit RtpTransport(bool rtcp_mux_required) |
| 30 : rtcp_mux_required_(rtcp_mux_required) {} | 31 : rtcp_mux_required_(rtcp_mux_required) {} |
| 31 | 32 |
| 32 bool rtcp_mux_required() const { return rtcp_mux_required_; } | 33 bool rtcp_mux_required() const { return rtcp_mux_required_; } |
| 33 | 34 |
| 34 rtc::PacketTransportInternal* rtp_packet_transport() const { | 35 rtc::PacketTransportInternal* rtp_packet_transport() const { |
| 35 return rtp_packet_transport_; | 36 return rtp_packet_transport_; |
| 36 } | 37 } |
| 37 void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp); | 38 void set_rtp_packet_transport(rtc::PacketTransportInternal* rtp); |
| 38 | 39 |
| 39 rtc::PacketTransportInternal* rtcp_packet_transport() const { | 40 rtc::PacketTransportInternal* rtcp_packet_transport() const { |
| 40 return rtcp_packet_transport_; | 41 return rtcp_packet_transport_; |
| 41 } | 42 } |
| 42 void set_rtcp_packet_transport(rtc::PacketTransportInternal* rtcp); | 43 void set_rtcp_packet_transport(rtc::PacketTransportInternal* rtcp); |
| 43 | 44 |
| 45 void Connect(bool rtcp); | |
| 46 void Disconnect(bool rtcp); | |
| 47 | |
| 48 void OnReadyToSend(rtc::PacketTransportInternal* transport); | |
|
Taylor Brandstetter
2017/04/14 18:05:33
This should be private.
Zach Stein
2017/04/18 23:39:29
Done.
| |
| 49 sigslot::signal1<bool> SignalReadyToSend; | |
| 50 | |
| 51 void SetReadyToSend(bool rtcp, bool ready); | |
| 52 | |
| 44 PacketTransportInterface* GetRtpPacketTransport() const override; | 53 PacketTransportInterface* GetRtpPacketTransport() const override; |
| 45 PacketTransportInterface* GetRtcpPacketTransport() const override; | 54 PacketTransportInterface* GetRtcpPacketTransport() const override; |
| 46 | 55 |
| 47 // TODO(zstein): Use these RtcpParameters for configuration elsewhere. | 56 // TODO(zstein): Use these RtcpParameters for configuration elsewhere. |
| 48 RTCError SetRtcpParameters(const RtcpParameters& parameters) override; | 57 RTCError SetRtcpParameters(const RtcpParameters& parameters) override; |
| 49 RtcpParameters GetRtcpParameters() const override; | 58 RtcpParameters GetRtcpParameters() const override; |
| 50 | 59 |
| 51 protected: | 60 protected: |
| 52 // TODO(zstein): Remove this when we remove RtpTransportAdapter. | 61 // TODO(zstein): Remove this when we remove RtpTransportAdapter. |
| 53 RtpTransportAdapter* GetInternal() override; | 62 RtpTransportAdapter* GetInternal() override; |
| 54 | 63 |
| 55 private: | 64 private: |
| 56 // True if RTCP-multiplexing is required. rtcp_packet_transport_ should | 65 // True if RTCP-multiplexing is required. rtcp_packet_transport_ should |
| 57 // always be null in this case. | 66 // always be null in this case. |
| 58 const bool rtcp_mux_required_; | 67 const bool rtcp_mux_required_; |
| 59 | 68 |
| 60 rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr; | 69 rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr; |
| 61 rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr; | 70 rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr; |
| 62 | 71 |
| 72 bool rtp_ready_to_send_ = false; | |
| 73 bool rtcp_ready_to_send_ = false; | |
| 74 | |
| 63 RtcpParameters rtcp_parameters_; | 75 RtcpParameters rtcp_parameters_; |
| 64 }; | 76 }; |
| 65 | 77 |
| 66 } // namespace webrtc | 78 } // namespace webrtc |
| 67 | 79 |
| 68 #endif // WEBRTC_PC_RTPTRANSPORT_H_ | 80 #endif // WEBRTC_PC_RTPTRANSPORT_H_ |
| OLD | NEW |