Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/feature/webrtc'
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesmchen committed Feb 10, 2017
2 parents 859dc35 + 17b2ebe commit 74ffe85
Show file tree
Hide file tree
Showing 41 changed files with 1,946 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCAVFoundationVideoSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.
*/

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCVideoSource.h>

@class AVCaptureSession;
@class RTCMediaConstraints;
@class RTCPeerConnectionFactory;

NS_ASSUME_NONNULL_BEGIN

/**
* RTCAVFoundationVideoSource is a video source that uses
* webrtc::AVFoundationVideoCapturer. We do not currently provide a wrapper for
* that capturer because cricket::VideoCapturer is not ref counted and we cannot
* guarantee its lifetime. Instead, we expose its properties through the ref
* counted video source interface.
*/
RTC_EXPORT
@interface RTCAVFoundationVideoSource : RTCVideoSource

- (instancetype)init NS_UNAVAILABLE;

/** Returns whether rear-facing camera is available for use. */
@property(nonatomic, readonly) BOOL canUseBackCamera;

/** Switches the camera being used (either front or back). */
@property(nonatomic, assign) BOOL useBackCamera;

/** Returns the active capture session. */
@property(nonatomic, readonly) AVCaptureSession *captureSession;

@end

NS_ASSUME_NONNULL_END
25 changes: 25 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCAudioSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2016 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.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaSource.h>

NS_ASSUME_NONNULL_BEGIN

RTC_EXPORT
@interface RTCAudioSource : RTCMediaSource

- (instancetype)init NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END
28 changes: 28 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCAudioTrack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.
*/

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaStreamTrack.h>

NS_ASSUME_NONNULL_BEGIN

@class RTCAudioSource;

RTC_EXPORT
@interface RTCAudioTrack : RTCMediaStreamTrack

- (instancetype)init NS_UNAVAILABLE;

/** The audio source for this audio track. */
@property(nonatomic, readonly) RTCAudioSource *source;

@end

NS_ASSUME_NONNULL_END
31 changes: 31 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCCameraPreviewView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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.
*/

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import <WebRTC/RTCMacros.h>

@class AVCaptureSession;
@class RTCAVFoundationVideoSource;

/** RTCCameraPreviewView is a view that renders local video from an
* AVCaptureSession.
*/
RTC_EXPORT
@interface RTCCameraPreviewView : UIView

/** The capture session being rendered in the view. Capture session
* is assigned to AVCaptureVideoPreviewLayer async in the same
* queue that the AVCaptureSession is started/stopped.
*/
@property(nonatomic, strong) AVCaptureSession *captureSession;

@end
110 changes: 110 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCConfiguration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
* 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.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>

@class RTCIceServer;

/**
* Represents the ice transport policy. This exposes the same states in C++,
* which include one more state than what exists in the W3C spec.
*/
typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) {
RTCIceTransportPolicyNone,
RTCIceTransportPolicyRelay,
RTCIceTransportPolicyNoHost,
RTCIceTransportPolicyAll
};

/** Represents the bundle policy. */
typedef NS_ENUM(NSInteger, RTCBundlePolicy) {
RTCBundlePolicyBalanced,
RTCBundlePolicyMaxCompat,
RTCBundlePolicyMaxBundle
};

/** Represents the rtcp mux policy. */
typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) {
RTCRtcpMuxPolicyNegotiate,
RTCRtcpMuxPolicyRequire
};

/** Represents the tcp candidate policy. */
typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
RTCTcpCandidatePolicyEnabled,
RTCTcpCandidatePolicyDisabled
};

/** Represents the candidate network policy. */
typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
RTCCandidateNetworkPolicyAll,
RTCCandidateNetworkPolicyLowCost
};

/** Represents the continual gathering policy. */
typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
RTCContinualGatheringPolicyGatherOnce,
RTCContinualGatheringPolicyGatherContinually
};

/** Represents the encryption key type. */
typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
RTCEncryptionKeyTypeRSA,
RTCEncryptionKeyTypeECDSA,
};

NS_ASSUME_NONNULL_BEGIN

RTC_EXPORT
@interface RTCConfiguration : NSObject

/** An array of Ice Servers available to be used by ICE. */
@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;

/** Which candidates the ICE agent is allowed to use. The W3C calls it
* |iceTransportPolicy|, while in C++ it is called |type|. */
@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;

