RTCDataChannel+Private.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2015 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. #import "RTCDataChannel.h"
  11. #include "api/data_channel_interface.h"
  12. #include "api/scoped_refptr.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. @class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
  15. @interface RTC_OBJC_TYPE (RTCDataBuffer)
  16. ()
  17. /**
  18. * The native DataBuffer representation of this RTCDatabuffer object. This is
  19. * needed to pass to the underlying C++ APIs.
  20. */
  21. @property(nonatomic, readonly) const webrtc::DataBuffer *nativeDataBuffer;
  22. /** Initialize an RTCDataBuffer from a native DataBuffer. */
  23. - (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer &)nativeBuffer;
  24. @end
  25. @interface RTC_OBJC_TYPE (RTCDataChannel)
  26. ()
  27. /** Initialize an RTCDataChannel from a native DataChannelInterface. */
  28. - (instancetype)initWithFactory
  29. : (RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory nativeDataChannel
  30. : (rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel NS_DESIGNATED_INITIALIZER;
  31. + (webrtc::DataChannelInterface::DataState)nativeDataChannelStateForState:
  32. (RTCDataChannelState)state;
  33. + (RTCDataChannelState)dataChannelStateForNativeState:
  34. (webrtc::DataChannelInterface::DataState)nativeState;
  35. + (NSString *)stringForState:(RTCDataChannelState)state;
  36. @end
  37. NS_ASSUME_NONNULL_END