2016-01-22 14:04:27 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2016-04-27 01:54:20 -07:00
|
|
|
#import "WebRTC/RTCDataChannel.h"
|
2016-01-22 14:04:27 -08:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/datachannelinterface.h"
|
|
|
|
|
#include "rtc_base/scoped_ref_ptr.h"
|
2016-01-22 14:04:27 -08:00
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
2018-06-27 17:09:14 +03:00
|
|
|
@class RTCPeerConnectionFactory;
|
|
|
|
|
|
2016-01-22 14:04:27 -08:00
|
|
|
@interface RTCDataBuffer ()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The native DataBuffer representation of this RTCDatabuffer object. This is
|
|
|
|
|
* needed to pass to the underlying C++ APIs.
|
|
|
|
|
*/
|
|
|
|
|
@property(nonatomic, readonly) const webrtc::DataBuffer *nativeDataBuffer;
|
|
|
|
|
|
|
|
|
|
/** Initialize an RTCDataBuffer from a native DataBuffer. */
|
|
|
|
|
- (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer &)nativeBuffer;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@interface RTCDataChannel ()
|
|
|
|
|
|
|
|
|
|
/** Initialize an RTCDataChannel from a native DataChannelInterface. */
|
2018-06-27 17:09:14 +03:00
|
|
|
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
|
|
|
|
|
nativeDataChannel:(rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel
|
2016-01-22 14:04:27 -08:00
|
|
|
NS_DESIGNATED_INITIALIZER;
|
|
|
|
|
|
|
|
|
|
+ (webrtc::DataChannelInterface::DataState)nativeDataChannelStateForState:
|
|
|
|
|
(RTCDataChannelState)state;
|
|
|
|
|
|
|
|
|
|
+ (RTCDataChannelState)dataChannelStateForNativeState:
|
|
|
|
|
(webrtc::DataChannelInterface::DataState)nativeState;
|
|
|
|
|
|
|
|
|
|
+ (NSString *)stringForState:(RTCDataChannelState)state;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|