blob: 2cdbdabec6d0591303aa073acf54bc2991f73fc5 [file] [log] [blame]
hjone373dc22016-01-22 14:04:27 -08001/*
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
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020011#import "RTCDataChannel.h"
hjone373dc22016-01-22 14:04:27 -080012
Steve Anton10542f22019-01-11 09:11:00 -080013#include "api/data_channel_interface.h"
Mirko Bonadeid9708072019-01-25 20:26:48 +010014#include "api/scoped_refptr.h"
hjone373dc22016-01-22 14:04:27 -080015
16NS_ASSUME_NONNULL_BEGIN
17
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020018@class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
Yura Yaroshevichc75b35a2018-06-27 17:09:14 +030019
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020020@interface RTC_OBJC_TYPE (RTCDataBuffer)
21()
hjone373dc22016-01-22 14:04:27 -080022
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020023 /**
24 * The native DataBuffer representation of this RTCDatabuffer object. This is
25 * needed to pass to the underlying C++ APIs.
26 */
27 @property(nonatomic, readonly) const webrtc::DataBuffer *nativeDataBuffer;
hjone373dc22016-01-22 14:04:27 -080028
29/** Initialize an RTCDataBuffer from a native DataBuffer. */
Yves Gerey665174f2018-06-19 15:03:05 +020030- (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer &)nativeBuffer;
hjone373dc22016-01-22 14:04:27 -080031
32@end
33
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020034@interface RTC_OBJC_TYPE (RTCDataChannel)
35()
hjone373dc22016-01-22 14:04:27 -080036
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020037 /** Initialize an RTCDataChannel from a native DataChannelInterface. */
38 - (instancetype)initWithFactory
39 : (RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory nativeDataChannel
40 : (rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel NS_DESIGNATED_INITIALIZER;
hjone373dc22016-01-22 14:04:27 -080041
Yves Gerey665174f2018-06-19 15:03:05 +020042+ (webrtc::DataChannelInterface::DataState)nativeDataChannelStateForState:
43 (RTCDataChannelState)state;
hjone373dc22016-01-22 14:04:27 -080044
45+ (RTCDataChannelState)dataChannelStateForNativeState:
Yves Gerey665174f2018-06-19 15:03:05 +020046 (webrtc::DataChannelInterface::DataState)nativeState;
hjone373dc22016-01-22 14:04:27 -080047
48+ (NSString *)stringForState:(RTCDataChannelState)state;
49
50@end
51
52NS_ASSUME_NONNULL_END