blob: 95dd308601d21707d300b879dde0bc3b884183d1 [file] [log] [blame]
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +00001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef VIDEO_TRANSPORT_ADAPTER_H_
11#define VIDEO_TRANSPORT_ADAPTER_H_
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <stddef.h>
14#include <stdint.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020015
Yuwei Huangd9f99c12017-10-24 15:40:52 -070016#include <atomic>
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "api/call/transport.h"
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000019
20namespace webrtc {
21namespace internal {
22
pbos2d566682015-09-28 09:59:31 -070023class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000024 public:
pbos2d566682015-09-28 09:59:31 -070025 explicit TransportAdapter(Transport* transport);
Mirko Bonadei8fdcac32018-08-28 16:30:18 +020026 ~TransportAdapter() override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000027
stefan1d8a5062015-10-02 03:39:33 -070028 bool SendRtp(const uint8_t* packet,
29 size_t length,
30 const PacketOptions& options) override;
pbos2d566682015-09-28 09:59:31 -070031 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000032
sprang@webrtc.orgd9b95602014-01-27 13:03:02 +000033 void Enable();
34 void Disable();
35
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000036 private:
Yves Gerey665174f2018-06-19 15:03:05 +020037 Transport* transport_;
Yuwei Huangd9f99c12017-10-24 15:40:52 -070038 std::atomic<bool> enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000039};
40} // namespace internal
41} // namespace webrtc
42
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020043#endif // VIDEO_TRANSPORT_ADAPTER_H_