blob: 3312094be06939ab029d7ab80e7161bb6d28d3ae [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 */
charujainbf6a45b2016-11-03 04:21:42 -070010#ifndef WEBRTC_VIDEO_TRANSPORT_ADAPTER_H_
11#define WEBRTC_VIDEO_TRANSPORT_ADAPTER_H_
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000012
aleloia8eb7562016-11-28 07:02:13 -080013#include "webrtc/api/call/transport.h"
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000014#include "webrtc/common_types.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010015#include "webrtc/system_wrappers/include/atomic32.h"
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000016
17namespace webrtc {
18namespace internal {
19
pbos2d566682015-09-28 09:59:31 -070020class TransportAdapter : public Transport {
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000021 public:
pbos2d566682015-09-28 09:59:31 -070022 explicit TransportAdapter(Transport* transport);
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000023
stefan1d8a5062015-10-02 03:39:33 -070024 bool SendRtp(const uint8_t* packet,
25 size_t length,
26 const PacketOptions& options) override;
pbos2d566682015-09-28 09:59:31 -070027 bool SendRtcp(const uint8_t* packet, size_t length) override;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000028
sprang@webrtc.orgd9b95602014-01-27 13:03:02 +000029 void Enable();
30 void Disable();
31
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000032 private:
pbos2d566682015-09-28 09:59:31 -070033 Transport *transport_;
sprang@webrtc.orgd9b95602014-01-27 13:03:02 +000034 Atomic32 enabled_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000035};
36} // namespace internal
37} // namespace webrtc
38
charujainbf6a45b2016-11-03 04:21:42 -070039#endif // WEBRTC_VIDEO_TRANSPORT_ADAPTER_H_