aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef API_CALL_TRANSPORT_H_ |
| 12 | #define API_CALL_TRANSPORT_H_ |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 13 | |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 16 | |
Dino Radaković | 1807d57 | 2018-02-22 14:18:06 +0100 | [diff] [blame] | 17 | #include <vector> |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | // TODO(holmer): Look into unifying this with the PacketOptions in |
| 22 | // asyncpacketsocket.h. |
| 23 | struct PacketOptions { |
Dino Radaković | 1807d57 | 2018-02-22 14:18:06 +0100 | [diff] [blame] | 24 | PacketOptions(); |
Mirko Bonadei | ed1dcf9 | 2018-07-26 09:15:11 +0200 | [diff] [blame] | 25 | PacketOptions(const PacketOptions&); |
Dino Radaković | 1807d57 | 2018-02-22 14:18:06 +0100 | [diff] [blame] | 26 | ~PacketOptions(); |
| 27 | |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 28 | // A 16 bits positive id. Negative ids are invalid and should be interpreted |
| 29 | // as packet_id not being set. |
| 30 | int packet_id = -1; |
Dino Radaković | 1807d57 | 2018-02-22 14:18:06 +0100 | [diff] [blame] | 31 | // Additional data bound to the RTP packet for use in application code, |
| 32 | // outside of WebRTC. |
| 33 | std::vector<uint8_t> application_data; |
Petter Strandmark | 26bc669 | 2018-05-29 08:43:35 +0200 | [diff] [blame] | 34 | // Whether this is a retransmission of an earlier packet. |
| 35 | bool is_retransmit = false; |
Sebastian Jansson | 0378997 | 2018-10-09 18:27:57 +0200 | [diff] [blame] | 36 | bool included_in_feedback = false; |
| 37 | bool included_in_allocation = false; |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | class Transport { |
| 41 | public: |
| 42 | virtual bool SendRtp(const uint8_t* packet, |
| 43 | size_t length, |
| 44 | const PacketOptions& options) = 0; |
| 45 | virtual bool SendRtcp(const uint8_t* packet, size_t length) = 0; |
| 46 | |
| 47 | protected: |
| 48 | virtual ~Transport() {} |
| 49 | }; |
| 50 | |
| 51 | } // namespace webrtc |
| 52 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 53 | #endif // API_CALL_TRANSPORT_H_ |