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