blob: 95dd308601d21707d300b879dde0bc3b884183d1 [file] [log] [blame]
pbos@webrtc.orge75a1bf2013-09-18 11:52:421/*
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 04:47:3110#ifndef VIDEO_TRANSPORT_ADAPTER_H_
11#define VIDEO_TRANSPORT_ADAPTER_H_
pbos@webrtc.orge75a1bf2013-09-18 11:52:4212
Yves Gerey3e707812018-11-28 15:47:4913#include <stddef.h>
14#include <stdint.h>
Jonas Olssona4d87372019-07-05 17:08:3315
Yuwei Huangd9f99c12017-10-24 22:40:5216#include <atomic>
17
Mirko Bonadei92ea95e2017-09-15 04:47:3118#include "api/call/transport.h"
pbos@webrtc.orge75a1bf2013-09-18 11:52:4219
20namespace webrtc {
21namespace internal {
22
pbos2d566682015-09-28 16:59:3123class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:4224 public:
pbos2d566682015-09-28 16:59:3125 explicit TransportAdapter(Transport* transport);
Mirko Bonadei8fdcac32018-08-28 14:30:1826 ~TransportAdapter() override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4227
stefan1d8a5062015-10-02 10:39:3328 bool SendRtp(const uint8_t* packet,
29 size_t length,
30 const PacketOptions& options) override;
pbos2d566682015-09-28 16:59:3131 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4232
sprang@webrtc.orgd9b95602014-01-27 13:03:0233 void Enable();
34 void Disable();
35
pbos@webrtc.orge75a1bf2013-09-18 11:52:4236 private:
Yves Gerey665174f2018-06-19 13:03:0537 Transport* transport_;
Yuwei Huangd9f99c12017-10-24 22:40:5238 std::atomic<bool> enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4239};
40} // namespace internal
41} // namespace webrtc
42
Mirko Bonadei92ea95e2017-09-15 04:47:3143#endif // VIDEO_TRANSPORT_ADAPTER_H_