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 #include "webrtc/base/sigslot.h" |
16 #include "webrtc/pc/bundlefilter.h" | |
16 | 17 |
17 namespace rtc { | 18 namespace rtc { |
18 | 19 |
19 class CopyOnWriteBuffer; | 20 class CopyOnWriteBuffer; |
20 struct PacketOptions; | 21 struct PacketOptions; |
22 struct PacketTime; | |
21 class PacketTransportInternal; | 23 class PacketTransportInternal; |
22 | 24 |
23 } // namespace rtc | 25 } // namespace rtc |
24 | 26 |
25 namespace webrtc { | 27 namespace webrtc { |
26 | 28 |
27 class RtpTransport : public RtpTransportInterface, public sigslot::has_slots<> { | 29 class RtpTransport : public RtpTransportInterface, public sigslot::has_slots<> { |
28 public: | 30 public: |
29 RtpTransport(const RtpTransport&) = delete; | 31 RtpTransport(const RtpTransport&) = delete; |
30 RtpTransport& operator=(const RtpTransport&) = delete; | 32 RtpTransport& operator=(const RtpTransport&) = delete; |
(...skipping 26 matching lines...) Expand all Loading... | |
57 // than just "writable"; it means the last send didn't return ENOTCONN. | 59 // than just "writable"; it means the last send didn't return ENOTCONN. |
58 sigslot::signal1<bool> SignalReadyToSend; | 60 sigslot::signal1<bool> SignalReadyToSend; |
59 | 61 |
60 bool IsWritable(bool rtcp) const; | 62 bool IsWritable(bool rtcp) const; |
61 | 63 |
62 bool SendPacket(bool rtcp, | 64 bool SendPacket(bool rtcp, |
63 const rtc::CopyOnWriteBuffer* packet, | 65 const rtc::CopyOnWriteBuffer* packet, |
64 const rtc::PacketOptions& options, | 66 const rtc::PacketOptions& options, |
65 int flags); | 67 int flags); |
66 | 68 |
69 bool HandlesPayloadType(int payload_type) const; | |
70 | |
71 void AddHandledPayloadType(int payload_type); | |
72 | |
73 // TODO(zstein): Consider having two signals - RtcPacketReceived and | |
74 // RtcpPacketReceived. | |
Taylor Brandstetter
2017/05/31 08:25:03
Could mention that the first bool argument of the
Zach Stein
2017/06/01 03:45:58
Done.
| |
75 sigslot::signal3<bool, rtc::CopyOnWriteBuffer&, const rtc::PacketTime&> | |
76 SignalPacketReceived; | |
77 | |
67 protected: | 78 protected: |
68 // TODO(zstein): Remove this when we remove RtpTransportAdapter. | 79 // TODO(zstein): Remove this when we remove RtpTransportAdapter. |
69 RtpTransportAdapter* GetInternal() override; | 80 RtpTransportAdapter* GetInternal() override; |
70 | 81 |
71 private: | 82 private: |
83 bool HandlesPacket(const uint8_t* data, size_t len); | |
84 | |
72 void OnReadyToSend(rtc::PacketTransportInternal* transport); | 85 void OnReadyToSend(rtc::PacketTransportInternal* transport); |
73 | 86 |
74 // Updates "ready to send" for an individual channel and fires | 87 // Updates "ready to send" for an individual channel and fires |
75 // SignalReadyToSend. | 88 // SignalReadyToSend. |
76 void SetReadyToSend(bool rtcp, bool ready); | 89 void SetReadyToSend(bool rtcp, bool ready); |
77 | 90 |
78 void MaybeSignalReadyToSend(); | 91 void MaybeSignalReadyToSend(); |
79 | 92 |
93 void OnReadPacket(rtc::PacketTransportInternal* transport, | |
94 const char* data, | |
95 size_t len, | |
96 const rtc::PacketTime& packet_time, | |
97 int flags); | |
98 | |
99 bool WantsPacket(bool rtcp, const rtc::CopyOnWriteBuffer* packet); | |
100 | |
80 bool rtcp_mux_enabled_; | 101 bool rtcp_mux_enabled_; |
81 | 102 |
82 rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr; | 103 rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr; |
83 rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr; | 104 rtc::PacketTransportInternal* rtcp_packet_transport_ = nullptr; |
84 | 105 |
85 bool ready_to_send_ = false; | 106 bool ready_to_send_ = false; |
86 bool rtp_ready_to_send_ = false; | 107 bool rtp_ready_to_send_ = false; |
87 bool rtcp_ready_to_send_ = false; | 108 bool rtcp_ready_to_send_ = false; |
88 | 109 |
89 RtcpParameters rtcp_parameters_; | 110 RtcpParameters rtcp_parameters_; |
111 | |
112 cricket::BundleFilter bundle_filter_; | |
90 }; | 113 }; |
91 | 114 |
92 } // namespace webrtc | 115 } // namespace webrtc |
93 | 116 |
94 #endif // WEBRTC_PC_RTPTRANSPORT_H_ | 117 #endif // WEBRTC_PC_RTPTRANSPORT_H_ |
OLD | NEW |