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 #ifndef VIDEO_TRANSPORT_ADAPTER_H_
11 #define VIDEO_TRANSPORT_ADAPTER_H_
12 
13 #include <stddef.h>
14 #include <stdint.h>
15 
16 #include <atomic>
17 
18 #include "api/call/transport.h"
19 
20 namespace webrtc {
21 namespace internal {
22 
23 class TransportAdapter : public Transport {
24  public:
25   explicit TransportAdapter(Transport* transport);
26   ~TransportAdapter() override;
27 
28   bool SendRtp(const uint8_t* packet,
29                size_t length,
30                const PacketOptions& options) override;
31   bool SendRtcp(const uint8_t* packet, size_t length) override;
32 
33   void Enable();
34   void Disable();
35 
36  private:
37   Transport* transport_;
38   std::atomic<bool> enabled_;
39 };
40 }  // namespace internal
41 }  // namespace webrtc
42 
43 #endif  // VIDEO_TRANSPORT_ADAPTER_H_
44