blob: 2a2a87a5f662253d9e5fa88d447bf135db36c0e9 [file] [log] [blame]
aleloia8eb7562016-11-28 07:02:13 -08001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef API_CALL_TRANSPORT_H_
12#define API_CALL_TRANSPORT_H_
aleloia8eb7562016-11-28 07:02:13 -080013
14#include <stddef.h>
15#include <stdint.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020016
Dino Radaković1807d572018-02-22 14:18:06 +010017#include <vector>
aleloia8eb7562016-11-28 07:02:13 -080018
19namespace webrtc {
20
21// TODO(holmer): Look into unifying this with the PacketOptions in
22// asyncpacketsocket.h.
23struct PacketOptions {
Dino Radaković1807d572018-02-22 14:18:06 +010024 PacketOptions();
Mirko Bonadeied1dcf92018-07-26 09:15:11 +020025 PacketOptions(const PacketOptions&);
Dino Radaković1807d572018-02-22 14:18:06 +010026 ~PacketOptions();
27
aleloia8eb7562016-11-28 07:02:13 -080028 // 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ć1807d572018-02-22 14:18:06 +010031 // Additional data bound to the RTP packet for use in application code,
32 // outside of WebRTC.
33 std::vector<uint8_t> application_data;
Petter Strandmark26bc6692018-05-29 08:43:35 +020034 // Whether this is a retransmission of an earlier packet.
35 bool is_retransmit = false;
Sebastian Jansson03789972018-10-09 18:27:57 +020036 bool included_in_feedback = false;
37 bool included_in_allocation = false;
aleloia8eb7562016-11-28 07:02:13 -080038};
39
40class 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 Bonadei92ea95e2017-09-15 06:47:31 +020053#endif // API_CALL_TRANSPORT_H_