blob: 0168cc5b865c129665a5423ebb2cbcf1da5f83a4 [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
Yuwei Huangd9f99c12017-10-24 22:40:5213#include <atomic>
14
Mirko Bonadei92ea95e2017-09-15 04:47:3115#include "api/call/transport.h"
Mirko Bonadei71207422017-09-15 11:58:0916#include "common_types.h" // NOLINT(build/include)
pbos@webrtc.orge75a1bf2013-09-18 11:52:4217
18namespace webrtc {
19namespace internal {
20
pbos2d566682015-09-28 16:59:3121class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:4222 public:
pbos2d566682015-09-28 16:59:3123 explicit TransportAdapter(Transport* transport);
pbos@webrtc.orge75a1bf2013-09-18 11:52:4224
stefan1d8a5062015-10-02 10:39:3325 bool SendRtp(const uint8_t* packet,
26 size_t length,
27 const PacketOptions& options) override;
pbos2d566682015-09-28 16:59:3128 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4229
sprang@webrtc.orgd9b95602014-01-27 13:03:0230 void Enable();
31 void Disable();
32
pbos@webrtc.orge75a1bf2013-09-18 11:52:4233 private:
pbos2d566682015-09-28 16:59:3134 Transport *transport_;
Yuwei Huangd9f99c12017-10-24 22:40:5235 std::atomic<bool> enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4236};
37} // namespace internal
38} // namespace webrtc
39
Mirko Bonadei92ea95e2017-09-15 04:47:3140#endif // VIDEO_TRANSPORT_ADAPTER_H_