blob: a47fde39553f5e2ff787a0670610713f23d20c61 [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>
Yuwei Huangd9f99c12017-10-24 15:40:52 -070015#include <atomic>
16
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "api/call/transport.h"
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000018
19namespace webrtc {
20namespace internal {
21
pbos2d566682015-09-28 09:59:31 -070022class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000023 public:
pbos2d566682015-09-28 09:59:31 -070024 explicit TransportAdapter(Transport* transport);
Mirko Bonadei8fdcac32018-08-28 16:30:18 +020025 ~TransportAdapter() override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000026
stefan1d8a5062015-10-02 03:39:33 -070027 bool SendRtp(const uint8_t* packet,
28 size_t length,
29 const PacketOptions& options) override;
pbos2d566682015-09-28 09:59:31 -070030 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000031
sprang@webrtc.orgd9b95602014-01-27 13:03:02 +000032 void Enable();
33 void Disable();
34
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000035 private:
Yves Gerey665174f2018-06-19 15:03:05 +020036 Transport* transport_;
Yuwei Huangd9f99c12017-10-24 15:40:52 -070037 std::atomic<bool> enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000038};
39} // namespace internal
40} // namespace webrtc
41
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020042#endif // VIDEO_TRANSPORT_ADAPTER_H_