transport_adapter.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  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. */
  10. #ifndef VIDEO_TRANSPORT_ADAPTER_H_
  11. #define VIDEO_TRANSPORT_ADAPTER_H_
  12. #include <stddef.h>
  13. #include <stdint.h>
  14. #include <atomic>
  15. #include "api/call/transport.h"
  16. namespace webrtc {
  17. namespace internal {
  18. class TransportAdapter : public Transport {
  19. public:
  20. explicit TransportAdapter(Transport* transport);
  21. ~TransportAdapter() override;
  22. bool SendRtp(const uint8_t* packet,
  23. size_t length,
  24. const PacketOptions& options) override;
  25. bool SendRtcp(const uint8_t* packet, size_t length) override;
  26. void Enable();
  27. void Disable();
  28. private:
  29. Transport* transport_;
  30. std::atomic<bool> enabled_;
  31. };
  32. } // namespace internal
  33. } // namespace webrtc
  34. #endif // VIDEO_TRANSPORT_ADAPTER_H_