| 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 API_CALL_TRANSPORT_H_ |
| 12 | #define API_CALL_TRANSPORT_H_ |
| 13 |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 |
| 17 | #include "api/array_view.h" |
| 18 | #include "api/ref_counted_base.h" |
| 19 | #include "api/scoped_refptr.h" |
| 20 |
| 21 | namespace webrtc { |
| 22 |
| 23 | // TODO(holmer): Look into unifying this with the PacketOptions in |
| 24 | // asyncpacketsocket.h. |
| 25 | struct PacketOptions { |
| 26 | PacketOptions(); |
| 27 | PacketOptions(const PacketOptions&); |
| 28 | ~PacketOptions(); |
| 29 |
| 30 | // A 16 bits positive id. Negative ids are invalid and should be interpreted |
| 31 | // as packet_id not being set. |
| 32 | int packet_id = -1; |
| 33 | // Additional data bound to the RTP packet for use in application code, |
| 34 | // outside of WebRTC. |
| 35 | rtc::scoped_refptr<rtc::RefCountedBase> additional_data; |
| 36 | // Whether this is a retransmission of an earlier packet. |
| 37 | bool is_retransmit = false; |
| 38 | bool included_in_feedback = false; |
| 39 | bool included_in_allocation = false; |
| 40 | // Whether this packet can be part of a packet batch at lower levels. |
| 41 | bool batchable = false; |
| 42 | // Whether this packet is the last of a batch. |
| 43 | bool last_packet_in_batch = false; |
| 44 | }; |
| 45 |
| 46 | class Transport { |
| 47 | public: |
| 48 | virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet, |
| 49 | const PacketOptions& options) = 0; |
| 50 | virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) = 0; |
| 51 |
| 52 | protected: |
| 53 | virtual ~Transport() {} |
| 54 | }; |
| 55 |
| 56 | } // namespace webrtc |
| 57 |
| 58 | #endif // API_CALL_TRANSPORT_H_ |
| 59 |