OLD | NEW |
(Empty) | |
| 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_RTPTRANSPORTINTERNAL_H_ |
| 12 #define WEBRTC_PC_RTPTRANSPORTINTERNAL_H_ |
| 13 |
| 14 #include "webrtc/api/ortc/rtptransportinterface.h" |
| 15 #include "webrtc/rtc_base/sigslot.h" |
| 16 |
| 17 namespace rtc { |
| 18 class CopyOnWriteBuffer; |
| 19 struct PacketOptions; |
| 20 struct PacketTime; |
| 21 } // namespace rtc |
| 22 |
| 23 namespace webrtc { |
| 24 |
| 25 // This represents the internal interface beneath RtpTransportInterface; |
| 26 // it is not accessible to API consumers but is accessible to internal classes |
| 27 // in order to send and receive RTP and RTCP packets belonging to a single RTP |
| 28 // session. Additional convenience and configuration methods are also provided. |
| 29 class RtpTransportInternal : public RtpTransportInterface, |
| 30 public sigslot::has_slots<> { |
| 31 public: |
| 32 virtual void SetRtcpMuxEnabled(bool enable) = 0; |
| 33 |
| 34 // TODO(zstein): Remove PacketTransport setters. Clients should pass these |
| 35 // in to constructors instead and construct a new RtpTransportInternal instead |
| 36 // of updating them. |
| 37 |
| 38 virtual rtc::PacketTransportInternal* rtp_packet_transport() const = 0; |
| 39 virtual void SetRtpPacketTransport(rtc::PacketTransportInternal* rtp) = 0; |
| 40 |
| 41 virtual rtc::PacketTransportInternal* rtcp_packet_transport() const = 0; |
| 42 virtual void SetRtcpPacketTransport(rtc::PacketTransportInternal* rtcp) = 0; |
| 43 |
| 44 // Called whenever a transport's ready-to-send state changes. The argument |
| 45 // is true if all used transports are ready to send. This is more specific |
| 46 // than just "writable"; it means the last send didn't return ENOTCONN. |
| 47 sigslot::signal1<bool> SignalReadyToSend; |
| 48 |
| 49 // TODO(zstein): Consider having two signals - RtpPacketReceived and |
| 50 // RtcpPacketReceived. |
| 51 // The first argument is true for RTCP packets and false for RTP packets. |
| 52 sigslot::signal3<bool, rtc::CopyOnWriteBuffer*, const rtc::PacketTime&> |
| 53 SignalPacketReceived; |
| 54 |
| 55 virtual bool IsWritable(bool rtcp) const = 0; |
| 56 |
| 57 virtual bool SendPacket(bool rtcp, |
| 58 rtc::CopyOnWriteBuffer* packet, |
| 59 const rtc::PacketOptions& options, |
| 60 int flags) = 0; |
| 61 |
| 62 virtual bool HandlesPayloadType(int payload_type) const = 0; |
| 63 |
| 64 virtual void AddHandledPayloadType(int payload_type) = 0; |
| 65 }; |
| 66 |
| 67 } // namespace webrtc |
| 68 |
| 69 #endif // WEBRTC_PC_RTPTRANSPORTINTERNAL_H_ |
OLD | NEW |