blob: a88a316b1033c810f7afa6d3396de43156f77144 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "api/datachannelinterface.h"
14#include "rtc_base/scoped_ref_ptr.h"
hjone373dc22016-01-22 14:04:27 -080015
16NS_ASSUME_NONNULL_BEGIN
17
Yura Yaroshevichc75b35a2018-06-27 17:09:14 +030018@class RTCPeerConnectionFactory;
19
hjone373dc22016-01-22 14:04:27 -080020@interface RTCDataBuffer ()
21
22/**
23 * The native DataBuffer representation of this RTCDatabuffer object. This is
24 * needed to pass to the underlying C++ APIs.
25 */
26@property(nonatomic, readonly) const webrtc::DataBuffer *nativeDataBuffer;
27
28/** Initialize an RTCDataBuffer from a native DataBuffer. */
Yves Gerey665174f2018-06-19 15:03:05 +020029- (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer &)nativeBuffer;
hjone373dc22016-01-22 14:04:27 -080030
31@end
32
hjone373dc22016-01-22 14:04:27 -080033@interface RTCDataChannel ()
34
35/** Initialize an RTCDataChannel from a native DataChannelInterface. */
Yura Yaroshevichc75b35a2018-06-27 17:09:14 +030036- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
37 nativeDataChannel:(rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel
hjone373dc22016-01-22 14:04:27 -080038 NS_DESIGNATED_INITIALIZER;
39
Yves Gerey665174f2018-06-19 15:03:05 +020040+ (webrtc::DataChannelInterface::DataState)nativeDataChannelStateForState:
41 (RTCDataChannelState)state;
hjone373dc22016-01-22 14:04:27 -080042
43+ (RTCDataChannelState)dataChannelStateForNativeState:
Yves Gerey665174f2018-06-19 15:03:05 +020044 (webrtc::DataChannelInterface::DataState)nativeState;
hjone373dc22016-01-22 14:04:27 -080045
46+ (NSString *)stringForState:(RTCDataChannelState)state;
47
48@end
49
50NS_ASSUME_NONNULL_END