blob: 0168cc5b865c129665a5423ebb2cbcf1da5f83a4 [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
Yuwei Huangd9f99c12017-10-24 15:40:52 -070013#include <atomic>
14
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "api/call/transport.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020016#include "common_types.h" // NOLINT(build/include)
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000017
18namespace webrtc {
19namespace internal {
20
pbos2d566682015-09-28 09:59:31 -070021class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000022 public:
pbos2d566682015-09-28 09:59:31 -070023 explicit TransportAdapter(Transport* transport);
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000024
stefan1d8a5062015-10-02 03:39:33 -070025 bool SendRtp(const uint8_t* packet,
26 size_t length,
27 const PacketOptions& options) override;
pbos2d566682015-09-28 09:59:31 -070028 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000029
sprang@webrtc.orgd9b95602014-01-27 13:03:02 +000030 void Enable();
31 void Disable();
32
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000033 private:
pbos2d566682015-09-28 09:59:31 -070034 Transport *transport_;
Yuwei Huangd9f99c12017-10-24 15:40:52 -070035 std::atomic<bool> enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000036};
37} // namespace internal
38} // namespace webrtc
39
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020040#endif // VIDEO_TRANSPORT_ADAPTER_H_