/** The media-bundling policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;

/** The rtcp-mux policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
@property(nonatomic, assign)
RTCContinualGatheringPolicy continualGatheringPolicy;
@property(nonatomic, assign) int audioJitterBufferMaxPackets;
@property(nonatomic, assign) int iceConnectionReceivingTimeout;
@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;

/** Key type used to generate SSL identity. Default is ECDSA. */
@property(nonatomic, assign) RTCEncryptionKeyType keyType;

/** ICE candidate pool size as defined in JSEP. Default is 0. */
@property(nonatomic, assign) int iceCandidatePoolSize;

/** Prune turn ports on the same network to the same turn server.
* Default is NO.
*/
@property(nonatomic, assign) BOOL shouldPruneTurnPorts;

/** If set to YES, this means the ICE transport should presume TURN-to-TURN
* candidate pairs will succeed, even before a binding response is received.
*/
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;

- (instancetype)init NS_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END
134 changes: 134 additions & 0 deletions Build/iOS/WebRTC.framework/Headers/RTCDataChannel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* 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.
*/

#import <AvailabilityMacros.h>
#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>

NS_ASSUME_NONNULL_BEGIN

RTC_EXPORT
@interface RTCDataBuffer : NSObject

/** NSData representation of the underlying buffer. */
@property(nonatomic, readonly) NSData *data;

/** Indicates whether |data| contains UTF-8 or binary data. */
@property(nonatomic, readonly) BOOL isBinary;

- (instancetype)init NS_UNAVAILABLE;

/**
* Initialize an RTCDataBuffer from NSData. |isBinary| indicates whether |data|
* contains UTF-8 or binary data.
*/
- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary;

@end


@class RTCDataChannel;
RTC_EXPORT
@protocol RTCDataChannelDelegate <NSObject>

/** The data channel state changed. */
- (void)dataChannelDidChangeState:(RTCDataChannel *)dataChannel;

/** The data channel successfully received a data buffer. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didReceiveMessageWithBuffer:(RTCDataBuffer *)buffer;

@optional
/** The data channel's |bufferedAmount| changed. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didChangeBufferedAmount:(uint64_t)amount;

@end


/** Represents the state of the data channel. */
typedef NS_ENUM(NSInteger, RTCDataChannelState) {
RTCDataChannelStateConnecting,
RTCDataChannelStateOpen,
RTCDataChannelStateClosing,
RTCDataChannelStateClosed,
};

RTC_EXPORT
@interface RTCDataChannel : NSObject

/**
* A label that can be used to distinguish this data channel from other data
* channel objects.
*/
@property(nonatomic, readonly) NSString *label;

/** Whether the data channel can send messages in unreliable mode. */
@property(nonatomic, readonly) BOOL isReliable DEPRECATED_ATTRIBUTE;

/** Returns whether this data channel is ordered or not. */
@property(nonatomic, readonly) BOOL isOrdered;

/** Deprecated. Use maxPacketLifeTime. */
@property(nonatomic, readonly) NSUInteger maxRetransmitTime
DEPRECATED_ATTRIBUTE;

/**
* The length of the time window (in milliseconds) during which transmissions
* and retransmissions may occur in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxPacketLifeTime;

/**
* The maximum number of retransmissions that are attempted in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxRetransmits;

/**
* The name of the sub-protocol used with this data channel, if any. Otherwise
* this returns an empty string.
*/
@property(nonatomic, readonly) NSString *protocol;

/**
* Returns whether this data channel was negotiated by the application or not.
*/
@property(nonatomic, readonly) BOOL isNegotiated;

/** Deprecated. Use channelId. */
@property(nonatomic, readonly) NSInteger streamId DEPRECATED_ATTRIBUTE;

/** The identifier for this data channel. */
@property(nonatomic, readonly) int channelId;

/** The state of the data channel. */
@property(nonatomic, readonly) RTCDataChannelState readyState;

/**
* The number of bytes of application data that have been queued using
* |sendData:| but that have not yet been transmitted to the network.
*/
@property(nonatomic, readonly) uint64_t bufferedAmount;

/** The delegate for this data channel. */
@property(nonatomic, weak) id<RTCDataChannelDelegate> delegate;

- (instancetype)init NS_UNAVAILABLE;

/** Closes the data channel. */
- (void)close;

/** Attempt to send |data| on this data channel's underlying data transport. */
- (BOOL)sendData:(RTCDataBuffer *)data;

@end

NS_ASSUME_NONNULL_END

0 comments on commit 74ffe85

Please sign in to comment.