pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [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 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #ifndef VIDEO_TRANSPORT_ADAPTER_H_ |
| 11 | #define VIDEO_TRANSPORT_ADAPTER_H_ |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 12 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 13 | #include <stddef.h> |
| 14 | #include <stdint.h> |
Yuwei Huang | d9f99c1 | 2017-10-24 15:40:52 -0700 | [diff] [blame] | 15 | #include <atomic> |
| 16 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "api/call/transport.h" |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | namespace internal { |
| 21 | |
pbos | 2d56668 | 2015-09-28 09:59:31 -0700 | [diff] [blame] | 22 | class TransportAdapter : public Transport { |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 23 | public: |
pbos | 2d56668 | 2015-09-28 09:59:31 -0700 | [diff] [blame] | 24 | explicit TransportAdapter(Transport* transport); |
Mirko Bonadei | 8fdcac3 | 2018-08-28 16:30:18 +0200 | [diff] [blame] | 25 | ~TransportAdapter() override; |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 26 | |
stefan | 1d8a506 | 2015-10-02 03:39:33 -0700 | [diff] [blame] | 27 | bool SendRtp(const uint8_t* packet, |
| 28 | size_t length, |
| 29 | const PacketOptions& options) override; |
pbos | 2d56668 | 2015-09-28 09:59:31 -0700 | [diff] [blame] | 30 | bool SendRtcp(const uint8_t* packet, size_t length) override; |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 31 | |
sprang@webrtc.org | d9b9560 | 2014-01-27 13:03:02 +0000 | [diff] [blame] | 32 | void Enable(); |
| 33 | void Disable(); |
| 34 | |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 35 | private: |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 36 | Transport* transport_; |
Yuwei Huang | d9f99c1 | 2017-10-24 15:40:52 -0700 | [diff] [blame] | 37 | std::atomic<bool> enabled_; |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 38 | }; |
| 39 | } // namespace internal |
| 40 | } // namespace webrtc |
| 41 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 42 | #endif // VIDEO_TRANSPORT_ADAPTER_H_ |