• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #ifndef API_CALL_TRANSPORT_H_
12 #define API_CALL_TRANSPORT_H_
13 
14 #include <stddef.h>
15 #include <stdint.h>
16 
17 #include <vector>
18 
19 namespace webrtc {
20 
21 // TODO(holmer): Look into unifying this with the PacketOptions in
22 // asyncpacketsocket.h.
23 struct PacketOptions {
24   PacketOptions();
25   PacketOptions(const PacketOptions&);
26   ~PacketOptions();
27 
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;
31   // Additional data bound to the RTP packet for use in application code,
32   // outside of WebRTC.
33   std::vector<uint8_t> application_data;
34   // Whether this is a retransmission of an earlier packet.
35   bool is_retransmit = false;
36   bool included_in_feedback = false;
37   bool included_in_allocation = false;
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:
~Transport()48   virtual ~Transport() {}
49 };
50 
51 }  // namespace webrtc
52 
53 #endif  // API_CALL_TRANSPORT_H_
54